You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every Code has a visible, testable prompt/context assembly contract: each context source has an identity, prompt-size contribution is observable before requests are sent, and duplicate/bloated context producers are caught by tests or diagnostics before they silently burn tokens.
Current Status
State: Core request ledger and first /context TUI view are merged; #93 is complete.
Next action: Use /context on real sessions to choose the next observability/budgeting increment: duplicate grouping, richer visual bars, harness request-shape assertions, or budgeting thresholds.
Blocked by: None.
Waiting for: Next implementation slice selection.
Last verified: 2026-05-22; PR #96 merged as f09fa68, local overlay was fast-forwarded, just local-code-rebuild completed, and PATH code reports 0.6.98.
Acceptance Criteria
Prompt assembly has named source/category buckets such as base instructions, developer messages, user/project instructions, skills catalog, explicit skill bodies, environment context, memories, history, pending input, tool outputs, and status/browser items.
Before API submission, Every Code logs or emits a compact prompt composition summary with item counts and byte/token estimates by bucket.
The same ledger powers a user-facing /context command or view in the TUI, similar in spirit to Claude Code / Antigravity context views but tailored to Every Code's sources.
/context shows at least total estimated context, per-source budget bars/counts, whether each source is persisted or request-only, and the largest contributors.
/context can highlight likely duplicate contextual fragments or repeated source identities before tokens are spent.
Contextual fragments have stable identity or markers so duplicate user instructions, skills catalog, environment context, explicit skills, and status fragments can be detected intentionally rather than by ad hoc string checks.
Regression tests assemble prompts with multiple producers active and assert each one-shot contextual source appears once.
The code-exec harness has fake Responses coverage proving the ledger/view matches the real executable request shape, not only lower-level helper internals.
Several context producers append directly into request/history without a shared ledger.
Some producers dedupe locally, but there is no final assembled-prompt invariant.
Upstream codex-rs has useful reference patterns around contextual fragments and skill config/policy that can guide Every Code without wholesale porting.
Ledger data model: add a small internal prompt/context source record with source id, category, persistence class, byte/token estimate, and duplicate key.
Request assembly instrumentation: populate the ledger from the same places that assemble the real request, then log or emit it immediately before API submission.
/context first view: expose a compact TUI command that shows total estimate, per-source bars/counts, persisted vs request-only context, top contributors, and duplicate warnings.
Harness truth test: add fake Responses scenarios that assert /context or emitted ledger data matches the captured real request body shape.
Budget guardrails: use the same source categories to warn or enforce limits for memories, auto-review/auto-drive, history, status/browser items, and explicit skills.
UX polish: add drilldowns, before/after compaction views, and selected-source inspection once the ledger is proven reliable.
Open Questions
Should the first implementation slice be log/event-only, or should it include a minimal /context command from the start?
Should /context inspect the last submitted request, the next request estimate, or both?
Which persistence labels should be canonical: persisted history, contextual/session, request-only, generated-per-attempt, and tool-result?
Should token counts start with approximate byte/token estimates and graduate to provider/model-specific tokenizer estimates later?
Should duplicate detection be fail-fast in tests only, warn at runtime, or surface directly in /context?
Should the first TUI view be text/table only, or include proportional bars immediately?
How should compacted history and previous-response-id/ZDR modes be represented so the view stays truthful across providers?
Finish Line
Every Code has a visible, testable prompt/context assembly contract: each context source has an identity, prompt-size contribution is observable before requests are sent, and duplicate/bloated context producers are caught by tests or diagnostics before they silently burn tokens.
Current Status
State: Core request ledger and first
/contextTUI view are merged; #93 is complete.Next action: Use
/contexton real sessions to choose the next observability/budgeting increment: duplicate grouping, richer visual bars, harness request-shape assertions, or budgeting thresholds.Blocked by: None.
Waiting for: Next implementation slice selection.
Last verified: 2026-05-22; PR #96 merged as f09fa68, local overlay was fast-forwarded,
just local-code-rebuildcompleted, and PATHcodereports0.6.98.Acceptance Criteria
/contextcommand or view in the TUI, similar in spirit to Claude Code / Antigravity context views but tailored to Every Code's sources./contextshows at least total estimated context, per-source budget bars/counts, whether each source is persisted or request-only, and the largest contributors./contextcan highlight likely duplicate contextual fragments or repeated source identities before tokens are spent.Evidence / Context
This is the systemic follow-up to two concrete duplication bugs:
75710e00fdby filtering already-recorded pending tool outputs.user_instructions, then recomposed.Read-only agent review found the common pattern:
codex-rshas useful reference patterns around contextual fragments and skill config/policy that can guide Every Code without wholesale porting.Proposed Phases
$skillinjection./contextfirst view: expose a compact TUI command that shows total estimate, per-source bars/counts, persisted vs request-only context, top contributors, and duplicate warnings./contextor emitted ledger data matches the captured real request body shape.Open Questions
/contextcommand from the start?/contextinspect the last submitted request, the next request estimate, or both?/context?Relationships
Parent context: #43
Related: #46, #47, #50, #76, #90, #91