Combine context accounting, running summaries, and updater UX fixes#1907
Conversation
…ld synthesis (#1765) Address two confirmed review findings on PR #1803: - validationState "accepted" was effectively unreachable: normalizeSummaryText derived `changed` from cosmetic normalization (NFKC, CRLF, whitespace collapse, trim), so nearly every summary persisted as "redacted". `changed` now reflects only safety-relevant transforms (secret/absolute-path redaction fired, unsafe format chars stripped, or content clamped to the max-chars bound). Cosmetic normalization alone no longer marks a summary as redacted. - Blank model content discarded valid structured fields: sanitizeSummaryContent returned undefined when content normalized to empty, causing parseStructuredSummary to reject the whole summary and leaving synthesizeSummaryContent(fields) as dead code. It now returns an empty value for unusable-but-string content so content is synthesized from the already-sanitized structured fields (each item independently redacted), preserving decisions/constraints/files/debugging/open-threads. Adds two regression tests. Incidental hunks are the project format-on-save hook normalizing pre-existing non-prettier-clean lines; no behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…counting (#1766) - Split chat-prompt-budget-diagnostics.ts under the 400-LOC cap by extracting the token-summary helpers into chat-prompt-budget-token-summary.ts. - Document the deliberate lane attribution: the compaction summary's tokens are charged to the history-summary lane (which owns the +1 summary item), while system-contract reports only the bare canonical system prompt. - Pin the compacted-path lane split with a mutation-robust test. - Reject stray scaleMilli/offsetTokens under source "fallback-estimated". - Document the defensive clamp in calibratedTokenCount; add redactTokenAccounting and validator-rejection test coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…librated-token-accounting # Conflicts: # packages/keiko-model-gateway/src/config.ts # packages/keiko-server/src/chat-prompt-budget.ts
…librated-token-accounting
…oken-accounting' into codex/combined-context-updater
…-clean' into codex/combined-context-updater # Conflicts: # packages/keiko-evidence/src/qualityIntelligence/__tests__/verificationCache.test.ts # packages/keiko-server/src/chat-prompt-budget.ts # packages/keiko-server/src/qualityIntelligence/__tests__/reviewStore.locking.test.ts
…/combined-context-updater # Conflicts: # packages/keiko-evidence/src/listByPrefix.test.ts # packages/keiko-evidence/src/qualityIntelligence/__tests__/verificationCache.test.ts # tests/scripts/dev-runner-readiness.test.ts
Manual test planThis PR includes user-facing updater changes. The dedicated Playwright plan covers the automatable parts; the manual path below is what a human reviewer can repeat visually.
Automated Playwright evidence passed at HEAD: |
Consolidated keiko-issue-audit receiptAudited branch: Acceptance criteria checked
Review observations resolved
Role-lens audit
EvidenceResidual risks
|
CI Follow-UpFinal pushed SHA: GitHub checks are green on the final combined branch head:
Review-thread check on #1907: no review threads returned by the PR GraphQL The dedicated updater Playwright plan is now part of the branch and is covered by: Source PRs #1802, #1803, and #1810 remain superseded by this combined PR for one final human-review path. |
Audit review — combined delivery (#1765 / #1766 / #1809)Read-first audit across contracts, model-gateway, server prompt/compaction, evidence redaction, updater preflight/session, and the update UI. CI is green at What holds up well
Non-blocking observations for the human reviewer
Governance is respected: targets |
Summary
Combines the three already-reviewed delivery branches into one traceable PR:
The combined branch keeps merge commits from all three source PRs so the evidence path remains inspectable. The only merge-resolution behavior changes preserve calibrated token accounting in prompt-budget paths, preserve system-scoped generated summaries, and keep the updater hardening/test-stability fixes from #1810.
Resolves #1765
Resolves #1766
Resolves #1809
Scope
Reuse And No-Duplication
Delivery Board
Keiko Product Deliveryproject.Parent Epic: #<epic_number>unless this PR updates an epic container directly.Classification: Epic,Status: Open Epics, and priority/order set for top-to-bottom implementation sequencing.Classification: Task,Status: In Progresswhile active, inherited or explicitPriority, andHuman Review Required: Yes.StatusisIn Progresswhile work is active, orDoneonly after merge and closure evidence.Workflow StateisPR OpenorReady for Human Review.Owner / Agent,Branch,Pull Request, andHuman Review Requiredare filled.status: in progress,status: ready for human review, orstatus: doneafter merge.dev, enable auto-merge, close the issue, or bypass human review unless explicitly authorized by the human maintainer.Product Impact
Update Impact
improvements,fixes,ui-polish.high.target unknownwhen the current release is latest.dev.npm run check:release-impact.Verification
Required:
Local verification:
Reuse / gap rationale:
Select only what applies:
npm run check:release-impactor an explicit rationale.Not applicable rationale:
Review And Closure
Resolves #<issue_number>only when this PR should close the issue.Risk Notes
role: "user".dev, so it is human-gated and must wait for GitHub CI plus maintainer review.