# Agent note background

Human explanation. Agent instructions: the area notes in this directory.

Issue #1381 records the package-only release guard blocking a project with no package manifest or documentation checker. The release policy was bound to the candidate commit because choosing a different source or exempting docs relaxes that guard; the shared committed file makes that choice reviewable in the same Git candidate. The runtime/local configuration is a different authority and does not define this consent.

On 2026-11-10, #1352 R1 separated newly authored stage evidence, fallback and
whole-wire sizing from the remaining legacy route modules. The models note
points at the stage contract and its single switch planner; generic decision
evidence v1, the remaining route decisions and notice cleanup had separate
ownership boundaries. R2 supplied the hub-owned decisions and prompts; R3 retires
the derived modules, their upstream checker and Apache notice while preserving
the unrelated Tabler Icons notice and the reserved port offset.

R2 keeps optional model selection separate from host decisions: ADEc may suggest
an alias/effort for an existing plan phase or judge call, while the hub retains
phase transitions, review/escalation rules and fallback execution. The off and
shadow modes preserve that boundary; sample policy text cannot grant authority
or substantiate a live model-quality claim.

In the #1055 review, the new title-binding lookup preceded invocation,
pending-delivery and supervision bookkeeping in `Bus.onDelivered`. The bus's
outer observer catch protected settlement but could not finish bookkeeping
after a journal lookup threw. This is the background for isolating that
fallible observer work in the bus area note.

Two #1055 refusal tests exposed Bun 1.4.2 replacing a received `error` string
with the `StringContaining` object supplied to `toMatchObject`. A minimal
same-version reproduction showed `typeof error` changing from `string` to
`object`. Preserving the original value keeps later error-text and canary
checks meaningful; changing production messages would not address this cause.

On 2026-10-13, two PR #368 reviews found that a missing delivery id or a missing visible row could select another Queue row. The console navigation rule in daemon.md records the exact-row contract. The missing-row and ID-less secondary-delivery regression tests demonstrate both cases.

Background behind some of the rules, moved from the top-level README on 2026-10-16:

- Benchmark trust entry: the review rounds of #115 kept finding paths that broke
  the runner's settlement of the Claude trust entry.
- Reply addressing: leaving `to` empty fanned a reply out to every peer, which is
  what made one directed question cost every agent a turn.
- Bun test hang: the stacks of two local hangs show a test timeout starting the next
  test inside `Bun.spawnSync`'s own event loop (#115,
  `docs/verification/2026-10-03-0.12.6.md`); minimal reproductions did not hang, so
  the full trigger is not pinned down. On Bun 1.4.2 the next test still starts there
  (#121, checked directly); the spin was not reproduced on demand on either version.

The #451 predicate and identity-lookup moves exposed unbound names in a VM fixture
that extracts daemon closures. Reconnecting imported helpers and deterministic
identity ports preserved the fixture's existing assertions; changing the asserted
behavior would have hidden the missing dependency.

Background moved out of the area notes for 0.12.45:

- Instance execution git budget (#225, daemon.md): `resolveInstanceExecutionCwd` runs synchronously on the daemon's event loop (an extra-instance start, `turn_revert`) with up to four git calls, measured at about 15 ms on a warm local repository. One shared 5 s allowance holds the loop at most 5 s, not 4 x 5 s. It stays synchronous because the CLI and recovery callers are; an async twin for the two daemon call sites is the upgrade if a typical resolution ever costs more than a few ms.
- Claude steer version gate (#493, #221, daemon.md): mid-turn consumption of a steered important message was proven only on Claude Code 2.1.302 (`docs/verification/2026-10-18-493-claude-busy-channel.md`); on an older client a dropped mid-turn notification stays `accepted` until a person resolves it. The hello does not carry the Claude Code version (its `clientVersion`, #1385, is the agent-hub version and display only), and the oldest working version is unknown, so a gate would be a guess that could disable a working path.
- Planner reservation and done gates (tasks.md): in #378 a same-value planner write laundered a person's reservation; in #382 advise recorded overlapping dones, and an owner could neither relink a PR nor be stopped from carrying a head to a new PR.
- Process-tree stops (adapters.md): three review rounds of #113 found snapshot gaps while the tree ran (groups of its own, an unreadable first read, a child started during the grace period).
- Local worker (local-worker.md): a bare `private/` deny entry once denied all of `/private/var`; `existsSync` made a dangling link look like a new file, so a write landed at its target.
- Suite watchdog (tests.md): macOS CI hit `AHUB_CHECK_HANG_S` while tests still passed (#378, #593).

Background moved out of the area notes for 0.13.0:

- Jcode MCP entry (#685, adapters.md): jcode gives an MCP entry's own env precedence over the process env (probed on 0.99.0), so a peer id in the shared `.jcode/mcp.json` entry would make every extra instance act as `jcode`.
- Bulk queue discard (#713, bus.md): a queued row with no journal record of its own carries the journal's global revision, which every discard moves, so a revision read once at the start goes stale after the first discard.
- Usage roll-up (#683 U2, budget.md): a pass cap smaller than one log line once hung the fold.

Background moved out of the area notes for 0.15.0:

- I-2 as the last reviewer check (#744, tasks.md): placed earlier, it refused an offline former implementer as "implemented this task" instead of "offline", which turned a task that used to approve directly into a blocked person review.

Background moved out of the area notes for 0.16.0:

- Closing-refs negation list (#760, tests.md): agent-mem PR #36 said "Does not close #15", GitHub read `close #15` as a closing keyword, and the design issue closed with T3 open. The list errs toward flagging: a false positive costs a rewrite of the PR text, a false negative closes a design issue, and a body that really means a qualified close is the author's to reword. A keyword typed into a comment or the merge dialog is out of the check's reach. At 0.16.0 `closing-refs` is not a required status check (branch rules require `check (ubuntu-latest)`, `check (macos-latest)` and `seeded guards`).

Background behind the 0.18.0 rules:

- CLI print guards (#814, tests.md): a command that printed JSON by default made scripts the only reader; each converted command keeps `--json` byte-identical to the old output, and the guard scans for both a bare `JSON.stringify` print and a bare print of a hub tool's text so a new unlisted command cannot slip back.
- Agent shell authority (#812, adapters.md): reading public state is allowed for every agent, the conductor gets a closed operational family, and every other form stays the person's. An allowed read form is added only when the daemon admits it for an ordinary tools connection too.

Background behind the 0.19.0 rules:

- Code-scope verdicts (#852, tasks.md): two review rounds showed that any classifier reading a `code` reviewer's unmet text files real defects, such as "the CI workflow is missing the trigger", as verification-only, so the evidence-only rule reads only the structured findings.
- VM closure dependencies (#1056, tests.md): review refresh and durable observer checks added cache, snapshot and scope dependencies to existing functions. Searches for the new dependency names missed fixtures that extracted their callers, causing ReferenceError failures or fail-closed paths that pre-empted the behavior under test.
- Policy-table fixtures (#843, tests.md): a fixture with a fixed list of keys or versions, which a planned `COMPAT` entry was not in, was reported twice in #843.
- Suite watchdog (#516, tests.md): a total-time kill cut suites that were still passing tests line by line (hosted ubuntu runs at 1080 s, the macOS leg of PR #857 at 1440 s), so a lost-progress bound became the hang detector and the total bound only its backstop.

Background moved out of the area notes for 0.21.0:

- Cold shim exec (#519, tests.md): the first exec of a newly written executable cost about 250 ms on macOS against 6 to 8 ms afterwards, the whole of a 250 ms product bound; `test/memory-code-head-684.test.ts` failed 24 of 30 isolated runs until it warmed the shim. The real probe with a plain `git` measured 10 ms at worst over 600 calls under CPU load.
- Held snapshot clock (#550, #554, tests.md): `test/settings-reload-daemon.test.ts` without `snapshotClock` failed 138 of 150 single-test runs at 50 parallel, 0 of 150 with it. Before #554 a held clock still left each git child 250 ms, so a loaded runner turned a slow git into unknown evidence (3 of 100 at 100 parallel in `owner-write-evidence-daemon`); the fix landed in `src/hub/snapshots.ts`, outside the planned paths, with the planner's approval.
- macOS shards (#548, tests.md): counting the shard names in `gateJob()` was planner-approved outside the card's paths. In the first hosted run of PR #954 a cold `/usr/bin/git` took over a second, and 8 tests that run it with `PATH=/usr/bin:/bin` and a 1000 ms timeout were killed at about 1000 ms, against about 140 ms in an unsharded leg that had run git earlier. Without the `AHUB_CHECK_SHARD` unset, any shard but 1 skipped the docs step `test/check-lock.test.ts` expects.
- Status ordering (#531, tests.md): the slow-snapshot status test took 0.52 s idle and failed 17 of 20 runs with 64 CPU spinners on 4 cores at a 1 s bound.
- Config watcher off (#546, tests.md): the pet reload test failed 8 of 200 runs at 40 parallel on 18 cores until the watcher was off, and 0 of 200 after.
- Web fetch transport (#553, tests.md): the daemon test's answer waited on iana.org for 99 percent of its time and failed about 3 of 100 runs at 30 parallel on a 4 s bound; a longer wait would only have measured the network.
- Jcode usage (#801, budget.md): Jcode's `totalTokens` adds the cached read on top of an input that already holds it for OpenAI-style providers, and `jcode usage --json` names its limit with free text and no window length.
- Claim verdicts (#901, tasks.md): review of #937 found `factCheck.agreement` counting person-verdict frequencies, which is why a person verdict alone is never an agreement.

- Registered runner integration (#600, daemon.md): the frozen runner contract narrowed issue #1018 from person-or-conductor registration to person-only trust-root changes. Generic machine-local stripping would silently ignore shared/tracked runner keys instead of refusing them, and recursive declaration discovery omitted whole-map scoped replacements after registration existed. The config/recovery fixtures exercise explicit source refusal, atomic whole-block publication, pending raw edits versus accepted revocation, and the separate recovery floor and integrity binding.

Issue #1047 records approved tasks that could not accept a new head or a withdrawn verdict on hub 0.23.1. The prior in-review-only rule left the board bound to an older commit while reviewers handled later PR heads in comments. The approval reopening rules in tasks.md replace that restriction; fixture coverage includes a legacy receipt-only approval, a configured check without a prior reviewer, and a PR merged while a screen is pending.

Task 610 follows the staged-upgrade review: ordinary startup forgot the scoped target, scoped refresh replaced the shared manager, verified captures accumulated, and an empty plan reached source preservation before its not-running refusal. Runtime selection now starts at the first resolver release (0.26.0); earlier published binaries do not read the pointer, so that ceiling is documented rather than enforced by a broader database floor.

Review of PR #1050 found that including accepted runner configuration and raw-key presence in release-equality integrity made pending config edits and legacy no-receipt snapshots fail the release step. Runner configuration is mutable startup policy; receipt rows are retained board state. The runner integrity rule now separates those roles, with two-daemon prepare/commit/release fixtures covering both transitions.

Review of PR #1052 found that full-index trust sweeps and hashing every retained capture under the registry writer lock made ordinary startup refuse large repositories or starve other project writers. Per-start scoped trust and bounded quarantine transactions separate execution authority and deletion safety from maintenance cost.

The ledger review of PR #1052 found that applying the startup admission wait to worker completion could strand the ledger in running state after contention or a crash. Signed process ownership, an atomic dead-owner replacement, a normal worker wait and read-only doctor paths keep deferred maintenance recoverable and visible.

On 2026-11-09, #1220 T1 classified malformed root/limit input as source corruption.
T2 initially repeated that cause error for an explicit attempt address whose id
was not an owner-supported attempt id. The query-validation rule in tasks.md
separates caller mistakes from source failures; the execution-lineage and owner
fixtures cover both cases, including source-lookup traps and neutral agent replies.

On 2026-11-09, the #1320 Record read projection used the global configuration
revision. A roster-only reload then discarded a held public recall response, so
the existing #315 preface test lost its preface even though the independent
off-roster attach guard remained correct. The memory/privacy-specific read
revision preserves both behaviors; capture still uses its stricter turn fence.


## Changes

- 2026-11-15: #1447 T5 prepares dependencies from reviewed Git-base install inputs because validating a peer-writable manifest and later running it on the host leaves a race. Fixed readiness guidance does not turn an installer failure into failed acceptance. The localhost listener leg moved to a follow-up, and this slice keeps Pi's network profile unchanged.
- 2026-11-15: #1447 T4 reproduces a digest prepared before a task-move notice was queued. Conditional queue re-selection keeps that notice in the next host turn without changing durable ACKs; the later provider-prompt window remains unmeasured and open. Checkpoint ownership epochs prevent a pending notice from permitting former-owner summary effects.
- 2026-11-14: #1473 follows the #1328 cooperative direct-instruction precedent for one conductor-recorded question answer. Visible actor provenance avoids a second terminal step while a DB-only quote and unchanged person/private/self-answer boundaries keep the claim separate from blanket delegation or release consent.
- 2026-11-14: #1467 separates unknown-quota admission from the numeric reviewer floor. The default remains skip at 0.8; explicit pass can bootstrap a reviewer without a reading, while off disables quota admission checks and waits. Actual account/manual pauses remain independent, and the synthetic opt-out evidence does not claim live use or a new reset source.
- 2026-11-14: #1432 adds a narrow off/advise and check-name exception to person-only structural editing, following the existing cooperative direct-instruction model for release authorization. Separate intent and hashed-result audits distinguish a caller claim from a saved configuration, while the generic editor and release-consent authority stay separate.
- 2026-11-14: #1403 T7 preserves considered rejections because a repeated semantic finding id alone does not establish new evidence. Complete path-change evidence and an explicit reconsideration reason distinguish a new case from replay; unknown diffs retain suppression without deleting history. Closed proposal history no longer prevents an unsuppressed finding from becoming a new open card; its prior task id and reopening reason remain visible.
- 2026-11-14: #931 T3 binds retained contradiction history across revisions of the same claim identity, so an owner withdrawal or claim-version restoration cannot turn prior counterevidence into an unqualified ready result. The existing person-verdict store supplies the current-manifest disposition; provenance and semantic judgment remain distinct.

- 2026-11-13: #1403 B1 adds cold-readable intent and base-to-task-head drift advice. The existing PR conformance gate remains separate, so a moved or unreadable plan base cannot become a new acceptance gate.

- 2026-11-10: #850 distinguishes normal-Bus Q2 proof from direct busy-submit characterization and preserves adoption/reattach/deny quiescence ceilings.
- 2026-11-10: Spec acceptance carry-over (#1328 T4) distinguishes a new person decision from host-verified reuse of the same decision on explicitly superseding work. The narrow exception preserves original consent and records its cancelled source; it does not expose acceptance as a tool or receipt field. Review caught an early carry write before a later plan refusal: staging the host proof and committing only with the admitted outer event preserves the existing pre-effect refusal contract.
- 2026-11-09: #1328 T6 extended the closed machine-default schema for an explicit setup research choice, reusing guarded publication and preserving the existing autonomy and start choices.

## 2026-11-10: Qwen dual-output Q2

The v2 native workload appended a second submit directly while the first provider
response was held. Its private 0.26.1 matched control and later candidates emitted
one user event and one final assistant/stop containing both markers. The extra
provider POSTs were not classified by response format or role counts, so their
underlying cause is unknown. That workload did not reproduce the original
0.26.1 receipt's native-queued-turn claim; the original used a real gateway and a
global installation that changed during the day.

Ruling fa75c5f2-fc78-42a1-85dc-cf206e6a7825 makes required Q2 follow the actual normal
Bus and QwenDualPeer path. The second envelope waits in the Bus during the held
first response. Distinct native user/provider/final assistant/stop boundaries
remain necessary. Direct native busy-submit behavior is separate characterization.
The manual producer does not make the receipt harness eligible for automation.

Adoption can report idle with an unknown pre-existing turn; reattachment can
report idle before proving native quiescence; deny marks the hub turn ended before
native consumption is acknowledged. Those existing ceilings prevent an absolute
claim that no input can ever reach a native active turn. The premature deny/idle
follow-up is outside this compatibility change; the production adapter is unchanged.

The final account-free normal-Bus Q2 runs passed on the private 0.26.1 control
and 0.27.0 candidate, with two user/final-stop/provider turns after evidence was
frozen at owned stop. Two earlier normal-path controls failed the strict provider
check despite observing two real turns. Shipped-source analysis showed `--bare`
bypassed the private UI follow-up setting; the corrected fixture loads owned full
settings. The earlier extra requests remain unattributed because their latest
user bodies were not retained. The [dated receipt](../verification/2026-11-10-qwen-0270-dual-output.md)
separates these attempts and the 0.26.1 config-only observation from the later
passing required Q3/Q5/Q6/Q7 pair. The remaining producer preserved a PTY/catalog
control failure and a host FIFO-helper setup failure before the final matched
pair passed with owned cleanup/final closure. The independent direct-busy pair
on both versions observed one user/assistant/Stop with both markers in one
assistant, while required normal-Bus Q2 retained two distinct turns. No production
adapter, Bus or automatic receipt-admission behavior changed.

The task 859 deny-readiness correction separates known delivery disposition from native quiescence. Task 850 measured no post-deny completion ACK; normal-Bus assistant/Stop evidence cannot be reused for the denied turn. The durable fence keeps a synchronous Bus drain from submitting queued work and allows recovery through a new personal turn or a verified fresh generation. The 30 s deadline is an operational waiting bound, not evidence that native work stopped.

The same review found that a single append can write a prefix without throwing. The byte-count check and actual tail guard prevent a second append from completing that prefix. This intentionally adds no per-write persisted intent: a crash leaving a torn prefix that already ends with newline remains the explicit ceiling.


## 2026-11-13: Codex paused quota visibility (#1440)

The normal ten-minute native usage poll could delay observing an external reset while the hub held a budget pause. The #1440 contract kept resume in Budget.evaluate, added a one-minute paused observation cadence, and limited credit diagnostics to counts, times and flags. The Codex 0.167.2 generated schema defined availableCount separately from a possibly capped detail list, so incomplete detail coverage did not establish a global earliest expiry. Paid-credit availability supplied no pause/resume authority.

Issue #1403 B1 follow-up separates upstream plan drift from a task's own implementation. Acceptance needs no recorded task head: it compares the plan base with the locally recorded remote-tracking default tip. Completion uses the shared integration point with that tip, so the task's own commits do not masquerade as upstream drift. Local refs may lag the server; this advice performs no fetch. Missing or ambiguous history remains unknown, and lifecycle off remains quiet.

Issue #1446 separates reviewer admission from the account's hard pause. The reviewer floor defaults to 0.8 while the account gate keeps its own configuration. A wait is useful only with complete pool and reset evidence; preserving its first deadline avoids indefinite waiting after restarts. Kimi's diagnostic exception was observed on 2.2.0 and is unverified on 2.5.2. Its absence of a reset timestamp prevents wait admission. Owned accounting intents survive a crash without publishing private profile identity or silently treating an incomplete log as zero consumption.

On 2026-11-14, #1473 added shared question-tool exclusions to the daemon progress closure. Its extracted VM fixture omitted the new import, so both hosted OS shard 3 legs failed with `QUESTION_TOOLS is not defined`. The earlier Office render fixture had omitted a new helper too. The tests note now names the progress fixture and actual shared import so question-tool changes include that runtime privacy path; its canary checks preserve the existing ordinary-escalation positive control.

The 0.40.0 release review found that Pi's host-side dependency preparation security boundary was documented in the adapter and security guides but not pointed to by the security-review checklist. The checklist now points to those existing rules rather than duplicating them.
