Add agent context budget gate and blocker graph fixes
Merged
UN
4mo ago+979+979+012345678901234567890123456789-46-46-01234567890123456789
Summary
- add a deterministic token-budget release gate over 14 agent-facing CLI surfaces and wire it into
quality:staticplus release readiness contracts - preserve
pm searchinlinefield:valuetokens so quoted and unquoted hybrid queries keep residual keywords - make repeated
pm update --blocked-byappend resolvedblocked_bydependency edges while the scalar tracks the latest blocker - update SDK contract descriptions, command docs, pm tracker evidence, and generated changelog
Tracked pm items: pm-cu1i, pm-q6gx, pm-2ldo.
Verification
node scripts/run-tests.mjs test -- tests/unit/cli/bootstrap-args.spec.ts tests/unit/commands/update-command.spec.tsnode scripts/run-tests.mjs test -- tests/unit/scripts/release/token-budget-gate.spec.ts && pnpm quality:token-budgetnode scripts/run-tests.mjs test -- tests/integration/release-automation-contract.spec.ts tests/integration/release-readiness-runtime.spec.ts- isolated temp
PM_PATHmanual proof forsearch status:all,update --blocked-byappend semantics, and compact context output pnpm test:coverage(267 files, 5480 tests, 100% statements/branches/functions/lines)pnpm version:check && pnpm changelog:pm:check && pnpm contracts:check && pnpm security:scan && pnpm lint && npm pack --dry-rungreptile review --branch main --agent(final pass: confidence 5/5, no review comments)
Summary by cubic
Adds a deterministic token-budget gate for 14 agent-facing CLI surfaces and fixes search parsing and blocker graph updates. Hardens the gate with manifest entry validation, builds the CLI before measuring, and makes tests platform-safe to keep agent context output small and reliable.
-
New Features
- Added
scripts/release/token-budget-gate.mjswith a checked-in manifestscripts/release/token-budgets.json; measures UTF-8 bytes and blocks regressions with optional --update. (pm-cu1i) - Wired the gate into
quality:static(now runspnpm buildfirst) and addedquality:token-budget; release automation/readiness tests pin this gate.
- Added
-
Bug Fixes
- Search: preserved inline
field:valuetokens inpm searchso quoted/unquoted hybrids keep residual keywords (e.g., "status:all scene"). (pm-2ldo) - Blockers:
pm update --blocked-bynow appends resolvedblocked_byedges, dedupes repeats, preserves existing edges when the new value is unresolved, and clears all on--unset blocked-by; scalar keeps the latest blocker. (pm-q6gx) - Token-budget gate hardening: kept child-process env; validated manifest shape and each entry (string id, non-negative
max_bytes); bare--manifestuses the default path; built CLI before measuring; made missing-CLI path/tests Windows-safe; isolated tests (restoredprocess.argv/process.exitCode, cleared env). Updated SDK command contracts, command docs, and changelog.
- Search: preserved inline