feat(floor): cost.json shows stage elapsed time and deterministic work per run (6.35.0) - #299
Merged
Merged
Conversation
…k per run (6.35.0) One /pharn-loop or /pharn-ship run's cost.json now carries, beside its unchanged model usage, two additive keys: - `executions`: a VIEW over the existing phase markers (stage-executions-core.mjs, method stage-start-to-return/1). Each current-run stage-start is one row, ended only by the next marker when it is the orchestrator return; re-runs are `run 2`; anything else is unmeasured with a closed reason and elapsed_ms null, never 0. - `work[]`: facts /pharn-regress and /pharn-verify append at `done` (stage-work.mjs): gate processes executed / reused / nothing-to-run / required, BASE evidence fresh|reused, and the install's exit and ms (the one new timer). Best-effort and observational: no exit, verdict, reuse, route or commit reads it. check-cost-ledger rule 9 validates work rows and recomputes executions; /2 admits exactly the current key set or the pre-6.35.0 one (no schema bump). The run report and the stop's table show tokens, elapsed and work as three separate blocks. mark-phase.mjs, its printed binding line, run membership and stage attribution are unchanged. Promotes lesson L66. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merged
4 of 5 tasks
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
A maintainer can now answer, for one concrete
/pharn-loopor/pharn-shiprun, where the model usage went, where the observed wall-clock time went, which expensive deterministic operations ran, and which were avoided by the 6.33.0 / 6.34.0 reuse mechanisms — fromcost.json, with no second telemetry system.executions(a VIEW, no new instrumentation): derived from the existing phase markers (pharn/floor/stage-executions-core.mjs, methodstage-start-to-return/1). Every current-runstage-startis one row, ended only by the next marker when that marker is the orchestrator's return. Re-runs arerun 2, never merged. Anything else is unmeasured with a closed reason andelapsed_ms: null— never 0, never a guessed end. It is labelled everywhere as observed wall clock, not CPU, model or tool time, and not monotonic.work[](FACTS captured at the moment):/pharn-regressand/pharn-verifyeach append one line atdoneto.pharn/cost/<feature>/work.jsonl(pharn/floor/stage-work.mjs). The counts come from the gate-run stamp the verdict used: executed / reused / nothing-to-run / required, BASE evidencefresh|reused, and the install's exit andms, which is the only new timer. Per-iteration capture is needed because both reports are overwritten every iteration. The append is observational and best-effort: no exit, verdict, reuse, route or commit depends on it.work[]rows and their run-window membership, and recomputesexecutionsfrom the file's own facts./2admits exactly the current key set or the pre-6.35.0 one. No schema bump.mark-phase.mjsand its printed binding line, run membership, context binding, dedup, stage attribution (✧ equality test), and--verify-transcript.SKILLS_VERSION6.34.0 → 6.35.0.MIN_CLIstays 0.5.0. Contract:pharn/pharn-contracts/cost-ledger.md, "Stage executions and deterministic work".Evidence
.dev/features/run-performance-breakdown/DEMO.md— a controlled end-to-end fixture (not a live run). It uses the real marker writer, work-record writer, emitter, checker and run report, and answers the five questions fromcost.json. It also reports the measured overhead: under 1 ms added to render and check on a 126-request run, one extra small file read, no transcript pass, no process, no model call.stage-regress.test.mjs(★ HIT, the budgeted chain) andstage-verify.test.mjs(★ EQUIVALENCE, OBSERVATIONAL). Those tests assert the work counts against the processes the fixtures counted spawning.Pipeline verdicts (
/pharn-dev-ship)no-regressions. The first regress attempt was void — it read another session's stale result files in shared.pharn/scratch. It was redone from run-private scratch; seeREGRESSION.md, "A void first run" (promoted as L66).lint:mdonly. The single offending file is.pharn/pr-body.md, another session's gitignored scratch file, not part of this PR. Measured on a clean copy of the tree, lint:md exits 0 and the verdict over the same map is PASS;VERIFY.mdcarries both.npm test: 4502/4502. Reconcile: CLEAN.REVIEW.md): nine findings. Two were major: a FIFO planted atwork.jsonlcould hang a stage beforedone, and an unknown run window read as "no work". All are fixed with tests, or stated as bounds, before verify ran.Named residuals
gate-process-duration(no per-gate timer),ship-spec-elapsed(/pharn-shipmarks no spec stage-start),work-on-non-done-exit,work-record-provenance.🤖 Generated with Claude Code