Skip to content

feat(contextmd): serve the Great Library pointer at first input and after compaction #311

Closed

Description

@lukemaj

What: Chromeria adds the budgeted Great Library pointer and its first-input and compaction lifecycle on Claude, Codex, Grok and OpenCode.
Why: The registered Great Library is not discoverable at those native decision boundaries, and serving needs to own its claims, byte budget and evidence.
So what: Build the reviewed serving capability in the exclusive task worktree, run focused/native-boundary proof, and open the task PR for exact-head Sol/Grok implementation review.

Parent

toolboxmd/contextmd#34

Outcome

The server half of the accepted #34 design: optional configured index pointer, one accurate shared/personal instruction at first input and immediate compaction continuation, UTF-8 run budget and logs, independent OpenCode receipts, durable Grok creation/attach evidence and correct Codex fork inheritance. This advances the Promachos through discoverable shared knowledge. The parent Spec owns the accepted design, user decisions, deployment and twelve live cells.

Acceptance criteria

  • The optional config key preserves current loader/matcher behavior and disabled defaults.
  • Whole-pointer UTF-8 accounting fits the 8000-byte serving run and records great_library rows.
  • First input and compact epochs use the reviewed Claude/Codex/OpenCode/Grok seams.
  • OpenCode pointer claims/bytes/candidates cannot be settled or refunded by ordinary context.
  • Every adopted Grok session/new has durable installation evidence before ref adoption and charges once before prompt, or fails without dispatch.
  • Codex fork inheritance, nested fork/rollback/refork and missing-copy/compaction negatives satisfy the accepted R2 evidence rule.
  • Focused state/API/adapter/fence tests and integration proof exercise actual owners; unrelated main changes are preserved.
  • PR has both exact-head independent statuses and green checks, with actual main comparison for any claimed pre-existing failure. No version bump or restart.

Design review and scope

Accepted Spec contextmd#34 names Opus, Grok v5 NO BLOCKING FINDINGS and Sol final scoped R2 NO BLOCKING FINDINGS with exact artifact/report digests and user decisions. No new design round. Current base 366f2ff includes merged matcher/flat Library work; implementation preserves it. ContextMD's companion implementation is on base 5dc096cac8c0fecf548aba2b8b1886a12d226118, version 1.0.0.

Upstream first

At implementation start, pingdotgg/t3code main is 7ac952c. Open Great Library Issue search and open contextmd PR search return none. Earlier broader hook/system-context searches are recorded in #34; no upstream pointer replacement exists to port. Shared adapter/orchestration changes remain small hooks into the fork-owned serving capability.

Non-goals

Capture #8, persona/preferences/memory, registration, matcher #243/#52, shown #245, generic #221, loader #41, event reads #256, pointer-trial #43, follow-ups #71/#72/#73 and the separately tracked #310 restore reconciliation, frontend/browser work, deployment/restart and package versions.

Blocked by

None for implementation: design/authority cleared. A supporting running build later gates activation and live proof. The companion ContextMD plugin/config PR consumes this API.

Required proof

The parent Spec's focused serving and native-boundary checks, with commands/results and exact heads on the PR. On bestia use npx -y pnpm@11.10.0 install and npx -y pnpm@11.10.0 exec vp test run . CI owns broad repository coverage; no full local suites. Real OpenCode mixed/native-save/replay and Codex recording-model cases are integration gates, not claimed by handwritten receipt doubles.

Elon record

  • Requirements and who asked: User/contextmd#34 requires the server-owned first-input/post-compaction pointer, provider decisions, UTF-8 run budget/log evidence, approved design, reviewed task PRs and authorized main merge.
  • Deleted: Upstream replacement guesses, registration, version bumps, restart, other agents' scope, generic framework and nonblocking polish.
  • Bottleneck: Implement the accepted owners and run the discriminating actual-boundary checks; design is cleared and supporting builds wait until merge.
  • Checked myself: Full accepted Spec/design/reviews, exact source traces and current base diff, clean task branches, upstream searches/main identity, old focused baselines and prototype evidence limits.

