feat(db): model-aware cost estimation and sidecar cleanup#48
Merged
Conversation
* chore: new branch (#33) * fix(ci): bench scorecard ci windows fixes (#34) * ci: auto-template and title for dev to main PRs * release: v0.3.2 (dev -> main) (#35) * New branch (#33) * chore: add pending project files * refactor(ingest): centralize ingestion via parser/resolver/store layers * docs: document layered ingest architecture * test(perf): add qmd benchmark harness and non-blocking CI regression check * perf(bench): add ingest hotpath benchmark and record qmd optimization * perf(ingest): batch session writes and add stable benchmark tooling * Add benchmark scorecard to CI summary and sticky PR comment * Fix bench import path and temporarily disable design-contract workflow * CI: checkout qmd submodule in perf bench workflow * Fix Windows path handling in ingest session discovery * Feature/bench scorecard ci windows fixes (#34) * chore: add pending project files * refactor(ingest): centralize ingestion via parser/resolver/store layers * docs: document layered ingest architecture * test(perf): add qmd benchmark harness and non-blocking CI regression check * perf(bench): add ingest hotpath benchmark and record qmd optimization * perf(ingest): batch session writes and add stable benchmark tooling * Add benchmark scorecard to CI summary and sticky PR comment * Fix bench import path and temporarily disable design-contract workflow * CI: checkout qmd submodule in perf bench workflow * Fix Windows path handling in ingest session discovery * CI: run full test matrix only on merge branches * CI: auto-create draft prerelease on successful dev CI * CI: auto-template and title for dev to main PRs * ci: create dev draft release after successful dev test matrix * chore: add e2e dev release flow test marker (#36) * release: v0.3.2 (dev -> main) (#37) * New branch (#33) * chore: add pending project files * refactor(ingest): centralize ingestion via parser/resolver/store layers * docs: document layered ingest architecture * test(perf): add qmd benchmark harness and non-blocking CI regression check * perf(bench): add ingest hotpath benchmark and record qmd optimization * perf(ingest): batch session writes and add stable benchmark tooling * Add benchmark scorecard to CI summary and sticky PR comment * Fix bench import path and temporarily disable design-contract workflow * CI: checkout qmd submodule in perf bench workflow * Fix Windows path handling in ingest session discovery * Feature/bench scorecard ci windows fixes (#34) * chore: add pending project files * refactor(ingest): centralize ingestion via parser/resolver/store layers * docs: document layered ingest architecture * test(perf): add qmd benchmark harness and non-blocking CI regression check * perf(bench): add ingest hotpath benchmark and record qmd optimization * perf(ingest): batch session writes and add stable benchmark tooling * Add benchmark scorecard to CI summary and sticky PR comment * Fix bench import path and temporarily disable design-contract workflow * CI: checkout qmd submodule in perf bench workflow * Fix Windows path handling in ingest session discovery * CI: run full test matrix only on merge branches * CI: auto-create draft prerelease on successful dev CI * CI: auto-template and title for dev to main PRs * CI: create dev draft release after successful dev test matrix * chore: add e2e dev release flow test marker (#36) * docs: update CHANGELOG.md for v0.4.0 [skip ci] * docs: add CI/release workflow architecture and north-star plan * ci: add commit lint, semver metadata, and deterministic release notes * docs: finalize workflow policy docs without backlog sections * ci: scope commit lint to pull request commit ranges only * fix(ci): setup bun before dev draft release metadata step * fix(ci): allow legacy non-conventional history for dev draft metadata * fix(release): align dev-main PR version with latest stable tag * ci: improve workflow and check naming for PR readability * ci: skip PR test job for dev to main release PRs * fix(ci): use import.meta.dir for cross-platform path resolution new URL(import.meta.url).pathname produces /D:/a/... on Windows, causing ENOENT errors. import.meta.dir is Bun's cross-platform alternative. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: add auto-release job for main branch merges After tests pass on main, automatically compute the next semver version and create a GitHub release. Handles squash merges (which lose individual commit types) by defaulting to patch when commits exist but bump is "none". Skips if HEAD is already tagged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Baseline User <baseline@example.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Previous squash merge body contained [skip ci] from an old commit message, which prevented GitHub Actions from running. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add MODEL_PRICING map for Claude model families, estimateCost() for per-turn USD estimation, wire estimated_cost_usd into upsertSessionCosts, and add deleteSidecarRows() for force re-ingest cleanup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Benchmark Scorecard (ci-small)Bench Scorecard (ci-small)threshold: 20.00%
Summary: WARN (4 metrics) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
estimateCost()with per-million-token pricing for the Claude model families. Matches on model family prefix (claude-opus-4,claude-sonnet-4,claude-haiku-4) so versioned model strings likeclaude-sonnet-4-20250514resolve correctly. Falls back to Sonnet pricing for unknown models.upsertSessionCosts()now computes and accumulatesestimated_cost_usdon every turn, so cost is always up to date insmriti_session_costs.deleteSidecarRows()to remove all sidecar data for a session in one call (tool usage, file ops, commands, errors, git ops, costs). Needed for re-ingestion and test teardown.Pricing table
claude-opus-4claude-sonnet-4claude-haiku-4Test plan
smriti statusshows estimated cost