Skip to content

Serving: deliver stored knowledge before the agent's next decision on every host #3

Open
6 of 13 issues completed

Description

@lukemaj

What: Serving delivers the stored knowledge a session needs before the agent's next decision, on all four agent hosts, within about one second and at most 10,000 characters per turn, and logs every moment so misses can be measured.
Why: Agents ignore or never see rules that already exist; hook context added before a tool call reaches the model only after the call runs, and raw search finds the needed knowledge in the top five for only 29% of real moments.
So what: Agents build the child Issues below, starting with the per-host canary; the user handles the serving-host hardware Issue.

Outcome

In daily use on every machine, each moment (session start, user message, tool result, tool failure, before an action, before saying done) is served from three independent lanes: exact keys, retrieval and the router. Must-know-before items deny the action once with the item as the reason. Every moment is logged with what was served, so "not served" can be told apart from "served but ignored", and a holdout of sessions shows whether serving reduces repeated corrections.

Problem Statement

Knowledge is captured or written as rules, but agents act without it. Session-start files are loaded once and lost after compaction. Before-action knowledge (62% of measured needs) has no reliable path: in all four harnesses only a pre-tool deny gets text read before the action runs. The router that recognizes judgment moments needs a GPU host that has reset repeatedly. Without a per-moment log, nobody can tell whether serving helps.