Activity

  1. lukemaj commented on Oct 14, 2026

    @lukemaj
    ContributorAuthor

    What: The server candidate is pushed and source-frozen at 20975c00174e24d46c1822d1a4dee3ee7885eef7 in replacement PR #327 against main, linked to this T3 task; superseded #322 is closed.
    Why: The #291 native provider migration and #313 receipt accounting changed the base, so the pointer hooks were rebased and the combined owner behavior was proved again.
    So what: The parent binds the existing native jobs to this backend and frozen ContextMD candidate, obtains fresh exact-head Sol/Grok comments/statuses and CI, then owns merge and rollout.

    • Exclusive branch/workspace: feat/contextmd-34-great-library-pointer-native-main, /home/luke/dev/toolboxmd/chromeria-worktrees/34-great-library-pointer; clean and equal to origin. Current live main/base: 555f0a00198b7aba75d8e8ce13af9c7d983712f4. Original task base: 366f2fff6f25f47c14ca86163d8ee8e4dd6c0961. Ten owned commits above current base, no merge commits. Prior branch feat/contextmd-34-great-library-pointer-rebased stays at c382af92d82d8b905402da0ad1dc07aad5a5cbd7; original branch stays at 45e7b22c494fcf681e95a099e533217b8fad7840. No force push, local main checkout/ref mutation or gate exception. The old PRs retain their evidence and replacement links.
    • Replayed only the seven task commits from the old da7034e..c382af9 range onto absorbed main 0387459, added a bounded API adaptation checkpoint, then rebased those eight unpublished commits onto the one-forward-commit 555f0a0 base. Added the combined receipt control and final ownership PR reference. No historical upstream range was carried into the feature patch. Feature diff is 27 files, 3,468 insertions / 117 deletions.
    • User-authorized path moves: existing small instruction/receipt hooks now live at packages/provider-core/src/server/ProviderAdapter.ts, packages/provider-acp/src/server/adapter.ts and packages/provider-acp/src/server/AcpSessionRuntime.ts. Preserve the current effectful factory, service-provided MCP context, AgentScope, thread titles and OOM scope case. New Effect API calls use randomUUIDv4(); strict tilde substitution uses injected HostProcess.HomeDirectory and still preserves Python spelling. Tests use current constructor/layer/namespace signatures. These are dependency/caller adaptations, not a new hook or adapter contract design.
    • feat(contextmd): prove native receipt for settled context serves #313 disposition: retain its native receipt fields, migration, checker, scheduling and observer methods at their owners. Generic D mutations remain delivery-scoped and mark D's native-receipt eligibility. Pointer P remains independently applying/settled/released, charged and claimed. The actual Route/Serving/State/Cue control runs the checker while P is applying, establishes D unknown/no_evidence_source and P no shown fact, and proves budgets, claims, candidate states and epochs unchanged. Explicit P release refunds P only; a subsequent settled P stays excluded from generic closures/checker accounting.
    • Shown.ts, Shown.test.ts, ContextmdServing.test.ts, Harnesses.test.ts, ClaudeAdapterV2 and its tests, GLOSSARY.md, docs/map.md and scripts/fork-check.sh are byte-identical to 555f0a0. All 35 foreign ownership entries equal main; all feat(contextmd): prove native receipt for settled context serves #313 ContextMD inventory fields remain. The existing ContextMD owner watches the renamed files while the ACP adapter's previous primary owner remains unchanged. The fork state algorithm is byte-identical to c382af92d8; no shown extractor, matcher, capture, Library loader or generic restore behavior changed. ships contextmd#34; no Chromeria map part.
    • Executed focused proof at d2f00a9764f682316f6db36b5a4f33ab60f0de6e: 14 files, 584 tests pass, 100.55 s, using exact npx -y pnpm@11.10.0 exec vp test run. Paths are fully recorded in PR feat(contextmd): serve budgeted Great Library pointers across native sessions #327 and retained COMMANDS.txt: Select, ServingState, GreatLibrary, ContextmdRoute, the untouched feat(contextmd): prove native receipt for settled context serves #313 ContextmdServing/Harnesses/Shown suites, ProviderTurnStartService and its memory case, ProviderSessionManager, CheckpointRollbackService, CheckpointRestoreSafety, AcpAdapterV2 and AcpJsonRpcConnection.
    • Scoped types: npx -y pnpm@11.10.0 exec tsc-rs --noEmit -p for apps/server/tsconfig.json, packages/provider-core/tsconfig.json and packages/provider-acp/tsconfig.json, all exit 0. Scoped vp lint over changed TS/MJS paths against 555f0a0 exits 0, five warnings in unchanged ACP test code. npx -y pnpm@11.10.0 install exited 0 at the absorbed 0387459 base; manifests and lockfile are unchanged by feat(contextmd): prove native receipt for settled context serves #313, so the installed setup was retained. Node 26.8.2 engine/bin warnings did not prevent proof. No package/version bump.
    • Final 20975c0017 changes only the ownership reference from feat(contextmd): serve the Great Library pointer across native epochs #322 to feat(contextmd): serve budgeted Great Library pointers across native sessions #327. git diff --exit-code d2f00a9764 HEAD -- apps packages docs/map.md scripts/fork-check.sh exits 0. All 34 saved source/evidence hashes match both the tested commit and final head. Tests/type/lint are reused for these identical inputs, not rerun for the reference-only commit. Fresh clean final bash scripts/fork-check.sh --base 8d11fe1261f0dfd74f58a1b1ae8ad7e400905fcb exits 0 on the full 88-commit stack, 36 feature owners, fork-check: OK. The explicit base is the actual absorbed upstream merge base, not fork main. Full repository coverage belongs to CI.
    • Retained current proof: /home/luke/scratch/contextmd-34-pointer/server-proof-d2f00a9764/ contains exact commands/results, all test/type/lint logs, both clean fork logs, 34 source hashes, range-diff, source/final diffs and FINAL.json. Original current logs are /tmp/TEST-chromeria311-main555-{focused,server-types,core-types,acp-types,lint}.log, /tmp/TEST-chromeria311-main555-d2f00a9-fork-stack.log and /tmp/TEST-chromeria311-main555-20975c0-fork-stack.log.
    • Preserved regression history: ordinary Claude fork cases failed before its guard fix; four compact-timing cases failed against guard-only 06ea98d. Corrected tests retain missing/failed compact re-serve, clear, multiple compacts, selected earlier boundary, stale version, removed actual emission and inherited-receiver rollback negatives. Old NULL-source rows remain conservative. Original nine-file Fork Stack Model failure at 937cbc6430 was an own failure and its necessary ownership registrations remain. Rebase API failures were observed and repaired at their owned call/fixture seams without weakened assertions. Earlier proof is archived, superseded by the 584-test/current-base run.
    • Native status: the parent reports all three native owner matrices executed at predecessor 61afeed200 with frozen ContextMD 51acaa8521d5a9b9fabe9671700ba3956f6a9500, reused for metadata-only c382af92d8. That remains predecessor evidence because absorption/feat(contextmd): prove native receipt for settled context serves #313 changed current runtime inputs. Current pair native proof is pending with the same parent-owned jobs. Live companion PR Prism guidance: planner reports router defects as model-router Issues #74 still points to exact 51acaa8521d5a9b9fabe9671700ba3956f6a9500; its workspace/source/ref was never written here. No fresh native run, model call or scratch-rig write occurred in this continuation.
    • Earlier independently read actual-owner Claude oracle: 06ea98d counts [1,1,1,1,1,2]; corrected 45e7b22 counts all six 1, injected/inherited/compact-injected/inherited outcomes, 650 charged UTF-8 bytes. Real Route/Serving/State, frozen hook 1c47c08, Claude 2.1.299, SDK fork, one automatic compact, private net/local SSE; parent reports all owned PIDs stopped. Corrected result SHA-256 742a7ee1558477d718e82ae91c36ad37b1c12249c218a7e0b841be86bd24602f, under native-claude-proof/integration/runs/final-45e7b22-1/. This is historical owner/native evidence, not current acceptance.
    • Remaining gates: parent's current-pair real-server/native Claude, Codex F1-F4/fork-owner and OpenCode mixed/barrier/retained-tail/replay receipt rebind; fresh Sol and Grok comments/statuses on every pushed head. CI Check and Fork Stack Model succeeded on exact 20975c00174e24d46c1822d1a4dee3ee7885eef7: all 27 exact-head check runs complete, 23 success/four skipped. GitHub reports MERGEABLE/CLEAN, with no independent review status present yet; the parent still owns final admission. All twelve live cells, supporting builds and natural-pressure Grok compaction remain open and parent-owned. No merge, restart, deployment, paid probe, production database/config change, browser/native UI service or new delegation. contextmd serving: reconcile Codex pointer claims after checkpoint restore #310, ContextMD Resume direct-spawn child threads after a usage limit #71/feat(server): direct child threads resume on their own after a usage limit #72/Stale-worker monitor misidentifies Prism jobs by title #73 and all other original exclusions remain outside scope.

    Actual real-serving fixture paths for the parent's existing native jobs remain unchanged; hashes and node --check were reverified:

    • /tmp/chromeria311-serving-harness.mjs: actual ContextmdRoute/ContextmdServing/ServingState, serving SQLite, real Cue HTTP client with local score stub, isolated projection/config fixtures and bearer-auth shim. SHA-256 32387419e5db11392195e8a621a036cd7bc7f718549227d1c72e936ab5eaf4e7.
    • /tmp/chromeria311-opencode-proof.mjs: normal native OpenCode mixed reply/save observer. SHA-256 edb4ea55f2d9cea2cd8117a511b3f80b5528cb44eadb2df3a9923bc254bb0ba5.
    • /tmp/chromeria311-opencode-cases.mjs: save faults, applying barriers, plugin recreation and overflow/replay observers. SHA-256 2ae6d912902b434e7812af9ce7fed6068dc41eefd1968f3f8ec6d6cebb7c59cd.

    The cases runner accepts explicit normal reverse save4xx missing lost-save late-save lost-applying-user lost-applying-retry restart-applying restart-miss overflow-replay arguments, the eleven historical completed scenarios. Its no-argument default additionally includes inconclusive overflow-tail; no pass is claimed for that case. Random native session ids can enter Cue's existing 10% holdout, so require an observed ordinary match in a non-holdout session before judging mixed ownership. Result JSON overwrites per invocation. The old plugin archive at /tmp/chromeria311-companion/contextmd/serve/opencode/contextmd.js is frozen 1c47c08, not the current companion identity; use the parent's exact committed 51acaa85 source for current proof. No fixture/double alone passes native acceptance.

    Requirements and who asked: User and accepted contextmd#34 require the bounded pointer, grammar, lifecycle/accounting, Grok fences and fork-only correction; supported Claude traces require causal compact evidence. User requires rebasing only owned commits, bounded renamed seams, preserved #313 behavior, an unchanged gate, no force push and replacement PR; parent owns integration/reviews/rollout.
    Deleted: Shared D/P receipts, run-only dedupe, timestamp jitter/blanket SessionStart exemptions, new native hook/adapter/caller plumbing, source-session restore reconciliation, unrelated loaders/matchers/shown work, recurring automation, merge/gate exception, version bump and misleading map assignment.
    Bottleneck: Parent's current-pair exact-candidate native receipts and fresh independent reviews; CI passes on the frozen head.
    Checked myself: Current package callers/MCP ownership, #313 shared diff and byte preservation, 584 focused tests, three scoped typechecks/lint, source hashes, unchanged fork algorithm, 35-owner equivalence, live refs, preserved prior branches, ten owned commits and the unchanged clean final 88-commit fork gate.

  2. lukemaj commented on Oct 14, 2026

    @lukemaj
    ContributorAuthor

    What: The server slice is merged by PR #327, squash commit 01d7066bb72e195af8c51a6e38aea3aada805d2d.
    Why: Both required independent reviews succeeded on exact head 20975c0 after findings comments, CI is green, and current-pair contract/native proof passed within its stated limits.
    So what: ContextMD #34 owns the supporting-build gate, hook activation and twelve live cells; it remains open, and this task does not restart Chromeria.

    Parent verified the merge state and all27pointer PR files against the reviewed head. Merged main also carries #329 intact, whose complete eight-file diff was inspected without pointer-path or dependency overlap. ContextMD companion #74 merged at09515a4d, exact reviewed tree, with annotated v1.2.0 pushed. Both exact-head review contexts and native evidence are linked from the canonical #34 handoff. No earlier-head verdict or controlled prototype is claimed as a live fleet pass.

    Requirements and who asked: User delegated merging the reviewed #34 outcome and requires hook rollout/runbook plus twelve live harness/machine cells.
    Deleted: Chrome version bump/restart, approval or check bypass, another design panel and premature #34 closure.
    Bottleneck: Supporting running Chromeria builds before pointer configuration, followed by live acceptance.
    Checked myself: Forge heads/status creators/comment ordering/checks/merges, complete merged identities and actual current native/SQLite proof; #311 closed and #34 remains open.

    Recorded by gpt-6.1-sol, max effort, Codex harness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions