# v0.12.24 implementation audit

Baseline: `v0.12.24`, commit `e311b50b7367668ae9b84f37e46886831de67850`.
Change contract: [#378](https://github.com/STAIxBWLB/agent-hub/issues/378).

## Feature inventory and review scope

The release changes 287 files, with 28,958 insertions and 1,008 deletions relative to v0.12.23. This is a risk-focused audit, not an exhaustive certification of every changed line.

| Area | Shipped behavior reviewed | Review boundary |
| --- | --- | --- |
| Planning and board | Backlog, reservations, WIP pull/return, split, dependency planning, GitHub intake | Tasks transitions, board persistence, related unit and surface tests |
| Native adapters | ACP cancellation, optional jcode, Pi roster return and recovery | Changed adapter paths and fixtures; no real-account execution |
| Hub memory | Append-only notes, graph, goals, leases, import and private-remote sync | Store, import, sync, recall, CLI and related tests |
| Dashboard and attention | Five columns, planning dates, Office projections, attention and pets | Shared models, dashboard rendering/actions, console deltas and DOM fixtures |
| Document and delivery evidence | Text projection, path policy, release/merge readiness | Selected source paths; no converter or remote delivery trial |

Independent read-only reviews covered the first four areas. Additional source inspection covered text projection and path-policy boundaries. OCR preview and file rules were collected for the release range: 120 reviewable files and 167 excluded files. That inventory is not a claim that all 287 files received a full review. Unexamined release paths include portions of benchmarks, research measurement, role/profile integration, CI/package tooling and daemon wiring outside the reported triggers.

## Corrected defects

- Person reservation protection: planner grooming could clear or replace a person's reserved peer, or write the same value to change its provenance and then bypass the pull guard. Shared provenance checks now refuse all planner reservation writes while the current reservation belongs to a person. Person overrides and ordinary planner reservations remain supported.
- Pi roster return: a native start or settlement arriving during a session snapshot request could be overwritten by its stale idle flag. This could admit work during a personal turn or leave queued work permanently busy. Authenticated lifecycle changes now invalidate the snapshot; the verified owner, detached state and queue remain intact for a fresh retry.
- Deferred memory indexing: goal and unscoped suggestion reads bypassed the freshness check used by note reads. After an append succeeded while SQLite was busy, these readers could retain stale goals, links, leases or suggestion verdicts. All three reader families now share the freshness check without changing log bytes or the index schema.
- Overdue board rendering: the cached board did not refresh when time alone crossed a task deadline. Its key now includes the derived overdue IDs, with the same values used for card badges. Unchanged overdue state preserves DOM identity.

## Verification

Before the source changes, 24 new assertions failed for the reported conditions and one new compatibility case passed. The same regressions were retained unchanged after the fixes. The related four-file suite then passed 94 tests and 542 assertions with no failures in 44.02 seconds.

The memory regressions use real SQLite write contention, both the writer and another pre-opened store, and compare the recovered index with a rebuild. Pi regressions interleave authenticated lifecycle events and snapshot acknowledgements, then verify a fresh retry and exactly-once queued delivery. The board regression executes the actual render cache with a controlled clock and checks DOM identity before and after the deadline.

Nine mutation guards exercise the new protections. Two existing mutation selectors were retargeted to the refactored code while preserving their original test and mutation intent. All 391 selectors match exactly once. Final full-gate and mutation-run outcomes are recorded on the PR at its exact reviewed head; selector matching alone is not a passing mutation run.

## Remaining limits

- Import identity needs a compatibility design: the same claude-mem observation can acquire different content IDs when filesystem-derived graph nodes differ across machines. A safe correction must retain old content-hash validation, append-only logs, graph determinism and existing forget/supersede references. This audit does not silently rewrite those logs.
- Import scan semantics need clarification: the current limit is applied before project filtering, so older rows from unrelated projects can consume the scan window. A project-aware bounded pagination design should preserve the existing result counters and privacy checks.
- Existing native/account, physical terminal/font and research-effect obligations remain unverified. Fixture or source success does not close those release obligations.
- This change does not publish a release, upgrade an installed CLI or restart a live daemon.


## Additional review: acknowledgment before native activity

The first corrective head passed the local full gate (2,667 tests, zero failures,
188,881 assertions, `check: OK`, no owned daemon leaks) and both platform checks.
External review then identified the opposite transport ordering: an idle snapshot
ACK can arrive before a personal start event, so a daemon-side event counter alone
cannot prevent native prompt insertion or erroneous personal-output attribution.
Those earlier passing checks therefore do not certify this additional race.

The follow-up extends the verified Pi bridge handshake with native prompt admission
and command lineage. Native prompt consumption, not receipt of an idle snapshot,
is the insertion boundary. A legacy extension without this proof cannot rejoin the
roster. Dedicated extension/adapter regressions cover the additional transport
ordering; final results belong to the PR's current head.


The extension performs its final idle/generation check and prompt insertion in
one synchronous JavaScript turn. The pinned native path claims an active run
before its first await; if the post-insertion idle check does not prove that
claim (for example, another extension defers it during settlement), the effect
is classified as uncertain and no hub lineage is lent to a later personal turn.
The callback barrier supports normal queue draining; it is not treated as an
atomic reservation across all third-party extension callbacks.

The dedicated follow-up regressions cover the actual extension, retained native
owner, delivery journal, malformed refusal fields, legacy capability refusal,
capability downgrade, accepted-turn replacement and old-lineage retirement.


The follow-up Pi suite passed 72 tests with 642 assertions and no failures in
9.53 seconds, followed by a successful TypeScript check. This includes 11 new
prompt-admission regressions and the existing Pi, roster, receipt and ceiling
suites. All existing assertions were retained; the shared fake bridge now sends
the additive capability and command lineage of the current extension.


Independent review of the native continuation path then identified that one
logical prompt can emit several `agent_start` events before `agent_settled`.
A real-extension regression reproduced loss of the command ID on the second
start. The ID now persists until logical settlement; later personal runs remain
untagged. The adapter regression also checks one accepted delivery completes
once across the retry sequence.


## Hosted macOS whole-suite budget

Both hosted macOS attempts at `79d308b0` reached the unchanged 600-second
whole-suite watchdog while individual tests continued to pass. They recorded
2,593 and 2,313 completed pass lines, no named assertion failure, exit 143 and no
current-invocation daemon leaks. The same-head local gate completed 2,680 tests
with no failures in 500.85 seconds. This establishes a whole-suite budget cutoff;
it does not establish an individual hang or a production regression.

The new SQLite-contention cases consumed about 63 seconds on each hosted run
and 37 seconds locally. Workload growth and runner latency contribute to budget
use, but their separate causal shares are unknown. The CI macOS gate now uses
the existing `AHUB_CHECK_HANG_S` option at 780 seconds. The job retains its
15-minute ceiling, each test retains its 20-second bound, all tests and leak
checks remain present, and execution remains serial. Linux and local invocation
defaults remain 600 seconds. No expectation or fixture timing was changed to
address this cutoff. Current-head CI must still pass before verification is
reported complete.


## Second pass (#382)

Scope: the areas listed above as unexamined or selected-only: SDLC and delivery evidence, data path policy and document projection, roles/research/tooling, and the jcode, Kimi and ACP adapters with their daemon wiring. Four independent read-only reviews ran against `a8143c96`; every finding was reproduced by a regression test that failed before its fix.

Corrected:

- Glob data policies lowercased names only. A directory stored in NFD with an NFC pattern, e.g. `data.readonly: ["학생자료/**"]`, was not matched, so a read-only file could be overwritten and a private subtree read as public. Both sides now use `foldSegment`.
- The converter sandbox was rooted at the project. A converter following an include published a `pii.paths` file's text. It is now rooted at an empty system directory, project file data is denied even under an enclosing `local.read_allow`, and only its snapshot and program files are granted.
- A failing converter ran again on every facts read, about 5 s on the event loop each time. A full-budget failure is remembered per input, command and extension for the process lifetime.
- `ahub watch kimi` judged headless Kimi by the configured start mode, and an older Kimi TUI socket's close cleared a newer admission.
- A disabled Codex plugin was re-added from its `hooks.state` trust entry; project Claude settings were read with a blocking, unbounded read.
- `hub_task_done` gated the review transition twice (four gh calls, two advice notices), and advise mode recorded overlapping dones. An owner could not relink a PR after a reviewed head was recorded.

Examined and kept: the Kimi MCP writer replaces any `agent-hub` entry, as operations.md and the existing test define that key as the hub's own. Converters that load sibling helper modules from the project no longer can; docs/text-projection.md now says so.

Gate review then found that folding made `?` stop matching a name whose fold expands (`ß`, `ﬁ`); matching now accepts either the lowercase or the folded spelling. A further review found that denying project data broke converters that call getcwd or load a relative project script; the converter now runs in its scratch directory with absolute program paths and listing grants for the directories above an in-project script. Ten new mutation guards cover the fixes; the projection protections have regression tests only, because those tests run on macOS and the seeded job runs on Linux. Native/account behavior remains unverified as before.

