Repository navigation
feat(cli): report live ceiling headroom in adf context --files - #454
Merged
Merged
Conversation
For each --files entry that maps to a manifest METRICS source, adf context
now adds an additive `ceilings` array ({ file, metric, value, ceiling,
headroom, status, module }) to its JSON output, plus a Ceilings block in
text mode. Measurement moves into a shared adf-ceilings module that adf
evidence --auto-measure now also uses, so the value an agent sees before
editing is exactly what the gate enforces (trailing newline included).
Closes #443
Part of #437
Co-Authored-By: Claude Opus 5.5 <[email protected]>
stackbilt-admin
pushed a commit
that referenced
this pull request
Nov 28, 2026
Add 3.0.0 entries for #453 (MCP getProjectContext task tokenizer parity, adf context --bundle path fix; #438, #439), #454 (live ceiling headroom in adf context --files; #443), #382 (publish:check on Windows) and #385 (Dependabot covers the pinned SBOM generator). Apply the #456 review nits: drop the two stray blank lines that made the Changed list loose, and note that #425 also updated the supply-chain workflow and dependabot.yml comments. The 3.0.0 date placeholder is left for the release owner. Refs #397 Co-Authored-By: Claude Opus 5.5 <[email protected]>
stackbilt-admin
pushed a commit
that referenced
this pull request
Nov 28, 2026
Brings in #453 (task tokenizer parity, --bundle path fix) and #454 (ceiling headroom). Resolves the adf-context.ts conflict by keeping both the path-token import and triggerMatches (this branch) and the ceilings field (main). The adf-ceilings key-order test now expects triggerMatches between resolvedModules and ceilings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
stackbilt-admin
pushed a commit
that referenced
this pull request
Nov 28, 2026
…o feat/issue-447-preflight-slice Brings in #453 and #454 (squash-merged on main) through #452's round-3 merge, plus #452's memoized resolvePathTokenRoot and filePathRoutingKeywords. Conflicts resolved toward this branch's preflight code (which already contains the #443/#454 ceilings work); fileRoutingKeywords is kept as a thin wrapper over #452's filePathRoutingKeywords. Co-Authored-By: Claude Opus 5.5 <[email protected]>
stackbilt-admin
added a commit
that referenced
this pull request
Nov 28, 2026
Add 3.0.0 entries for #453 (MCP getProjectContext task tokenizer parity, adf context --bundle path fix; #438, #439), #454 (live ceiling headroom in adf context --files; #443), #382 (publish:check on Windows) and #385 (Dependabot covers the pinned SBOM generator). Apply the #456 review nits: drop the two stray blank lines that made the Changed list loose, and note that #425 also updated the supply-chain workflow and dependabot.yml comments. The 3.0.0 date placeholder is left for the release owner. Refs #397 Co-authored-by: Kurt Overmier <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
stackbilt-admin
pushed a commit
that referenced
this pull request
Nov 28, 2026
Review fixes for #458: - #454 entry: ceilings print as the preflight Headroom line, not a Ceilings: block; drop the stale "--keywords-only output unchanged". - #455 entry: parse errors are tolerated only without --bundle; the preflight block goes to stderr with --bundle; MCP returns the full preflight fields. - Changed: #452 signals now read the repo-relative path; nothing-binds shortens CLI text and the MCP response. - Breaking: scope "MCP argument shapes unchanged" to the Zod migration. Co-Authored-By: Claude Opus 5.5 <[email protected]>
stackbilt-admin
added a commit
that referenced
this pull request
Nov 28, 2026
* docs(changelog): add 3.0.0 entries for #452 and #455 Both merged after #457, so 3.0.0 would have shipped them without notes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): correct 3.0.0 entries for #452, #454 and #455 Review fixes for #458: - #454 entry: ceilings print as the preflight Headroom line, not a Ceilings: block; drop the stale "--keywords-only output unchanged". - #455 entry: parse errors are tolerated only without --bundle; the preflight block goes to stderr with --bundle; MCP returns the full preflight fields. - Changed: #452 signals now read the repo-relative path; nothing-binds shortens CLI text and the MCP response. - Breaking: scope "MCP argument shapes unchanged" to the Zod migration. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: scope 3.0.0 preflight notes to --bundle and MCP behavior Second review round for #458: - Changed: --files text output changes on every run (preflight block first); the nothing-binds one-liner applies without --bundle only. - Move the MCP files response shape into the #455 Added entry; calls without files are unchanged. - Parse errors under --bundle/MCP produce no preflight fields; rule locations are repo-root relative; note the non-git root fallback and checkout-root words. - cli-reference: scope the unreadable and one-line claims to non-bundle. - Zod 4 migration guide: scope "argument shapes remain stable" to the migration and point at the new optional files argument. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): note subdirectory signals and MCP unreadable scope Round-3 review notes for #458: - #452 Changed: a relative path from a subdirectory now gains that subdirectory's signals, not only loses checkout-root ones. - #455 Added: over MCP, unreadable is always empty because a parse error fails the call; drop it from "same as the CLI". Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Kurt Overmier <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Open
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
charter adf context --files ... --format jsonnow has an additiveceilingsarray. Each file that maps to a manifest METRICS source gets one entry:{ file, metric, value, ceiling, headroom, status, module }. Text mode prints aCeilings:block. The--bundleJSON output gets the same key.packages/cli/src/commands/adf-ceilings.ts, andadf evidence --auto-measurenow uses it too. Both commands count lines the same way (split('\n').length, so the trailing newline counts as a line). The number an agent sees before editing is the number CI enforces.adf-evidence.tsgot shorter (274 -> 261 lines).statusandceilingcome fromvalidateConstraintson the module that declares the metric. That module is searched for in DEFAULT_LOAD first, then ON_DEMAND, so pass/warn/fail follows the gate's own rules.Behaviour
ceilingskey appears only when--filesis given (it can be an empty array). Output from--keywordsalone is unchanged. Existing keys and exit codes are unchanged../src/x.ts, absolute paths and Windows backslashes all match.fileis always the manifest's repo-relative path.Acceptance check (this repo)
adf evidence --auto-measurereportsadf_migrate_loc: 792for the same file.Notes for merge
adf-context.tschanges are only in the import block, the two JSON output objects, one line in the text branch, and two helper functions at the end of the file. The--bundlereader (~line 90) andfilePathToKeywordsare untouched, so this should merge cleanly with the parallel branches.--bundletest. On main,--bundlethrowsModule not foundbecause it joinsaiDirtwice; the parallel bundle-reader branch fixes that. A test forceilingsin bundle output can go in once that lands.serve.ts(updateEvidenceMCP tool) still has its own copy of the line count. I left it alone to keep this diff small; it can switch tomeasureLineslater.Tests
packages/cli/src/__tests__/adf-ceilings.test.ts(trailing-newline counting, headroom equal to ceiling minus the auto-measured value, files with no metric, no key for--keywordsalone, ON_DEMAND module attribution, path normalization, missing files).tsc --buildandtsc --noEmitare clean. The targeted tests (adf-ceilings, adf-context, adf-metrics) pass.spawnSync sh ENOENT, WSL path mangling). The remaining failures are the known Windows ones (context-refresh/serve-context paths, bootstrap bootstrap: phases 6/7 collect warnings without printing them; absoluteAiDirArg misses Windows paths on POSIX #307, github-commit-range timeouts). None of them touch the changed code.Closes #443
Part of #437
🤖 Generated with Claude Code