Solution

  1. Two delivery seams, one owner. Each model decision follows a user message or a tool result, so serving happens at those two seams, plus a deny-once at the pre-tool hook for flagged exact-key items and at before-done. Each machine's Chromeria server owns serving state; harness hooks are thin and only forward the moment and print what the server returns.
  2. Three lanes, none filtering another. Exact keys match structured tool input (command prefix, path glob, error signature). Retrieval matches word-matchable facts. The router scores every judgment entry whose scope matches, on the GPU serving host. Local lanes never wait for the router.
  3. Latency hidden. The pre-tool hook starts the router request; the post-tool hook collects it, so a tool slower than the router costs no wait.
  4. Ship now. The router serves live from the start with its "applies when" line first so a wrong fire is dismissed in one read; its quality bar drives retraining (Router: a local model that matches the judge on unseen entries within one second #4), not go-live.

Elon record

  • Requirements and who asked: serve before the next decision, about one second on average, at most 10,000 characters per turn (Objective); ship serving now, because agents ignoring rules is worse than imperfect serving (user); latency as low as measured (user); a per-moment log separating not served from ignored, usable for retraining (user); router only for judgment entries, no retrieval prefilter (user); windows may be sent between the user's machines but transcripts are not stored again (user); serving before "done" restored (user); count corrections grouped by underlying problem with a comparison group (user).
  • Deleted: pre-tool additionalContext as a before-action path (it arrives after the action); a pack ceiling and in-budget priority order; session-wide dedupe; shadow mode and a go-live quality gate; cross-machine restrictions; a request log with window text on the serving host; any Chromeria approval-path change (approvals cannot carry text and do not fire in the default mode); automatic escalation, demotion and retraining in v1.
  • Bottleneck: proven delivery before the next decision on each host and seam; then router quality through the retraining loop.
  • Checked myself: the private design notes (serving design v2, both roasts, three gap reviews, the synthesis and the user's decision record of 2026-10-12); the before-action delivery research with live probes in Codex, Claude Code, Grok Build and OpenCode (deny then retry in all four; deny-to-retry 4.9 to 11.0 s; Grok hooks fail open at 5 s); router latency of about 620 ms median per message with 9 entries on the serving GPU; Issues Capture: write lasting lessons from agent sessions into the owner that serves them #2 and Router: a local model that matches the judge on unseen entries within one second #4 and their comments.

Design review

  • Designer: Opus 5.5 (serving and router design v1, then v2 after the roasts and the user's corrections).
  • Roasters: Grok 4.7 and Sol 6.1. Accepted findings: two seams with tool-result serving, separate delivery outcomes, retrieval kept and measured alone, an executable per-turn budget owned by the server, separate remote statuses, compaction epochs, per-host failure hooks, a speed plan with drift gates.
  • Gap reviewers: Opus, Grok and Sol at extra-high effort, merged into one synthesis. Serving corrections: restore before-done serving; replace the open Codex question with a canary (Codex has a post-tool context field and its hooks fire in Chromeria sessions); add OpenCode; rescore with the tool result after failures; keep deny-once to flagged entries and give Grok a deadline under its 5 s fail-open; add not_on_machine and positives only from hard-way learning; restore the serving-host watcher and power cycle.
  • Verdict: foundation accepted by the user on 2026-10-12, with these decisions:
    • session-start files are outside the 10,000-character turn cap and keep their own budgets;
    • deny-once per entry version per session for must-know-before exact keys;
    • the router runs at every message and every tool call, latency hidden behind the tool run;
    • serving before "done" is in scope;
    • no privacy boundary between the user's machines; windows may be sent to the serving host; transcripts are not duplicated;
    • ship serving now;
    • the router starts with the 9 trained AgentsMD entries; classify adds only items whose trigger words are not in the item; router speed and false-fire rate are measured as the list grows;
    • before-action delivery uses a pre-tool deny (the only path read before the action); no Chromeria change;
    • serving-host availability: a permanent watcher, a smart plug for automatic power cycle, power-on after AC loss, then a power-supply swap confirmed by the hang log;
    • measuring: count every correction, group corrections that are the same underlying problem, track recurrence; hook denies are not corrections; 10% of sessions get no router injections as a comparison group;
    • one serve-outcome labeler (an Opus-class judge, checked against 10 user labels a week) labels served moments irrelevant, followed, ignored or wrong.

Acceptance criteria

  • A canary per host and seam shows which served strings the model reads before its next action.
  • Exact-key, retrieval and router lanes serve live on Claude Code, Codex, Grok Build and OpenCode inside Chromeria, within the per-turn budget.
  • Every moment is logged with lane, candidates, entry id and version, outcome and remote status, and no window text.
  • Missed servings from capture are joined to the log and labeled.
  • Served moments are labeled by outcome, and a twice-weekly report (Serving: twice-weekly repeated-correction report by serving arm against a baseline #17) compares grouped repeated corrections between served and holdout sessions against a pre-serving baseline.
  • A benchmark of real past moments is rerun on every change.

User stories

  1. As an agent about to run a command with a known rule, I want that rule before the command runs, so that I do not break it.
  2. As an agent reading a tool result, I want the relevant procedure beside it, so that my next decision uses it.
  3. As the user, I want to switch serving off and roll back a router adapter in one step, so that a bad change costs minutes.
  4. As the user, I want to see whether repeated corrections fall in served sessions compared with holdout sessions, so that I know serving works.

Implementation decisions

  • Seams per host: Claude Code UserPromptSubmit, PostToolUse, PostToolUseFailure; Codex in Chromeria turn-start context and post-tool context; Grok Build post-tool events only (prompt-hook output is discarded); OpenCode tool.execute.after append or a messages transform before the next model call. Pre-tool deny on all four. The canary confirms or replaces each.
  • Budget: one counter per user turn, reserved atomically before delivery and committed after the host accepts it; first fit wins; cuts are logged; each entry stays under the host's spill threshold. Session-start files are excluded.
  • Repeats: identical id and version deduped within a turn only; compaction starts a new context epoch and re-serves the session-start pack.
  • Router service: one GPU request at a time; a request past its caller deadline is dropped, not run; windows held in memory only; a machine-wide remote-unavailable state with a periodic probe; scoring started before the tool runs is rescored with the result after failures.
  • Log per moment: moment id, time, kind, context epoch, owner commits loaded, lane, candidates and scores, entry id and version, outcome (selected, injected, cut_budget, capacity_miss, no_seam, delivery_unverified, not_on_machine), remote status (not_called, ok, timeout, connect_failed, overload). No window text anywhere.
  • Missed-serving join: capture's re-confirmations and updates of items that existed before the moment, counted only when learned from a failure, a user correction or rediscovery. A remove is not a negative for earlier moments.

Design: serving state in Chromeria (2026-10-12)

This section is the accepted serving design. Where it differs from the bullets above, it wins: the budget key is the Chromeria run, not a counted user turn, and deny-once is replaced by the lift rule below.

Goal. Every host shows the agent the right stored rule before its next decision, and the log says honestly whether it did.

Boundary.

  • The Chromeria module (apps/server/src/contextmd/ in toolboxmd/chromeria) owns state, identity and settlement, and has no host-specific code. It owns the endpoint and run resolution, must-know deny state, the two turn pools, context epochs, Grok carry rows, router requests and router health (with Serving: router lane live with holdout, outage handling and rollback #13), and the serving log. All of it lives in its own SQLite file, <base>/userdata/contextmd.sqlite, with its own connection and a 100 ms busy timeout, so serving never waits on orchestration writers.
  • contextmd owns knowledge as data: entries and stores (ids over 120 characters rejected), the store check, the thin hooks and the OpenCode plugin, and the installer. Updated (user, 2026-10-12): matching (key extraction, in-order word matching, read detection, harness profiles) runs inside the Chromeria module in TypeScript, a port of PR feat: exact-key serving with deny-once, budget and log on Claude Code (#11) #23's matcher; the module reads the stores named in ContextMD's serving.json on every moment, so knowledge edits need no release.
  • Worker protocol: superseded by the in-process matcher; no worker process.
  • The router service on the GPU serving host owns the window format. The module sends bounded raw items from the Chromeria transcript projection plus candidate ids and versions; windows exist only in memory there.

Identity. The turn is the Chromeria run. The module resolves the run attempt with status = 'running' whose nativeThreadId equals the hook's session id (a partial expression index makes this fast). A steering restart, retry or provider recovery is a new attempt on the same run, so the budget is unchanged. No running attempt logs unjoined and serves nothing; two running runs log ambiguous and serve nothing. A startup self-check of the columns and JSON field it depends on disables the module (every request gets 204, logged unmapped) instead of failing Chromeria.

Hook contract.

  • POST /contextmd/v1/moment with a bearer token, X-Contextmd-Host and X-Contextmd-Delivery (a random id per hook call); the body is the raw event, capped at 1 MB (oversize). A repeated delivery id gets the same reply and is not charged twice.
  • The reply is 200 with host bytes from the profile's template, or 204.
  • After the hook has written the reply (curl exits 0 only when all of stdout was written), it calls POST /contextmd/v1/settle/<delivery>. The OpenCode plugin settles after it throws or appends.
  • Stages are reserved, then settled. An unsettled reservation is released after 2 seconds as delivery_unverified. A serve is injected only when the hook settled it, the seam delivers before the next action in the host profile, and the bytes fit the host's whole-delivery limit. Nothing is marked delivered unless the model was shown it whole.
  • Transactions are short and never span a network await. Each claim belongs to its reservation, so a release never touches another reservation's state. Dedupe and deny lifts count only settled claims.
  • Discovery and auth (updated, user 2026-10-12): hooks authenticate as an ordinary Chromeria session (t3 auth session issue, scope orchestration:read) stored in <base>/userdata/contextmd/hook-credential (mode 0600), and find the server through Chromeria's <base>/userdata/server-runtime.json; a dev server with its own base directory rejects another environment's credential. The off switch is <base>/userdata/contextmd/off; the hook checks it before calling, so it works with the server down.
  • Deadlines: connect 0.1 s, total 1.0 s; settle 0.3 s. Grok fails open at 5 s.
  • Server down: nothing is served, must-know denies included, and the agent sees no error. A heartbeat row every 30 seconds marks the outage window so capture can exclude it.

Budget. Each run has an 8,000-byte serve pool and a 2,000-byte deny pool, counted in UTF-8 bytes; serves never consume the deny pool; session-start files sit outside both. A deny carries every whole matching rule that fits and always at least the first, cut only if that rule alone exceeds the per-output limit (logged truncated, which is not a read). The other rules stay deferred and deny the next matching call. Serves are first fit within the serve pool and the host's per-output limit; cuts log cut_budget with turn or moment.

When a must-know deny lifts (user decision, 2026-10-12; replaces deny-once). A must-know entry is a pointer rule (front matter target: names a file; the deny asks the agent to read it and run the call again) or an inline rule (the text is in the deny).

  • Pointer rule: every matching call is denied until a successful read of the target is observed in the same session and context epoch. A read is a Read-like tool's path argument, or a path token in a shell command that runs a reader (cat, sed, head, tail, less, more, bat, nl, awk, rg, grep, view), resolved against cwd and any cd. It is recorded at the tool result, only if the call did not fail, with its kind (read_tool, shell_full, shell_partial).
  • Inline rule: a settled, whole delivery counts as read (delivered_inline). A truncated or unsettled deny is not a read.
  • Safety cap: at most 3 denies per entry version per epoch; the third lets the call pass and logs not_read_capped. The lift outcome is logged as read (with denies and calls taken), delivered_inline or not_read_capped.
  • Parallel calls in one wave are all denied until a read exists. Compaction starts a new context epoch and re-arms the deny.
  • Evidence: 171 denies of the read-before-action gate in daily use, joined to the observed tool calls after each. The file was read in 94% of cases, almost always as the very next call; only 42% were followed by an identical retry, so a retry is not a usable lift signal.
  • Obedience is measured separately: live by the serve-outcome labeler (Serving: label served moments as irrelevant, followed, ignored or wrong #15), and before go-live by a disposable test comparing inline and pointer rules on each host.

Compaction. Claude Code sends SessionStart with source compact or clear, which starts a new epoch and re-serves the session-start pack. For other hosts the module starts a new epoch when the thread projection shows a new compaction item; a host that emits neither signal is marked so in its profile and the pack is not re-served.

Grok carry. Grok discards the output of prompt and post-tool hooks. A serve selected there becomes a carry row and is printed at the next PreToolUse in the same run; only that print can be injected. A carry charges no pool until printed, expires with the run (carry_expired) and is replaced by a newer entry version (superseded).

Router (#13). The module starts a request at pre_tool, collects it within 300 ms at tool_result (rescoring with the result after a failure), and waits up to 650 ms at user_message and before_done (not on Grok, where it becomes a carry). The first connect_failed or timeout sets a machine-wide unavailable flag cleared by a 30-second probe. Holdout is hash(host, session) % 10; holdout sessions log would-fires and never print them.

Log. One row per moment (host, kind, session, thread, run, tool-use id, epoch, holdout, store commits, worker generation, contextmd commit, router adapter version, server timing) and one row per candidate (matcher, entry, version, key, seam, stage, outcome, suppression reason, score). No prompt, command, result or window text.

Sessions outside Chromeria (for example terminal body sessions) are not served for now; they log unjoined.

Installation. contextmd-serve install <host> --base ~/.t3 writes the host's user-level hook configuration (and the Codex home Chromeria uses) to call the endpoint named by that base directory.

Upstream footprint. Two lines in server.ts (already a carried file) and one partial index on the run-attempts table, created at runtime. The module depends on run_id, thread_id, status and payload_json.nativeThreadId of the attempts table and on the compaction projection item, all covered by the startup self-check and a test.

Required failures (each must fail the build): two user turns give two runs and two pools; a steering restart keeps one pool; a hook killed after the reply and before settle leaves the deny unspent and the retry denied; a parallel wave of matching calls is denied on every call; killing the worker mid-moment marks nothing injected and a late reply is dropped; deny composition (whole rules only, at least the first, the others deferred); a near-full pool and non-ASCII text; a second SQLite writer holding the lock; a dev and a production server side by side; the startup self-check disabling the module; holdout suppression; the router host unavailable; a pointer deny lifts only after a successful read of its target; a failed read does not lift it; a read in another session or an earlier epoch does not lift it; the cap gives not_read_capped on the third deny; an inline deny lifts on a settled whole delivery but not a truncated or unsettled one. Also measured: worker queue delay at p95 under a 48-call wave against a real store, compared with spawning per moment.

Live canary matrix inside Chromeria (the oracle is the model quoting the token before its next action):

Host Must show
Claude Code pointer deny lifted by a read, then retry; post-tool serve; compaction re-serving the pack
Codex deny; post-tool serve; failure through PostToolUse
Grok Build a carry quoted at PreToolUse; a slow server still under 5 s
OpenCode deny; append; before_done logged no_seam

On every host also: the session id joins to a run, and one live server-down session.

Design review: serving state in Chromeria

  • Designer: Opus 5.5 (v1, then v2 after the roasts and user decisions).
  • Evidence before design: a disposable probe on a dev Chromeria instance (comment above): a thin hook to a Chromeria endpoint at 14.7 ms median against 40.4 ms for the file-based hook, all six Claude Code seams quoted before the next action, every moment joined to a thread and run, atomic deny state under 48 concurrent hooks, fail-open in 14 ms with the server down.
  • Roasters: Grok 4.7 and Sol 6.1. Accepted: resolve the running attempt, with unjoined and ambiguous; a settle call with reservation-owned claims and a 2-second release; framed worker messages with id and generation; compaction epochs from SessionStart and the projection's compaction item; host knowledge as contextmd data and persisted Grok carry rows; a required-failure list and a per-host seam matrix; an endpoint file per base directory; a router unavailable flag and hashed holdout; router request keys with generation; the module's own database file; a fuller log; a startup self-check. Deleted: the outside-session turn key, null-thread serving, an Origin check, a second served table, a failure spool and host renderers in the fork. Rejected: replacing the two byte pools (accepted in PR feat: exact-key serving with deny-once, budget and log on Claude Code (#11) #23's review); hook version negotiation (the per-host canary reruns on every harness upgrade instead); a privacy boundary between the user's own processes.
  • User decisions (2026-10-12): serving state lives in Chromeria; no serving outside Chromeria for now (logged unjoined); a pointer deny lifts on an observed read of its target, capped at 3, then passes and logs not_read_capped; an inline rule counts as read when delivered whole; parallel calls are denied until read; compaction re-arms denies; installation through contextmd-serve install <host> --base ~/.t3; PR feat: exact-key serving with deny-once, budget and log on Claude Code (#11) #23's merged matcher library and tests stay in contextmd while its state moves into the Chromeria module; the 8,000 and 2,000-byte pools and the other PR feat: exact-key serving with deny-once, budget and log on Claude Code (#11) #23 rules stand.
  • Decisions during the build (user, 2026-10-12): matcher inside Chromeria in TypeScript; separate contextmd.sqlite; hook auth through Chromeria's sessions; fail open when the server is down (every agent session runs inside Chromeria, so nothing more is needed); deny cap 3; the three obedience-test fixes (deny shown only with evidence, error keys on output and printed exits, served text names the user's store and OpenCode delivery through the user message); compaction from harness hook events; retire the separate pointer-trial hook once serving is live.
  • Verdict: accepted. Child Issues: contextmd serving module: serving state, settlement and deny lifts in the Chromeria server chromeria#217 (the Chromeria serving module) and Serving: selection worker, host profiles and install; state moves to Chromeria #24 (the worker, host profiles and install command).

Testing decisions

  • Canary per host and seam: does the model quote a served string before its next action.
  • Each lane scored alone, then combined, on the real past moments, random no-need turns, held-out entries, stale versions and procedure units; a score cache keyed by adapter, instruction, token layout, window and entry content.
  • Live: missed-serving rate per eligible moment, serve-outcome labels, and grouped repeated corrections by arm from Agent Observer.

Non-goals

Blockers

  • None for the canary. The serving host's availability is tracked as host work below and does not block lanes that run locally.

Required proof

  • Each child Issue's proof; the canary table; logged live serving on all four hosts; the first twice-weekly report against the baseline.

Further notes

Full designs, roasts, gap reviews and the before-action research are kept as private design notes. Capture Spec: #2. Router training track: #4 stays a separate Issue because serving go-live does not wait for its quality bar.

Sub-issues

Sub-issues

6 of 13 Issues completed
Loading 13 sub-issues

Activity

  1. lukemaj commented on Oct 12, 2026

    @lukemaj
    ContributorAuthor

    Design input from the user (2026-10-12):

    1. Missed-serving signal, a closed feedback loop. When reflection (capture step 3) updates or re-confirms a fact that already exists in a store, the knowledge was already known but the session had to relearn it. That is a clear signal that the item should have been served at that moment and was not. Each such event is a labeled serving miss: the moment, the item, and the store it lived in. It can drive serving fixes and become positive training data for the router. To tell "not served" from "served but ignored", the serving log has to record what was served per moment.
    2. Scale of the router step. Most entries are expected to be served by standard retrieval or exact keys; only entries that need judgment (procedures and other non-word-to-word matches) go through the router. That candidate pack is much smaller than the whole store. With a diverse enough dataset, smaller router models may become reliable and take over more fast-served entries over time.
  2. changed the title [-]Decide the serving architecture: moments, unit, retrieval, router role[/-] [+]Serving: deliver stored knowledge before the agent's next decision on every host[/+] on Oct 12, 2026
  3. lukemaj commented on Oct 12, 2026

    @lukemaj
    ContributorAuthor

    What: A probe put serving state in Chromeria. A thin hook forwards each moment to a local Chromeria endpoint, and it beat the file-based hook on every measure.
    Why: The Chromeria debate (Opus for, Grok against, Sol split) needed evidence on latency, delivery, join, fail-open, atomic state and fork cost before choosing where serving state lives.
    So what: The recommendation is to keep serving state in Chromeria as one fork module. The user decides; nothing was merged or opened as a PR.

    The probe ran on a dev Chromeria server with its own home and port (the live app was not touched). It is a local throwaway branch probe/contextmd-moment: POST /contextmd/moment logs one row joined to the thread and run, holds deny-once, and returns a fixed canary. Claude Code 2.1.292, claude-haiku-4-5.

    Check Result
    Hook round trip, n=200 thin curl hook to Chromeria 14.7 ms median, 15.3 ms p95; file-based PR #23 hook 40.4 ms median, 42.0 ms p95 (same machine, same run). Server-side handling 0.2 to 0.7 ms.
    Quoted before next action (live, inside the dev instance) all six: session start, user message, tool result, tool failure, pre-tool deny (retry passed), before done (second stop passed); 1.6 to 4.0 s hook-to-quote
    Join 11 of 11 rows carry the Chromeria thread and run id, SessionStart included; the hook session_id equals nativeThreadId on the run attempt; all rows of one turn share one run id, a ready per-turn budget key
    Server stopped refused: 13.5 ms median, exit 0, nothing served; hung server: bounded at 0.52 s; live session with server down: "no canary", no hook error, finished. Must-know-before denies are lost while the server is down (affects sessions outside Chromeria only)
    Atomic deny-once and budget 16 concurrent hooks across 4 sessions and 48 across 3 gave exactly 1 deny per session. One server process, one SQLite connection with withTransaction: deny-once and the turn budget are single conditional statements (INSERT ... ON CONFLICT DO NOTHING RETURNING, UPDATE ... WHERE used + n <= budget RETURNING)
    Fork footprint 1 fork-owned file (128 lines) and 2 lines in server.ts, which the fork already carries; production adds a schema hook in the already-carried Sqlite.ts. No adapter, orchestration or contract change

    Not covered: Codex, Grok Build and OpenCode through the endpoint; compaction; real lanes and budget; endpoint auth (the probe is loopback-only); the run lookup needs an index (2 ms worst case at live table size); keeping knowledge logic as reloadable contextmd data (Grok's release-coupling point).

    Elon record

    • Requirements and who asked: test the planner's recommendation that serving state lives in Chromeria (user); round trip at or under the file hook, quote before next action, Chromeria-id join, fail-open, atomic deny-once and budget, small fork footprint (user's probe brief).
    • Deleted: lanes, router, compaction and other hosts from this probe; any change to the live app or its database.
    • Bottleneck: proven delivery through a Chromeria-owned endpoint, then the decision on where state lives.
    • Checked myself: ran both hooks 200 times; read the live transcript order; read the dev database rows; ran concurrent denies; stopped the server and ran a live session; read Sqlite.ts, fork-upstream-edits.txt and upstream history of server.ts.
  4. lukemaj commented on Oct 12, 2026

    @lukemaj
    ContributorAuthor

    What: Agents obey a rule served in a pre-action deny on all four hosts: 45/48 served runs complied versus 0/24 unserved. Inline text and a file pointer tie (22/24 versus 23/24).
    Why: Serving design needed evidence that a served rule changes the agent's next action, per host, and whether to serve text or a pointer.
    So what: Serve inline when the rule fits the deny and use a pointer for long procedures. Three serving defects below need fixes in #11's successor work (deny collision, error keys, provenance wording); no decision is needed from the user.

    Disposable experiment, 108 matrix runs plus 2 collision repros, headless, subscription quotas only. Scratch repos with a logging gh stub and a local push remote; no real pushes or PRs. Claude Code ran the merged hook (2edd2e8); Codex, Grok Build and OpenCode ran a shim emitting the same deny text on the seams the canary (#21) proved. Models: Opus 5.5 medium, gpt-5.6-sol medium, grok-4.7, Muse Spark 1.3.

    Scenarios: (a) open a PR (rule: check first, --draft, widget: title, Risk: line); (b) commit (rule: check first, Refs: WID-42 trailer); (c) a test failure with a known fix (rule: run the refresh script). Pointer files lived outside the repo. Compliance was judged from the stub gh log, git log and script logs.

    Host PR: base / inline / pointer Commit: base / inline / pointer After failure: base / inline / pointer
    Claude Code 0/3, 3/3, 3/3 0/3, 3/3, 3/3 3/3, 3/3 (not served), 3/3 (not served)
    Codex 0/3, 3/3, 3/3 0/3, 2/3, 3/3 3/3, 3/3, 3/3
    Grok Build 0/3, 3/3, 3/3 0/3, 3/3, 3/3 3/3, 3/3, 3/3
    OpenCode 0/3, 3/3, 3/3 0/3, 2/3, 2/3 3/3, 3/3, 3/3
    • Pointer runs read the pointed file 24/24 times. Median extra time over baseline: inline +9.5 s, pointer +14 s per cell. Retries after the deny were almost always exactly one.
    • Scenario (c) did not discriminate: every run, baseline included, found the repair script.

    Findings:

    1. Two denies on one call lose one rule (Claude Code). With the AgentsMD pointer-trial hook also denying the first git commit, Claude Code showed the model one reason only (AgentsMD in one repro, contextmd in the other). contextmd still logged injected and spent deny-once, so the rule never arrived and the commit broke it. The matrix ran with pointer-trial failing open per run.
    2. Error keys miss masked failures (merged hook). In 9/9 Claude Code after-failure runs the agent ran ./scripts/test.sh; echo "exit=$?", so no PostToolUseFailure fired and the rule was never served. Matching error text in successful tool output too would fix it; the shim did that and served 9/9 on each other host.
    3. The model doubted the rule (OpenCode, 2 of 6 commit runs). Muse treated the deny as "an instruction from tool output", searched the repo for WID-42, found nothing and dropped the trailer. Served text should say it comes from the user's own store.
    4. One Codex session ran no hooks at all (1 of 27 Codex runs; cause unknown).
    5. OpenCode blocks pointer reads outside the project in headless runs (the run ended); the matrix allowed the knowledge directory per workspace.

    Agent Observer 0.15.0 (synced after the runs): no harness recorded a contextmd deny as a human rejection (0 of 49). Claude Code recorded all 14 as hook or rule policy denials (correct). Codex (11), Grok Build (12) and OpenCode (12) recorded none as denials: Codex and Grok keep no denial event, and OpenCode records the denied call as a tool error.

    Not covered: Chromeria threads, the merged hook on non-Claude hosts, long procedures, more than one model per host.

    Elon record

    • Requirements and who asked: do agents obey a rule served before an action, per host, and does inline or pointer work better; three scenarios, three arms, about three runs per cell; Observer deny classification (user, via the planner's brief).
    • Deleted: Chromeria threads, a fourth arm, rules longer than the deny limit, real pushes and PRs.
    • Bottleneck: delivery, not obedience: every miss traced to a lost or distrusted rule.
    • Checked myself: scored each run from the stub gh log, git log, script logs and native host records; read the traces of every non-compliant served run; reproduced the deny collision twice; queried Observer per run.
  5. lukemaj commented on Oct 12, 2026

    @lukemaj
    ContributorAuthor

    What: A plan to retire the separate pointer-trial hook once ContextMD serving is live, and what it would lose.
    Why: Both hooks deny before actions; two denies on one call hide one rule (obedience finding 1), and ContextMD serving now owns this job.
    So what: The planner approves the plan or the gap handling below; nothing is removed until then.

    Where pointer-trial lives today (rocky, read-only check)

    ~/.local/bin/pointer-trial-hook, registered in ~/.claude/settings.json, ~/.codex/hooks.json, ~/.grok/hooks/pointer-trial.json and ~/.config/opencode/plugins/pointer-trial.js. It points at AgentsMD procedure files for 19 routes, blocks the first match per route and compaction epoch, and passes once the procedure was read.

    Route coverage by ContextMD exact keys

    Routes pointer-trial trigger ContextMD entry Covered
    version_control git commit command: git commit, pointer rule yes
    verification, delivery, finalization, elon_method, specify gh pr create/edit/ready/merge, gh issue close/create one entry per route with those command keys yes
    implementation (worktree) git worktree add command: git worktree add yes
    repository_setup gh repo create/edit command keys partly: its gh api mutation regexes are not word keys
    code_review gh api .../statuses with review/independent command: gh api would over-fire no (needs a narrower key)
    writing_for_agents, technical_writing, domain_modeling, preferences_pruning, project_direction_change, delivery_profile edits of SKILL.md, AGENTS.md, CLAUDE.md, README.md, CHANGELOG.md, docs/**, GLOSSARY.md, adr/*.md, PREFERENCES.md, the triad, .toolboxmd/delivery.json path: globs yes, minus pointer-trial's exclusions (plugin caches, temp dirs)
    implementation (first project edit), test_design (first edit per test file) per-session state none no: exact keys have no "first in session" state
    orchestration delegation tool names none no: no tool-name key
    research web tools, once per 30 calls none no
    project_direction_change_prompt user-prompt words none no: that is a Cue (judgment) moment

    One behavioural difference: pointer-trial repeats the pointer as context on later matches; ContextMD lifts a pointer rule for the rest of the context epoch once the file is read.

    Proposed steps

    1. Write the covered routes as pointer-rule entries in a ContextMD store owned by AgentsMD (targets: the operations procedure files), list it in ~/.config/contextmd/serving.json, and run them live beside pointer-trial for a day with ContextMD's deny evidence on; compare which calls each denied (pointer-trial's log against the serving log).
    2. Decide the uncovered routes: (a) add a small tool: key to the store format for orchestration and research; (b) leave the first-edit and prompt routes to the Cue lane (Serving: router lane live with holdout, outage handling and rollback #13); or (c) keep a reduced pointer-trial for only those routes until then. Recommendation: (c) for now, since it removes every collision on the covered routes at once and loses nothing.
    3. Remove pointer-trial's registrations for the covered routes (four config files, each backed up), record the change and rollback in the runbook, and keep the script until step 2 is done.
  6. lukemaj commented on Oct 13, 2026

    @lukemaj
    ContributorAuthor

    What: pointer-trial retirement step 1 is done on rocky: the six command routes (git commit, gh pr create/edit/ready/merge, gh issue create/close) are now ContextMD pointer entries, and pointer-trial skips them (2026-10-13T00:20:24Z).
    Why: two deny hooks on one call hide one rule; ContextMD serving is live and tested on rocky.
    So what: pointer-trial keeps every other route. cavallo and bestia follow once they run the module. Changes and rollback are in the runbook, rocky/CHANGES.md (commit d41e7ba).

    Correction to the plan's coverage table: the path routes are not covered. ContextMD path keys match any tool with a path field, including Read, so a path entry would deny reading AGENTS.md; they also miss shell and apply_patch edits. Those routes stay on pointer-trial until path keys can be limited to edits.

    Live check (Claude Code): the specify deny was shown, a read of the target lifted it, the retry passed, and pointer-trial logged nothing.

  7. lukemaj commented on Oct 14, 2026

    @lukemaj
    ContributorAuthor

    What: During chromeria#264, pointer gates denied PR creation/commit after their complete procedure text had been returned by successful compound shell reads; one-file cat calls lifted the gates.
    Why: The serving seam did not recognize those earlier reads as sufficient evidence; whether command extraction, full-read verification or epoch state caused this remains unisolated.
    So what: Serving's canary should cover compound/multi-file reads and document or correct the supported proof shape; #264 continues with separate exact-target reads.

    Observed on bestia, 2026-10-14 around 14:25Z, Codex GPT-6.1-Sol through T3 Code. The complete delivery procedure appeared at the end of a successful multiline command that first inspected native proof milestones and docs/fork-features.md. Elon and verification were read through successful cat <several absolute module paths> calls. Later gh pr create was blocked by pointer denies for delivery, Elon and verification. Separate successful cat <one exact absolute path> exec calls for all three lifted the next identical PR create. The same pattern recurred for version-control before git commit; its separate full cat lifted the gate. No intervening runtime restart was observed in this interval. This is an observation, not a confirmed matcher cause or a request to weaken full-read proof.

    A separate command-shape observation: an explicit sqlite3 -readonly <live-path> pinned backup in a multiline command preceded by date, disk and journal reads was denied by the existing database-read-only inline rule. Moving that exact read-only backup to a separate exec command beginning with sqlite3 passed. Only private copies were queried, and the live database was never opened writable. This may share command-shape handling, but that causal link is unknown.

    Expected distinction: a successful untruncated complete target read and an explicit read-only backup should be recognized; partial/truncated/failed reads and any live write must remain refused. Raw traces and private data are kept local. No serving implementation, rule-store edit or host configuration change is made by #264.

    Requirements and who asked: Global Work requires recording a found outside-scope problem with its owner; this serves #3's before-decision delivery and observable pointer lift contract.
    Deleted: An unverified root-cause claim, gate bypass, scope expansion, preference workaround and private trace publication.
    Bottleneck: Distinguish shell-shape extraction/full-read proof from serving epoch state in the existing canary.
    Checked myself: Saw successful complete read output and both later deny responses, then saw exact single-target reads lift the identical PR/commit calls; inspected the explicit read-only backup rejection and successful separated copy.

  8. lukemaj commented on Oct 18, 2026

    @lukemaj
    ContributorAuthor

    What: A live Codex/code-mode session repeatedly receives the same required-file denial after successfully reading the exact target in full.
    Why: The denial is not lifting on the observed successful shell read; whether this is receipt parsing, session/run identity or serving state is not yet established.
    So what: The serving owner should trace the pointer read receipt and suppression for this reproduction. I preserved the rule, did not disable the hook, and delegated the affected two-file private runbook delivery through native tools while continuing #423.

    Observed on bestia while coordinating toolboxmd/chromeria#423, 2026-10-19 Europe/Warsaw. Codex through code-mode functions.exec with nested tools.exec_command. Private repo checkout /home/luke/dev/runbook; no secret values were printed or included here.

    1. A read-only shell command listing tracked bestia files, fetching main and searching Markdown for a broker's name was denied with Read /home/luke/dev/promachos/skills/treg/SKILL.md in full, then run the same call again.
    2. Successfully read that exact file with cat, first from the project cwd and then explicitly with workdir runbook and an 8000-token output budget. The full367-line file fit and was inspected; repeated identical repository search was still denied. A narrower documentation search that did not mention the external broker completed; no external broker call was being attempted.
    3. A normal commit of the parent's two prepared runbook files was separately denied with required /home/luke/dev/toolboxmd/agentsmd/skills/operations/procedures/version-control/index.md reading. Successfully read the exact file in full with workdir runbook, then retried a normal supported WIP commit; it was denied again. No commit ran or was disguised, no hook was disabled, and the prepared edits remain preserved for a native-tool reviewer/delivery child.

    The parent knows and follows both instructions. This is an observed gate-lift/receipt problem, not a request to weaken either rule or assume the internal cause. #3's read-before-action contract says successful target reads should lift a pointer deny; the observed repeated denials are the discriminating failure. Native-tool child outcome will be added when available.

    Objective contribution: stop repeating already-read instructions while preserving before-action knowledge delivery and observable receipts. Broader current-main serving fixes and runtime rollout may affect this; this report does not request installation, deployment or restart under #423's authority.

  9. lukemaj commented on Oct 19, 2026

    @lukemaj
    ContributorAuthor

    Interim step, 2026-10-19: ~/dev/promachos/library is now registered under cue in ~/.config/contextmd/serving.json on cavallo, rocky and bestia, so Great Library items with name/applies headers (email-discovery, treg-discovery) are judged by Cue, not only exact keys. contextmd-serve check loads both with no errors; a cavallo session received the Email item live. This is a stopgap until the serving rework here lands; the rework should replace it, not build on it. Runbook: lukemaj/runbook */CHANGES.md.

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