release v0.33.0: pluggable languages ship opt-in, durable resolution, Windows CANTOPEN fix, XAML 0.3.0 #316

Merged
buildagent merged 162 commits from release-v0.33.0 into master 2026-10-05 17:20:06 +02:00
Member

Epic #309. Schema 75 → 78. The first-start reparse happens once.

What ships

  • All seven languages as signed first-party packages. Ruby, PHP, JavaScript, TypeScript, C#, Rust and Python are bundled but opt-in (shadow). The builtins still own every language, and no flip happens in this release; each flip is gated on the overhead budget below.
    • init (and the first automatic start) records the detected languages in .code-index/languages.toml, never in the project root.
    • Packages use reserved plain ids, carry requires_host, and come with catalog v2 and plugin update.
  • Durable resolution (#301). Reference resolution commits in batches and resumes after a restart. A one-shot query waits up to 10 s, starts the real daemon, and reports index_state while the project is not ready. Measured on Django: convergence in 43 bounded calls, with the result matching the oracle exactly.
  • The activation identity follows effective routing, not the config text. A first start that records ["python"] on a Python-only project no longer rebuilds everything.
  • Windows elevated-write CANTOPEN (reported in A1X code-index-dev):
    • index files keep the invoking user's access;
    • a permanent open failure gets its own non-transient error instead of warming_up;
    • daemon respawn backs off and stops after repeated identical failures.
  • Locks and test seams. Every write path waits out a foreign lock with backoff, up to a 600 s deadline. Test seams are per database (#311).
  • XAML 0.3.0 (#312).
    • No false unsupported_syntax on long Data/Points values.
    • x:Key and {StaticResource}/{DynamicResource} are now indexed and bound.
    • Known limits: references across directories stay unbound, and a file of about 17 MB or more would hit the 30 s per-file deadline.
    • The first-party anchor test now uses a frozen signed archive, so a package bump no longer needs an offline re-sign.
  • Python precision. Receiver binds are refused only on positive evidence: flask −4 and Django −5 wrong binds, Django +66 receiver binds.
  • Cost. fullscan_step −5…−9% and autoindex −82…−96% across all seven pinned repos (blessed with per-statement attribution).

Measured package overhead (quiet machine, release worker, median of 5)

  • Warm: +0.1% to +5.3% (budget 10%).
  • Cold vs builtin (budget 1.2×): TS 1.37×, Rust 1.61×, PHP 1.78×, C# 2.10×, JS 2.25×, Ruby 2.34×, Python 3.64×. Every language therefore ships opt-in.
  • Semantic parity: six of seven packages match the builtin exactly. The Python package loses 91 of 15,365 bindings on flask. These are lost bindings only, with no wrong binds, and they are fixed in the package itself (#315), not in the host.

Local gate (one full run on 8879fd84; fixes since re-verified by their own suites)

  • Static checks: fmt; clippy (Linux and windows-gnu); docs with -D warnings --document-private-items; abi i686; guest gates.
  • Tests: workspace 441/442 suites, the one failure fixed by 5e4c602b (example versions had collided with 0.33.0); headroom; daemon leg 83/83.
  • Corpus: 13/13 corpus suites, guestkit 2/2, agent_task_bench, tier 3.
  • Precision gate: 7/7 with phantom_count 0, POPULATION printed.

The Python package parity is tracked in #315. #314 (a test leaks COSI_CORPUS_DIR to a spawned server) does not affect CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu

Epic #309. Schema 75 → 78. The first-start reparse happens once. ## What ships - **All seven languages as signed first-party packages.** Ruby, PHP, JavaScript, TypeScript, C#, Rust and Python are bundled but **opt-in (shadow)**. The builtins still own every language, and no flip happens in this release; each flip is gated on the overhead budget below. - `init` (and the first automatic start) records the detected languages in `.code-index/languages.toml`, never in the project root. - Packages use reserved plain ids, carry `requires_host`, and come with catalog v2 and `plugin update`. - **Durable resolution (#301).** Reference resolution commits in batches and resumes after a restart. A one-shot query waits up to 10 s, starts the real daemon, and reports `index_state` while the project is not ready. Measured on Django: convergence in 43 bounded calls, with the result matching the oracle exactly. - **The activation identity follows effective routing, not the config text.** A first start that records `["python"]` on a Python-only project no longer rebuilds everything. - **Windows elevated-write CANTOPEN** (reported in A1X code-index-dev): - index files keep the invoking user's access; - a permanent open failure gets its own non-transient error instead of `warming_up`; - daemon respawn backs off and stops after repeated identical failures. - **Locks and test seams.** Every write path waits out a foreign lock with backoff, up to a 600 s deadline. Test seams are per database (#311). - **XAML 0.3.0 (#312).** - No false `unsupported_syntax` on long `Data`/`Points` values. - `x:Key` and `{StaticResource}`/`{DynamicResource}` are now indexed and bound. - Known limits: references across directories stay unbound, and a file of about 17 MB or more would hit the 30 s per-file deadline. - The first-party anchor test now uses a frozen signed archive, so a package bump no longer needs an offline re-sign. - **Python precision.** Receiver binds are refused only on positive evidence: flask −4 and Django −5 wrong binds, Django +66 receiver binds. - **Cost.** fullscan_step −5…−9% and autoindex −82…−96% across all seven pinned repos (blessed with per-statement attribution). ## Measured package overhead (quiet machine, release worker, median of 5) - **Warm:** +0.1% to +5.3% (budget 10%). - **Cold vs builtin** (budget 1.2×): TS 1.37×, Rust 1.61×, PHP 1.78×, C# 2.10×, JS 2.25×, Ruby 2.34×, Python 3.64×. Every language therefore ships opt-in. - **Semantic parity:** six of seven packages match the builtin exactly. The **Python package** loses 91 of 15,365 bindings on flask. These are lost bindings only, with no wrong binds, and they are fixed in the package itself (#315), not in the host. ## Local gate (one full run on 8879fd84; fixes since re-verified by their own suites) - **Static checks:** fmt; clippy (Linux and windows-gnu); docs with `-D warnings --document-private-items`; abi i686; guest gates. - **Tests:** workspace 441/442 suites, the one failure fixed by 5e4c602b (example versions had collided with 0.33.0); headroom; daemon leg 83/83. - **Corpus:** 13/13 corpus suites, guestkit 2/2, agent_task_bench, tier 3. - **Precision gate:** 7/7 with phantom_count 0, POPULATION printed. The Python package parity is tracked in #315. #314 (a test leaks `COSI_CORPUS_DIR` to a spawned server) does not affect CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The lock number says how long; the profile hook says which statement.
The empty-queue arm is the worst case for a carrying switch and the
best case for one that does not, so a 1% reparse arm measures what a
switch costs per file it really moves. The rollback leg now times the
switch alone (generations::promote on the generation rollback would
pick): the post-switch resolve is outside the lock by construction.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
A package may now declare the code-index releases it was written for:
`requires_host = ">=0.33.0, <0.40.0"` (comparators >=, >, <=, <, =; every
one must hold). Absent admits every host, so every package published
before the field existed keeps loading.

Keyed on the RELEASE version (CARGO_PKG_VERSION, shared by every binary
of a release), not on the ABI — which [abi] host_min/max and
guest_min/max already negotiate — and not on HOST_EXTRACTION_EPOCH,
which is a cache key that host features do not move. The full argument
is in code_index_package::host.

The grammar is checked by Manifest::validate (manifest.invalid_value);
whether THIS host is inside the range is Manifest::check_host_version,
called at the operator store's door (StoredPackage::parse) beside
check_supported_tiers. That one call covers install/add/enable/update
AND every activation's re-read of an approved digest, so a package is
refused by name at both. The refusal reuses manifest.abi_unsupported,
whose registration already names "host version range"; a new wire code
would move ABI_MINOR. The witness names package, range and host.

requires_host is OUT of extraction_identity (it decides whether a
package loads, not what it emits). plugin inspect prints it, with this
host's verdict. ABI_STABILITY and its quoted surfaces say a package is
pinned to requires_host only where its author declares one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Phase 1 created `declared_profiles` lazily on the first declaration, so as
not to move CURRENT_VERSION under a baseline that lane could not
re-measure. m0074 now creates it on every index (`IF NOT EXISTS`, so an
index a Phase-1 build already gave the table keeps its rows), and the lazy
path is gone: `profiles::ensure_table` and `table_exists`, the probes in
`fingerprint`/`write_declared`, and `LAZY_OBJECTS` with its agreement
checks in `generation_policy_registry` (the source scan now sees the DDL).

ONE PROBE STAYS, in `load_book`, and it is not the lazy path: the resolver
also runs inside older migrations (m0016's full re-resolve), on a schema
below v74. Measured: without it 59 migration tests fail with "no such
table: declared_profiles" at version 16.

Test: `profiles::tests::m0074_creates_the_table_and_adopts_a_lazily_created_one`
MUTATION (RUN) drop m0074 from MIGRATIONS -> RED (all 4 profiles tests).
MUTATION (RUN) m0074 without IF NOT EXISTS -> RED ("table declared_profiles
already exists" on the lazily created one).

BASELINES, re-measured through their bless paths, not edited:
- package-baseline.json: outcome `conditions_only`, diff [], projection
  identity unchanged (eaad2470...); only the schema moved, 73 -> 74.
- ruby-package-cost.json: projection identity unchanged (58b2da9c...).
  The bless path rewrites the run's numbers: vm_step 30086175 -> 30075681
  (-0.035%), fullscan 625828 -> 625304, sort/autoindex unchanged, wall
  ratio 134 -> 140. Pre-bless survey at schema 74, 4 runs, load 7-9:
  vm_step 30077045..30086094 — inside the same jitter the schema-73 lane
  recorded (30083210..30092091). An A/B at schema 73 in this tree is not
  possible without restoring the lazy path (write_declared needs the
  table), so the comparison is against that recorded survey.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
A channel catalog lists several versions per package, each carrying the
package manifest's requires_host verbatim (derived from the .cip by the
step that publishes it, never authored), and binds latest_version to the
newest key. Every catalog struct — and every host that ever shipped — is
deny_unknown_fields, so the field cannot ride in a v1 document: an older
host would refuse the WHOLE catalog. It lives in schema_version 2, which
an older host refuses by number, and RegistryCatalog::project_v1 derives
the document an older host reads: schema_version 1, every version that
declares a range dropped (such a version's manifest carries
requires_host, which an older host refuses with manifest.unknown_field
anyway), latest_version the newest survivor.

PluginEntry::newest_compatible is the one selection rule: the highest
version whose range admits the host — and, where no version declares a
range (every v1 document), latest_version exactly as before, so a v1
mirror naming an older row still reaches #255's downgrade refusal.
plugin add/install <id> and the configured [update] from = "registry"
arm both select through it.

distribution/schema.v2.json is executed beside validate() by
registry_schema_v2.rs (one registered rust-only row: latest_version as
the newest key). The same file proves the v1 projection of a real v2
document passes schema.v1.json and validate() as v1, carries no
requires_host, and offers exactly the committed plugin set; and that
schema.v1.json refuses the v2 document itself. The embedded catalog is
unchanged and stays v1.

code-index-core now depends on code-index-package for Version and
HostRange — the one definition of each.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Phase 1 warmed and verified the DEFAULT `[grammar]` only; a
`[[grammars]]` lane staged its GrammarSpec with `cache_dir: None`, so
every worker of a named lane JIT-compiled its grammar on every load (the
~215 ms the cache saves on the Ruby grammar, per worker, per lane).

`grammar_caches` now returns a `LaneCaches` per package — the default
grammar's and one per named lane, in `InstalledPackage::lanes` order —
and `finish_activation` hands each lane's verified directory to that
lane's GrammarSpec. The key gains the grammar half the extractor cache
already had: `<digest>/<host key>-<grammar content key>`, the content key
being `wasm_content_key` of the staged grammar artifact. So two lanes of
one package never share an entry unless their grammar BYTES are the same,
in which case sharing is correct. One package's lanes warm in sequence,
so such a pair meets the directory one after the other instead of racing.
GC needs no change: it already reads the build as the part before the
dash. The default grammar's directory name changes once
(`<host key>` -> `<host key>-<content key>`), costing one re-warm on a
machine that ran an unreleased Phase-1 build; the old entry is collected
once the plugin-host build changes and it ages past STALE_CACHE_AFTER,
like any other entry of another build.

Test: grammar_cache::every_lane_grammar_is_cached_under_its_own_key_and_its_worker_uses_it
(a two-lane package: shipped Ruby on the default lane, shipped Svelte on
a named one).
MUTATION (RUN) warm no named lane -> RED "one verified cache per lane".
MUTATION (RUN) drop the loop that sets each lane's cache_dir -> RED "the
svelte lane's worker did not compile into the cache it was handed".
cache_gc, extractor_cache, multi_grammar_package, grammar_cache: green.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
THE GUARD before bundling (#309 Phase 2): shipping a first-party package
in the release archive must not move a language's owner. Phase 3 does
that, one language per release, after a shadow release.

ONE STRUCTURAL FACT, in core: `lang_profile::PACKAGE_OWNS_UNDER_AUTO`,
the builtin languages a healthy displacing package may own under
`[languages] <lang> = "auto"`. EMPTY. `LanguagesConfig::package_may_own`
is its only reader, and it gates the package's consented `[[displaces]]`
— the one mechanism through which a package can take a builtin's files —
so the router, the dirty domain and the `plugin enable` preview all
follow without being told. A Phase-3 flip is adding the language there.

* `auto`: the package is admitted, approved and healthy, and SHADOW. Its
  owner row says `builtin` with the new closed reason `package_shadow`.
* `package`: the operator's explicit opt-in, unchanged and unaffected.
* `builtin`: unchanged.

BEHAVIOUR CHANGE, stated: before this, an approved displacing package
owned its language under `auto` (with the language enabled, or no
decision). Now it needs `[languages] <lang> = "package"`. No shipped
package displaces a builtin (de.h-dv.ruby claims `.rbx` only), so no
released configuration loses an owner; the tests that grade what a
displacement BUYS now ask for it explicitly:
builtin_displacement_routing (OPT_IN), builtin_displacement_e2e and
language_owner_e2e (leg 1 now `ruby = "package"`).

Tests:
- builtin_displacement_routing::under_auto_a_displacing_package_is_admitted_and_shadow
  MUTATION (RUN) add "rust" to PACKAGE_OWNS_UNDER_AUTO -> RED
  (`src/lib.rs` routes to the package).
- languages::tests::the_owner_rule_is_a_truth_table, over every builtin
  MUTATION (RUN) drop the switch conjunct from package_may_own -> RED.
- languages::tests::owner_rows_name_the_reason (package_shadow).
Green: indexer languages:: (8), builtin_displacement_routing (10),
daemon builtin_displacement_e2e (2), language_owner_e2e (4),
cli plugin_displacement_cli (3), plugin_update_cli (20).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`code-index plugin update <PACKAGE>` asks the signed catalog for the
newest version whose requires_host admits this host and installs it
through the existing store and approval path:

- the catalog comes from --catalog, COSI_REGISTRY_PATH,
  COSI_REGISTRY_URL, then the package channel (CHANNEL_CATALOG_URL) —
  NEVER the embedded snapshot, which cannot know of a later release; a
  catalog that cannot be read is an offline refusal that says nothing
  was checked, never "up to date";
- the catalog's .sig and the package's .cips are verified against the
  operator's trust set, and the fetched bytes are held to the pin and
  parsed through the store's own door (so requires_host is enforced on
  the bytes, not just on the catalog's word);
- update::assess_auto_apply decides once: an unchanged authority applies
  unattended (apply_update); a grant that grows, a new displacement or a
  moved extraction identity ASKS — plugin add's confirmation over the
  fetched bytes, --grant/--yes as there; a different publisher or id, a
  withdrawn digest or a version that is not newer is refused by its code;
- atomic: nothing is written before the candidate is verified, C1 runs
  before the grant is written, and an activation that fails now restores
  the approval record it started from (in apply_update, so the
  configured [update] path gains it too, and around the confirm path).

`plugin update` with no package is unchanged. The dispatch stays one
arm so plugin_command_registry still grades one disclosure family.
README documents both and requires_host.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The release side of the channel, as a CLI command the workflow runs and
a test can run locally:

  code-index plugin catalog-merge --out <dir> [--base <channel>]
      [--include <release catalog>]... [--package <x.cip> --url <u>
      --signature-url <u>]

writes <dir>/registry.v2.json (the channel) and <dir>/registry.v1.json
(its v1 projection). Every input is verified against the trust set
first — base and includes through the one catalog loader (.sig
required), the package through its .cips — and every output value is
derived from them (registry::channel_entry); the only outside inputs are
the two URLs the host that stored the assets reports.

Merge rules (registry::merge_plugin / build_channel): a version already
listed with the same digest is kept (re-running a release reproduces the
channel byte for byte); the same version with different bytes, or a
package offered under another publisher key, is refused; code_index is
taken whole from the input naming the newest core release; the result
and its projection must pass validate() or nothing is written.

The command is user-family read-only (registered in
plugin_command_registry; the registry's variant->invocation mapping now
kebab-cases, which every one-word variant had satisfied by accident) and
documented in README. The e2e builds a channel from a signed release
catalog plus two packages, loads both outputs through `plugin catalog`,
and has `plugin update` read it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Measured against the installed v0.32.2 binary: the v2 channel is refused
at DESERIALISATION ("unknown field requires_host"), before validate()
reaches schema_version — not "by number" as the docs claimed. Still a
refusal, never a misread; the v1 projection loads and lists every
range-free version, and a manifest carrying requires_host is refused
with manifest.unknown_field. The docs now say what was observed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 Phase 2. A release archive will carry the first-party language
packages' signed `.cip` + `.cips` in `code-index-packages/` beside the
binaries (the archive and installer half is the next commit). This is
the product half.

`code_index_indexer::bundled`:
* WHERE: `<dir of current_exe>/code-index-packages` — one relative
  place in the unpacked archive, an install.sh prefix and an install.ps1
  directory.
* NOT A SECOND TRUST PATH: every bundled `.cip` is checked by exactly
  the statements `Store::install` runs on any file — `StoredPackage::
  parse`, `Store::anchor_for_source` against the operator's CURRENT
  trust set (which holds the compiled-in FIRST_PARTY_ANCHORS unless the
  operator withdrew it), `reserved_language_gate`. Never trusted by
  location. A file that does not verify is REFUSED by name, never
  offered; one serving no reserved plain language is IGNORED (the
  directory is not a second plugin channel); two offers for one language
  are both refused rather than chosen between by listing order.
* OFFERED, never adopted by the scan: it writes nothing.

`code-index languages enable <lang>` adopts the bundled package for each
requested language through the ONE door: `plugin add <bundled file>
--sha256 <the digest the scan verified> --grant requested --yes` (new
`plugin::add_bundled`, a call to `cmd_add`). So install, C1, approval and
activation are `plugin add`'s, the confirmation block is printed, and
bytes that change between scan and install refuse with digest_mismatch.
A package id the project already approves is left alone. It then says
the package is SHADOW under `auto` (previous commit) and names the
opt-in.

DISCLOSED in `languages list` and `plugin status` (one renderer,
`languages::print_bundled`): the directory, counts, each offer with
language, id, version, digest, the operator's label for the verifying
key and whether this project approved it; refusals and ignored files.
The `plugin add` confirmation's owner sentence now states the shadow rule.

Tests (crates/daemon/tests/bundled_language_e2e.rs), through COPIED
binaries in an archive layout and a real daemon:
* a_bundled_language_package_is_adopted_and_stays_shadow_until_its_language_flips
  offered by list and status -> adopted by enable (and not twice) ->
  daemon: package admitted and named, every .rb row `builtin`, owner
  row `package_shadow` -> `languages owner ruby package` moves the rows.
  MUTATION (RUN) add "ruby" to PACKAGE_OWNS_UNDER_AUTO -> RED at the
  enable note; with that assertion off RED at the owner row; with that
  off too RED at the ROWS (greeter.rb produced by de.h-dv.ruby).
  MUTATION (RUN) adopt_bundled returns early -> RED.
* a_bundled_package_that_does_not_verify_is_refused_not_offered
  MUTATION (RUN) skip anchor_for_source in bundled::verify -> RED.
(Even with the scan mutated, `languages enable` would still refuse at
cmd_add's own install door.)
The displacing Ruby fixture moved to common::plugin_pkg and is shared
with language_owner_e2e. cli crate: 389 passed, 0 failed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 Phase 2, the distribution half. Release-job changes are verified
locally here and in CI later; no release workflow was dispatched.

NEW JOB `bundle-first-party` (needs: version), BEFORE the builds, so the
archive the Windows smoke executes is the archive that ships — never a
bundle spliced in after the smoke:
* builds the CLI; `.forgejo/scripts/bundle_first_party.sh pack` packs
  every tests/packages/*/ and keeps exactly those `plugin inspect` reports
  `reserved_languages` for (new line in `plugin inspect`, so the binary,
  not a list in shell, decides which packages are language packages),
  refusing a packed digest or extraction identity that is not the
  recorded one, and an empty result;
* `sign` (the only step that sees CODE_INDEX_PUBLISHER_KEY) refuses any
  key but tests/packages/first-party.fingerprint's;
* `verify` lays the bundle beside a copy of the binary and requires
  `languages list` to report N offered, 0 refused, 0 ignored in a store
  with NO operator anchors — only the compiled-in key can do that;
* uploads `first-party-bundle`.
build / build-musl / build-windows need it and copy it into
`<archive>/code-index-packages/` (refusing an empty bundle or a .cip
without its .cips); the Windows zip writes those members as
`<name>/code-index-packages/<file>`, '/'-separated, read back as before.
The per-platform READMEs' manual install lines copy the folder too.

CHECKS ON THE SHIPPED BYTES:
* windows-archive-smoke, after install.ps1 installs the SHIPPED zip: the
  installed `code-index-packages\` exists and the installed binary offers
  every package in it from the compiled-in key alone — natively.
* Pack the Ruby language package: the shipped linux archive's bundled
  .cip and .cips are byte-EQUAL (`cmp`) to what that job packs with the
  shipped binary and signs (pack and Ed25519 are deterministic), and the
  shipped binary offers it offline.

INSTALLERS: install.sh and install.ps1 stage `code-index-packages/`
beside the binaries (install.sh refuses a symlinked member; install.ps1's
member inspection already refuses symlinks and reparse points), then,
after the binaries are committed, rename the previous bundle aside and
move the new one in whole. An archive with no bundle (an older --tag)
leaves an existing bundle alone and says so.

Tests and mutations (all RUN):
* installer_e2e::the_bundled_packages_are_installed_beside_the_binaries
  - skip the commit block -> RED; merge into the old dir instead of
    replacing it -> RED (stale package survives).
* installer_e2e::a_symlinked_bundled_member_is_refused_and_nothing_is_installed
  - drop the `[ -L ]` test -> RED.
* installer_ps1_e2e::the_bundled_packages_are_installed_beside_the_binaries
  (through the pwsh container; the whole ps1 suite: 32 passed)
  - `if ($null -ne $stagedBundle)` -> `if ($false)` -> RED.
* bundle_first_party_gate (cfg(unix), real binary): pack bundles exactly
  de.h-dv.ruby at its recorded digest; a moved recorded digest is
  refused; sign refuses a stranger key; verify refuses a stranger's
  signature at signature_untrusted.
  - drop the (none) skip -> RED; compare extraction_identity only -> RED;
    drop the sign fingerprint check -> RED; accept any verify summary ->
    first SURVIVED (a second, redundant count check caught it), so the
    redundant check was removed and the mutation re-run -> RED.
Gates green: release_gate 36, ci_cadence 9 (it caught an em dash in a
PowerShell block — fixed), ci_disk_preflight 5, release_fixture_gate 3,
installer_targets, release_installer, first_party_anchor,
release_registry_gate 27, registry_synthesis, plugin_command_registry,
release_gate_e2e, platform_support_claims, readme_security_claims (it
caught "no network" in the README — reworded), shipped_binary_registry,
no_code_generator_ships, grammar_provenance.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The four copy-pasted packaging jobs in release.yml (~2,100 lines that
differed in a directory, a capability list, a scratch fixture and Ruby's
derived-names arm) are ONE matrix job, `package-plugin`, over
`package: [xaml, timeline, ruby, svelte]`. Its steps keep their names and
run three shared scripts, which derive everything package-specific from
the package:

  package_pack.sh    pack with the shipped binary; refuse a moved
                     package_digest/extraction_identity, an empty record,
                     a tag naming another id or version
  package_sign.sh    sign; refuse an unset key or one that is not the
                     recorded publisher (HOLDS THE KEY, EXECUTES NOTHING)
  package_verify.sh  install: the operator path with `--grant requested`,
                     C1/C2, the derived-names arm where the manifest asks;
                     negative: byte-flipped and missing .cips must refuse
                     (EXECUTES THE PACKAGE; refuses while the key is
                     reachable)

`plugin inspect` now prints `derived_names` (text and JSON), which the
verify script reads off the packed bytes. Found and fixed on the way: the
inline jobs compared the flipped .cips against "${CIP}s" from inside
scratch/, where it named no file, so "the byte flip changed nothing"
could never fire.

package-release.yml releases ONE package on a `pkg/<id>/v<version>` tag,
without a core release: the required-CI gate (release.yml's windows-gate
body, moved into require_ci_green.sh and called by both); the newest core
release's shipped binary, held to its signed catalog's sha256; the same
three scripts; an immutable `pkg/<id>/v<version>` release
(package_publish.sh: Forgejo API by curl, DRY_RUN rehearsal, URLs from
the host's answer); the channel (package_channel.sh: catalog-merge, sign
both documents, read each back through the binary's own catalog door);
publish it; and re-read the PUBLISHED channel to catch a lost update.

Gates: release_gate.rs and release_fixture_gate.rs read the one matrix
job and the scripts its steps run (effective code), hold the matrix
EQUAL to tests/packages/*/plugin.toml in both directions, and extend the
publisher-key containment to package-release.yml. Population floors
re-measured and named (steps 87->66, jobs 11->8, key sites 5->4 across
both workflows, key-holding steps 5, all inlined). A script that only
TESTS the key's absence (`-n "${CODE_INDEX_PUBLISHER_KEY:-}"`) no longer
counts as holding it. ci_cadence registers the new workflow;
plugin_command_registry's variant->verb mapping is unchanged.
test-support's HTTP fixture drains request bodies and records
`METHOD path`; posix gains run_posix_script_in.

crates/cli/tests/package_release_scripts.rs EXECUTES every script: all
four packages end to end with a fixture key, every refusal beside its
twin, the channel build/sign/read-back, the publish script against a fake
API (DRY_RUN and real), and every arm of the CI gate. Also removes the
literal release version from four files the version-site registry
flagged. NOTHING HERE HAS BEEN DISPATCHED.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Two primitives for #301, in the crate that already owns daemon.lock and
the Windows FFI.

- `try_reconcile_lock(db)`: a kernel lock beside the database
  (`<db>-reconcile.lock`). It is released however the holder dies.
  Every in-process reconcile will take it, so one process at a time
  reconciles an index that no daemon serves.
- `keep_std_handles_from_children()`: clears the inherit flag on this
  process's own std handles on Windows, where `CreateProcess` hands a
  child every inheritable handle. If a child outlives us, it must not
  hold our caller's pipes open. No-op on Unix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Resolution is one transaction. A one-shot server killed on its 2 s
`warming_up` reply therefore lost the reconcile on every call, and
`converges_on_retry` could only be false.

- A one-shot call now waits up to 10 s (ONE_SHOT_WAIT_DEADLINE) for its
  own reconcile. That answers every tier-1 repo except django on the
  first call, and stays inside the blast-radius hook's 20 s.
- If the reconcile is still running, the reply discloses
  `reconcile_pending.finisher {this_process, pid, lock, log}` with
  `converges_on_retry: true`. When its caller hangs up, the server stays
  until the index is current, logs both ends to daemon.log, and exits.
  It yields (exits) if a daemon starts serving the index.
- Every in-process writer leg takes the reconcile lock before opening
  the database. A one-shot server that finds the lock held waits, and
  its reply says another process is finishing.
- `converges_on_retry` is derived from the reconcile phase. It is false
  only when no process is reconciling. The phase ends when the outcome
  is stored into the slot, not before.
- A server hung up on before any disclosing reply exits at once. It
  does not linger silently.

Tests (each mutation run, each RED):
- reconcile_pending_is_for_a_one_shot_process_no_daemon_serves:
  `converges_on_retry` constant true; `mark_disclosed` dropped; RUNNING
  reported as another process; `store` not resetting the phase.
- oneshot_reconcile_e2e (new; the test holds the lock):
  - a busy lock taken as acquired;
  - WAITING mapped to no finisher;
  - the undisclosed-exit removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`code-index query` no longer kills its server after the reply.

- It closes the server's stdin. A server whose reply disclosed it is
  finishing the reconcile (`finisher.this_process`) is left running and
  is not waited on. Any other server is waited for briefly, and its
  stderr is drained to EOF.
- The server's stderr is forwarded through a pipe this process owns
  rather than inherited. Otherwise a finisher would hold the caller's
  pipe open.
- On Windows the server also gets its own hidden console.
- The stderr note says who is finishing the reconcile, or, when no one
  is, what will finish it.

query_cli, each mutation run and RED:
- a_one_shot_query_mid_upgrade_converges_on_retry (replaces
  ..._names_the_remedy). It now converges by plain retries:
  - finisher never stays -> never converged;
  - CLI waits for the finisher -> caller held;
  - count mtime -2 -> wrong count.
- a_one_shot_query_on_a_first_index_omits_the_upgrade_count:
  awaiting filter dropped.
- two_one_shot_queries_at_once_leave_one_finisher: busy lock taken as
  acquired.
- a_daemon_started_mid_way_takes_over_from_the_finisher (real daemon):
  daemon check dropped.
- the_cli_log_level_reaches_the_spawned_server. Its premise is now
  asserted (the query must ANSWER), which removes the race behind
  nightly runs 5643 and 5675:
  - zero one-shot wait -> RED on the premise;
  - ignore --log -> RED.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The README's upgrade note and the skill's `warming_up` row no longer say
a one-shot query cannot finish: they name the finisher and say what
`converges_on_retry: false` still means. The record holds the
measurements: tier-1 plus rust-analyzer reconcile times, and django
before (38 calls in 151 s, never converged) versus after (answered on
call 6, at +60 s). It also holds the design choice, the concurrency
cases, the test/mutation table and what is deferred.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
require_ci_green.sh went in at mode 100644 while release.yml's
windows-gate and package-release.yml's ci-gate both run it as a command,
so both would have died with `Permission denied` on the runner — after
every local test passed, because the tests run scripts through an
interpreter and a dev checkout's mode is whatever chmod left.

release_gate::every_script_a_workflow_names_is_executable_in_git reads
the modes from the git INDEX and requires 100755 for every .sh a workflow
or another script names. Mutations run: dropping +x from
require_ci_green.sh (the real defect) and from package_pack.sh — both RED.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
posix_script_gate grades spawns call by call and read the new test's
Command::new("git") as handing a script to a hand-rolled interpreter,
because the same body read .forgejo/scripts/*.sh. The spawn now lives in
git_index_modes(dir). posix_script_gate 4/4, release_gate 37/37; the
exec-bit mutation (package_pack.sh at 100644) re-run: RED.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Acting on `review_diff` (base 4ecf930): every `bundled` symbol was
reported `untested_change`. That is partly the tool's horizon — the
end-to-end tests reach `bundled::scan` through the shipped binaries, a
process boundary no static edge crosses — but it also pointed at a real
hole: the one-offer-per-language refusal had no test at all.

crates/indexer/tests/bundled_scan.rs, in process, through the real store
and the fixture publisher's first-party anchor:
* a language package is offered, a non-language package (xaml) ignored;
  MUTATION (RUN) drop verify's early Ok(None) -> RED.
* two bundled packages serving ruby are BOTH refused;
  MUTATION (RUN) disable the one-offer-per-language block -> RED.
* an absent directory offers nothing and says so (`dir_present`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Per the coordinator (lane V consolidates pack/sign/verify into shared
`package_pack.sh` / `package_sign.sh` / `package_verify.sh`, built with
the SHIPPED binary): this lane must not pack, sign or verify on its own.
Reduced to the minimum, with TODOs naming V's scripts for integration:

* `bundle-first-party` now needs `package-plugin-ruby` and only collects
  its already-signed `.cip` + `.cips` (refusing a .cip without its .cips
  or an empty set) into the `first-party-bundle` artifact.
* `Create Forgejo Release` gains one step, BEFORE the installers and the
  catalog stage: it adds `<name>/code-index-packages/` to every archive
  (tar appended, zip entries added '/'-separated), rewrites each
  `.sha256` from the final bytes, and drops the bundle's duplicate asset
  copies. Exercised locally against a fake tar.gz and zip.
* REMOVED: the CLI build, `.forgejo/scripts/bundle_first_party.sh` and
  its gate, the build jobs' bundle copies, the Windows smoke's bundled
  check and the Ruby job's byte-equality step — all of which only made
  sense with the bundle in place before the archives were built.

STATED, NOT HIDDEN (TODO in the YAML): `windows-archive-smoke` now
executes the archive WITHOUT the bundle; the binaries in it are
byte-identical, but the bundled path is not smoked natively until
integration places the bundle where the archives are built.

`plugin inspect`'s `reserved_languages` line stays (one answer to "is
this a first-party language package"), now graded by
bundled_language_e2e. MUTATION (RUN): print `(none)` unconditionally ->
RED.

Gates: release_gate 36, ci_cadence 9, ci_disk_preflight 5,
release_fixture_gate 3, installer_targets, release_installer,
first_party_anchor, release_registry_gate 27, registry_synthesis,
release_gate_e2e 2, bundled_language_e2e 2; clippy -D warnings (host and
windows-gnu) and fmt clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The range was checked in StoredPackage::parse, which is also the re-read
of every APPROVED digest (Store::get). An approved package a host
upgrade moved out of its range was therefore dropped by
ApprovedPackageIds::resolve, labelled `archive_refused` in
PackageSet::unapproved, and `plugin update <id>` — which the refusal
text names as the repair — exited "not approved … plugin add".
Reproduced by the reviewer; now an e2e test.

- install: approval::host_range_gate, from Store::install, `plugin add`
  (before anything is rendered) and `plugin update`'s fetched candidate;
- activation: packages::prepare_claims, into PackageSet::refused as
  manifest.abi_unsupported — approved, not runnable here — never in
  unapproved();
- the re-read admits the bytes, so the version in force is found and the
  update is GRADED against it by assess_auto_apply: same publisher, same
  id, strictly newer. The old "unreadable current -> ask without grading"
  branch is gone; bytes the store cannot read at all are a refusal.

Tests: requires_host_gate (install door refuses and the re-read admits;
activation lands in refused(), the digest stays the version in force),
plugin_update_package_cli (the repro: approved 0.1.0 with >=999.0.0,
catalog 0.2.0, update applies; control: a second publisher is still
refused). Mutations run, all RED: check back in parse (repro + both gate
tests), host_range_gate -> Ok, prepare_claims check deleted, verdict
replaced by an empty Refused (the control).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
package-release.yml's two jobs run jq (require_ci_green.sh,
package_publish.sh, package_channel.sh, and the inline catalog checks)
and installed nothing. Both now carry ci.yml's `Install jq` step (a
no-op when present).

The image question is contested on record, and the report says so:
re-probing the local ci-rust:1.94.0-v7 (27535d140e28) finds /usr/bin/jq,
as release_gate's IMAGE_BASELINES probe recorded, while ci.yml's comment
says the image does not ship it. Installing is right under both.

release_gate::every_job_that_runs_jq_installs_it_first walks every step
of every workflow with the scripts it reaches and requires an install in
the same job, no later than the first step that runs jq. Mutation run:
delete package-release's ci-gate `Install jq` step — RED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
install.sh and install.ps1 defaulted to `/releases/latest`, which Forgejo
answers with the newest non-draft, non-prerelease release — after a
package release, `pkg/<id>/v<version>` or `pkg-channel`. Two fixes, each
enough alone:

- package_publish.sh creates every release it makes as `prerelease:
  true`, so none can be "latest";
- both installers read the release LIST and select the highest
  vMAJOR.MINOR.PATCH (not draft, not prerelease) — install.sh's
  select_core_tag (POSIX sort, no jq), install.ps1's Select-CoreTag
  ([version] comparison). Each has a test hook
  (`--select-core-tag <file>`, `-SelectCoreTagFrom <file>`) that runs the
  selection without the network.

Tests: installer_e2e and installer_ps1_e2e (run through the PowerShell
container) select v0.10.0 out of pkg-channel, a pkg/ tag, v0.9.0, an -rc
and a draft; package_release_scripts requires `"prerelease":true` in the
DRY_RUN creation body. Mutations run, all RED: prerelease:false; sh
`head -n 1` instead of the numeric sort; sh pattern loosened to any tag;
ps1 version comparison dropped. ps1 suite 31/31 via docker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Review findings MEDIUM-2 and LOW (v1 projection) on #309.

- `newest_compatible` never selects a prerelease; the `latest_version`
  shortcut applies only when that version is stable. A prerelease is
  installed only when pinned explicitly.
- One order for every consumer: `code_index_core::registry::newest_key`
  breaks precedence ties by the key string, and `validate`, `project_v1`,
  selection and the indexer's catalog merge all use it, so a merge can
  never write a `latest_version` the validator refuses.
- `+build` is refused in manifest versions, v2 catalog keys
  (`validate` and schema.v2.json's propertyNames) and package tags:
  build metadata orders equal to the version without it, so two
  artifacts could claim one version.
- v2 versions carry their own `claims` and `name`; `project_v1` gives
  the plugin entry those of the version an older host will install and
  strips them from every version entry (v1 refuses them).

Mutations run, each RED: drop the prerelease filter; drop the tie-break;
keep p.name / p.claims in the projection (two); disable the `+` refusal
in validate (core test and schema-agreement row), in the manifest, in
package_tag.sh and in schema.v2.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Review decision: `PACKAGE_OWNS_UNDER_AUTO` must not change what a
THIRD-PARTY `[[displaces]]` package does. Before this lane such a package
owned its language under `auto` when approved and healthy, and it does
again.

ONE per-package fact, `languages::holds_reserved_language(claims)`: the
package claims a reserved plain id, which only a first-party anchor may
publish. It is computed from the claims both doors already hold — the
live set (`PackageSet::finish_activation`, `PackageSet::displacing`) and
the planned activation (`approval::approved_activation_with_ids`) — so
the router, the dirty domain and a `plugin enable` preview cannot
disagree. A builtin-equivalent package claims only profile-adopting ids,
which are reserved, so it is always covered.
`package_may_own(lang, first_party)` / `filter_displaced(.., first_party)`;
`owner_rows` takes `Displacer = (lang, package, first_party)`, and only a
first-party displacer is reported `package_shadow`.

REVERTED to base, and passing unchanged: builtin_displacement_routing.rs
(OPT_IN, live_with, and my third-party "shadow" test, which graded the
wrong rule) and builtin_displacement_e2e.rs.

Tests and mutations (RUN):
* languages::tests::the_owner_rule_is_a_truth_table (first- and
  third-party arms) and owner_rows_name_the_reason (a third-party `rust`
  displacer owns under `auto`).
  MUTATION apply the switch to every package -> RED: both unit tests,
  builtin_displacement_routing 6 of 9, builtin_displacement_e2e 1 of 2.
  MUTATION drop the first-party switch clause -> RED:
  bundled_language_e2e (the bundled Ruby package owns `.rb`).
Green: languages:: 8, builtin_displacement_routing 9,
builtin_displacement_e2e 2, bundled_language_e2e 2, language_owner_e2e 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Review finding (MEDIUM): texts still said `enabled` picks the owner under
`auto` / "the package if enabled and healthy", contradicting
`package_shadow`. Reworded to "under `auto` the builtin owns the language
in this release (package_shadow); `owner <lang> package` opts in":
* `code-index init`'s template (crates/cli/src/main.rs), including the
  per-key `auto` comment;
* the `languages list` note (crates/cli/src/languages.rs);
* README's Languages section (and the owner-setting bullet: the shadow
  rule is the first-party one; a third-party displacing package keeps
  "the package when enabled and healthy");
* crates/indexer/src/languages.rs module and `LanguagesConfig` docs;
* crates/indexer/src/config.rs's `languages.enabled` paragraph;
* the `plugin add` confirmation's owner sentence (confirm.rs).

Test: languages_cli::init_enables_exactly_the_languages_it_finds_and_says_so
now asserts the template and the `languages list` note.
MUTATION (RUN) restore the template's old `auto` comment -> RED.
MUTATION (RUN) restore the old list note -> RED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Review findings (LOW):
* When bundled packages exist but were refused, `languages enable` said
  "none beside this binary". It now says "none offered — N bundled
  package(s) refused — see `code-index languages list`".
  bundled_language_e2e::a_bundled_package_that_does_not_verify_is_refused_not_offered
  asserts the new text. MUTATION (RUN) always print "none beside this
  binary" -> RED.
* bundled_scan::a_trusted_third_party_key_may_not_bundle_a_reserved_language:
  a key the operator trusts but did not anchor first party signs a
  bundled `ruby` package; it is REFUSED with `language_reserved`, never
  offered. MUTATION (RUN) delete `reserved_language_gate` from
  `bundled::verify` -> RED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Review finding (LOW): `grammar_cache_for` now keys every lane as
`<host key>-<grammar key>`, so the default grammar's old directory
`<digest>/<host key>` was kept by GC for as long as this build lived (its
key equals the current build's). It is now collected at once: an entry
with no `-` whose name IS the current host key is this build's old
layout, which this build never reads again. An old-layout entry of
ANOTHER build may still be that build's live cache and keeps the
ordinary age rule.

Test: cache_gc::stale_cache_entries_are_collected_and_live_ones_are_kept
plants a fresh `<digest>/<current host key>` in both caches.
MUTATION (RUN) disable the old-layout arm -> RED ("this build's
old-layout entry survived"). cache_gc, grammar_cache, extractor_cache
green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Review finding (MEDIUM-LOW, data-loss hazard): replacing the bundle
renames the old `code-index-packages` aside and deletes it recursively;
through a junction or symlink that delete reaches what the link points at.

* install.ps1 refuses, BEFORE anything is committed, a bundle destination
  with the ReparsePoint attribute, and deletes the aside copy only when it
  is not a reparse point.
* install.sh refuses, before anything is committed, a destination (or its
  aside name) that is a symlink.
* Both: the `mv` / `Move-Item` to the aside copy is checked (`|| die` in
  install.sh), and if moving the new bundle in fails the previous one is
  moved back and the message says so. That restore is UNGRADED, stated in
  both scripts: no test can make a same-directory rename fail after the
  one before it succeeded.

Tests (MUTATIONS RUN):
* installer_e2e::a_symlinked_bundle_destination_is_refused_and_nothing_is_installed
  — the link's target survives and no binary is installed.
  Drop the destination-symlink check -> RED.
* installer_ps1_e2e::a_reparse_point_bundle_destination_is_refused_and_its_target_survives
  (pwsh container) — drop the reparse-point check -> RED.
installer_e2e 27 passed; installer_ps1_e2e 33 passed (all, incl. ignored).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 review MEDIUM-3, the client half. The package channel's assets are
replaced by delete-then-upload, and a client's two GETs (catalog, then
`<url>.sig`) can straddle a republish: new bytes, old signature, a
refusal that reads as tampering. No order of the publisher's requests
closes a race between the client's.

`load_url_catalog` now asks for `content_signature_url_for(url, bytes)` =
`<url>.<sha256 of the bytes it holds>.sig` first, and falls back to
`<url>.sig` only when the server answers 404/410 (every core release's
catalog, and mirrors). The publisher uploads that name - only ever added,
never replaced - before it replaces the catalog, so every catalog a
client can fetch has its signature under a name nothing moves.

Test: plugin_registry_e2e
a_fetch_that_straddles_a_channel_republish_reads_the_content_addressed_signature
stages the mid-republish state (new catalog, stale `.sig`) and verifies;
the control on the same server, content-addressed name removed, is
refused as signature_invalid.

Mutation run: fetch a name the server never has instead of the
content-addressed one - RED. (Renaming inside content_signature_url_for
SURVIVES this test by construction - it stages the server with the same
function - and is RED in package_release_scripts' channel-publish test,
which holds publisher and client to one name.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 review MEDIUM-1, MEDIUM-3 (publisher half), LOW key scope, LOW seeding.

- package-release.yml: channel signing moved out of the job that ran
  package_verify.sh into a fresh `channel` job. It checks the commit out
  again, fetches the same core release again (package_core.sh, the
  former inline step, now shared) and receives only the packed artifact,
  its digest and six named facts (channel-input artifact; unexpected
  lines refused).
- release_gate::no_key_holding_step_runs_after_package_code_in_its_job
  grades the ORDER in every job of both workflows; `key_holding` is now
  the one predicate both containment gates use. Key-site floors re-
  measured exactly: 5 sites, 6 holding steps.
- package_publish.sh `channel`: publishes each catalog's
  `<name>.<sha256>.sig` (immutable) BEFORE replacing the catalogs.
- package_channel_check.sh: the channel must list every version of the
  channel it was built from, at the same digest, plus the released
  version. Run by package_channel.sh on what it built and by the
  post-publish re-read on what the host serves.
- `concurrency: group: pkg-channel, cancel-in-progress: false` on the
  channel job and the seed job. Forgejo support for queueing is
  UNVERIFIED (ci-windows.yml's cancelling group is the only one this
  repo has run); the re-read check is what holds if it is ignored.
- release.yml `package-channel-seed`: after a stable core release
  publishes, folds that release's own catalog into the channel
  (package_channel.sh with `-` for the package). Prereleases skip.
- package_channel.sh refuses a package given `-` URLs (found by the new
  seed test).
- tests/packages/README.md documents each script's interface, key
  holding and package execution, for another job to call.

Mutations run, each RED: swap the channel publish steps; misname the
content-addressed copy; rename in content_signature_url_for (RED in the
script test); skip the base loop in package_channel_check.sh; drop the
archive hash comparison in package_core.sh; move the channel job's steps
back into the package job; sign after the install path in release.yml's
package-plugin; drop the key from the seed step; drop the `-` URL
refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Review finding (LOW): since the bundle is added by `Create Forgejo
Release`, `windows-archive-smoke` executes build-windows' zip BEFORE the
bundled packages are in it. The binaries it runs are the published ones;
the zip it hashes is not. Three texts said otherwise and now say this:
the build-windows header, the smoke's "THE BYTES WE GRADE ARE THE BYTES
WE PUBLISH" comment, and the release audit's SMOKED line. The smoke job
carries the precise TODO: "TODO(#309, integration): the Windows smoke
must run on the FINAL archive, with code-index-packages/ in it" — the
coordinator reorders the jobs at integration with lane V's release.yml.

Test: crates/indexer/tests/bundle_release_gate.rs (MUTATIONS RUN):
* the placement step runs after the download and BEFORE the installer and
  catalog staging, and `release` needs `bundle-first-party`;
  move it after `Stage distribution registry` -> RED.
* the smoke job carries the TODO; drop it -> RED. The audit line is not
  the bare "(windows-archive-smoke: success)"; restore it -> RED.
release_gate 36, ci_cadence 9 green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Review finding (LOW): my m0074 commit blessed this record from a run at
load 7-9, which moved the wall-ratio ceiling 134 -> 140 on a CONTENDED
reading (CLAUDE.md: compare isolated against isolated, never contended).
The coordinator asked for the ratio back at 134 with only the schema
condition changed, through the documented path — or a report if the
tool cannot do that.

IT CANNOT. `COSI_RUBY_PKG_COST_BLESS=1` (`render_baseline`) writes the
run's own vm_step, fullscan, sort, autoindex AND wall ratio; there is no
conditions-only bless for this record (package_baseline has one, this
does not). Hand-editing `schema` would not be the documented path. And
the box is still contended (load 7-10 on 12 cores), so an isolated
re-measure is not available in this lane either.

So the record is restored byte-for-byte to 4ecf930 (schema 73, ratio
134), and `ruby_package_cost::the_package_leg_cost_stays_within_the_blessed_band`
now REFUSES, by design, with "schema: the band was measured under 73 and
this binary is schema 74" — the condition check doing its job. It needs
an ISOLATED re-measure under schema 74 (or a conditions-only bless mode
added to this suite) before merge. The SQLite numbers I measured at 74
(vm_step 30075681..30086094 against the record's 30086175) are in the
m0074 commit message as evidence that m0074 moves no work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 re-review #1 and #6.

#1 - the HIGH-1 shape had come back for +build: the refusal sat in
manifest `semver()`, which runs inside StoredPackage::parse, so an
approved `0.1.0+b1` became unreadable (archive_refused, unapproved())
and `plugin update` could not replace it. Now:
- `semver()` parses +build;
- `Manifest::check_installable_version` refuses it;
- `approval::install_gate` (was host_range_gate) applies both install
  rules - +build and requires_host - and is called by Store::install,
  `plugin add` and update's fetched candidate. It is the function a
  bundled-package scan should call before OFFERING a package;
- `approval::host_range_gate` stays as the host-range half alone.
Catalog and tag refusals are unchanged.

#6 - `plugin update` with a version in force OUTSIDE its requires_host
and nothing newer in range printed "up to date". It now exits non-zero
with `update_stranded`, naming the range, this host, the newest in-range
version and the remedy, and changes nothing.

Tests: plugin_update_package_cli
an_approved_build_metadata_version_stays_readable_and_is_replaced (with
the plugin-add control) and
a_version_in_force_outside_its_range_is_never_up_to_date;
requires_host_gate build_metadata_is_refused_at_install_and_admitted_at_the_re_read;
manifest_schema build_metadata_parses_and_is_refused_only_by_the_install_check.

Mutations run, each RED: `+` refused in semver again (indexer test at the
re-read; the CLI test at `plugin pack`, recorded as not isolating);
check_installable_version dropped from install_gate (CLI control and
indexer test); check_installable_version always Ok (manifest_schema);
`stranded` forced None (update test).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 re-review #2. A and B both merge from X; A publishes X+a; B
publishes X+b. X+b holds every version of X, so B's post-publish re-read
is green and `a` is gone - the base check cannot see it.

`package_publish.sh channel` now takes <base|-> (the channel this run
merged from) and, after the immutable content-addressed signatures and
immediately before replacing any catalog, re-reads the channel the host
serves NOW and requires its sha256 to equal the base's (`-`: there must
still be none). A difference refuses with nothing replaced; a re-run
merges from the channel as it stands. Both channel writers
(package-release.yml `channel`, release.yml `package-channel-seed`) pass
their CHANNEL_BASE.

Residual, documented in the script: the moment between that read and the
replace. The `pkg-channel` concurrency group and the re-read are the
backstops; Forgejo has no conditional asset upload.

Test: package_release_scripts
a_publish_whose_base_moved_is_refused_before_it_replaces_anything stages
the interleaving on a fake host: package_channel_check.sh passes X+b
against X (the gap), the publish refuses before any DELETE or catalog
upload, `-` is refused once a channel exists, and the control re-merged
from X+a publishes.

Mutation run: compare only when the channel is absent - RED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 re-review #3. `Publish the package release` held SNOTR_FORGEJO_TOKEN
after `package_verify.sh` had executed the package in the same
workspace - a token that can push `pkg/**` tags, which run `channel`
with the key on a commit of the pusher's choosing. And `channel-input`,
written after package code ran, was trusted for bytes and URLs.

package-release.yml is now four jobs:
- `package`: checkout with `persist-credentials: false`, core fetch
  (token) and signing (key) BEFORE the install path and negative
  controls; afterwards it holds no secret and uploads only the `.cips`;
- `publish` (new, runs no package code): re-packs from its own checkout
  and admits the signature with the new package_admit.sh - re-pack held
  to the recorded digest, any untrusted .cip must be byte-identical,
  the .cips verified by `plugin install --sha256` against the shipped
  anchors - then publishes;
- `channel`: no artifact at all. It downloads what `publish` published,
  admits it the same way, and takes CIP_URL/CIPS_URL from the host's own
  listing (`package_publish.sh urls`, new);
- release.yml `package-plugin` also checks out with
  `persist-credentials: false` (it executes packages after its checkout).

The step-order gate is now
release_gate::no_secret_holding_step_runs_after_package_code_in_its_job:
the publisher key OR the Forgejo token, and a checkout that persists the
token counts as holding it for the rest of the job. Package execution is
now an INVOCATION (`invoked_package_verb`: the shipped binary in command
position, heredoc bodies stripped) - the substring match the key gate
uses read release.yml's README heredoc and release-notes strings as
execution. Floors set at the measurement: 36 secret-holding steps (30
token), 4 executing.

Mutations run, each RED: skip package_admit.sh's cmp; ignore its
`plugin install` result; compose the `urls` answer from a template;
delete the `publish:`/`channel:` job headers (steps fall into
`package`); give `Upload the signature` the token; drop
persist-credentials: false in `package` and in release.yml's
`package-plugin`; sign after the install path in `package-plugin`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 re-review #4. Both installers read ONE page of `releases?limit=50`;
the server caps a page at 50 and package releases are releases too.

- Both now ask for `releases?limit=50&page=N&draft=false&pre-release=false`
  (every package release and the channel are prereleases) and walk pages
  until one holds a core tag; an empty page ends the list with a refusal
  naming the API and `--tag` / `-Tag`. Bounded at 20 pages.
- install.sh's `select_core_tag` honours `draft` and `prerelease` as
  install.ps1's `Select-CoreTag` does: without jq, each release's flags
  are the ones that follow its `tag_name` (Forgejo's field order).
- Test hooks: install.sh `--latest-tag <api>`; install.ps1
  `-LatestTagFromPages <dir>` (page N from a file, every URI printed - the
  container cannot reach a loopback server). install.ps1's walk is
  `Get-CoreTagPaged`, which `Get-LatestTag` drives with Invoke-RestMethod.

Tests: installer_e2e the_latest_tag_walks_the_filtered_release_pages
(loopback server answering ONLY the filtered URLs; page 1 is 50 package
prereleases, page 2 the core tags; then an empty page 2 refuses), and the
select test now carries flagged v0.12.0/v0.13.0; installer_ps1_e2e
the_latest_tag_walks_the_filtered_release_pages (docker).

Mutations run, each RED: install.sh flags ignored; one page only; filter
dropped from the URL; install.ps1 one page only; filter dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The previous commit put an em dash in a comment of install.ps1, which
installer_ps1_e2e::the_script_carries_no_byte_windows_powershell_would_misdecode
refuses (Windows PowerShell 5.1 reads a BOM-less script as ANSI). Caught
by the full ignored suite run after the commit; replaced with `--`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 re-review #5. A signature says who wrote a catalog, not when; an old
signed channel replayed by a mirror, proxy or stale cache verifies and
would freeze updates or un-withdraw a version.

- Both catalog doors (URL and path) now call `freshness_gate` after
  verifying and validating: the operator store keeps
  `catalog-freshness.json`, the newest `generated_at_epoch_seconds`
  accepted per source (URL or path as given); an OLDER stamp from the same
  source is refused with both stamps named, an equal one passes, a newer
  one moves the mark. Unstamped (unmeasured) catalogs cannot be ranked
  and pass; writing the mark is best-effort. Stated in the doc.
- The channel needed a stamp that moves: it inherited the core release's
  `generated_at`, so two channels within one core release ranked equal.
  `plugin catalog-merge --generated-at <epoch>` (build_channel's new
  argument) moves a MEASURED channel's stamp forward, never back, and
  leaves an unmeasured one unstamped; package_channel.sh passes
  `date +%s` (CHANNEL_GENERATED_AT pins it).

Tests: plugin_registry_e2e
a_replayed_older_catalog_from_the_same_source_is_refused (genuinely
signed documents; controls: first contact, equal, newer, the old stamp
from another source; the mark moves); registry lib
the_channel_stamp_moves_forward_on_a_measured_channel_only.

Mutations run, each RED: delete the gate call from load_url_catalog;
delete the stamping in build_channel. The path door's call is the same
line and is not separately mutation-graded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
A promotion used to restamp every row of the outgoing projection with the
incoming generation's id, in four tables, under the writer lock: 15-19 s
on a 100k-file index even when nothing had been re-extracted.

The live projection's rows now carry `contributions::LIVE` (0) instead of
the active generation's id; rows exclusive to a pending or superseded
generation keep their own id. A switch WITHDRAWS the live rows of the
queue's re-extracted files into the outgoing id and ADMITS the incoming
id's rows into LIVE; rollback is the same transaction with the two
generations swapped. Every unchanged row is untouched.

m0075 (`Up::Rebuild`, so it runs with foreign_keys=OFF outside the
transaction, the parent-rebuild cascade hazard) rebuilds
`file_contributions` without the generation FK, relabels active-id rows
to 0 in the four labelled tables, and installs triggers that replace the
FK (existence on insert/update, cascade on plugin_generations delete, and
guards that keep id 0 out of plugin_generations), then rebuilds the
m0060/m0061 rollups and grades itself.

Every reader renders the live label instead of joining on the active
id: generation_row_predicate, admit_select, PoolAdmit, influence's
admit gates, the snapshot producer subquery, and the daemon's ReadEpoch,
which now gates contribution reads too. `live_label` answers the active
id while the FK still exists, so migrations that re-heal below v75 keep
their old meaning. The edge rebuild and ref-count recount use the
index-eligible form (no unary `+`): with it, corpus_cost's fullscan_step
rose 12-17% on every pinned repo, attributed to those two statements.
Without it the run is back inside its band; nothing was blessed.

Tests: a registry test over every production SQL statement that fails if
a read path names the active generation's id instead of the live label;
a rollback inside the switch's transaction moves no row; a reader that
straddles a promotion reads one projection; the rollups move only the
withdrawn buckets; m0075 keeps every exclusive row, is idempotent, and
refuses to run with foreign keys on. Fixtures that labelled live rows
with the active id now use the live label.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
With the live label the lock no longer scales with the projection, so
the one-term "9,000 ns per generation row" estimate overstated an empty
switch by more than two orders of magnitude. The estimate is now MEASURED_LOCK_FIXED_NS (75 ms,
which covers the two reads still proportional to the index: the
symbol_edges to_id scan and the carried COUNT) plus
MEASURED_LOCK_NS_PER_GENERATION_ROW (20,000 ns) per moved row.
`generation_rows` is documented as an upper bound on the rows a switch
moves, and the confirm disclosure says "AT MOST".

bench_promotion_lock asserts the two-term ceiling on all four switches
(promote and rollback, empty queue and 1% dirty). Isolated pair, 100k
files: an empty promotion went from 19,083 ms to 42.0 ms, and a 1% dirty
one (23,977 rows) from 16,917 ms to 379.1 ms.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The record holds the design, the isolated bench_promotion_lock pairs with
a per-statement attribution of the lock, the mutations run against each
new test, the cost-ratchet attribution and its fix, pass counts, what is
deferred, and the questions the code-index tools could not answer.

package-baseline.json was re-measured under schema 75. The outcome was
conditions_only: every measured number is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
An independent review reproduced two high-severity defects in the first
cut, where the one-shot server stayed behind to finish the reconcile
itself:
- Its stderr was a pipe owned by the CLI. After the CLI exited, the
  first log line hit EPIPE, and the finisher died with its reconcile.
- The 10 s wait applied per call, so batches overran the CLI's 60 s and
  the hook's 20 s.

Redesigned onto the existing daemon:
- A one-shot process waits ONCE (a shared deadline,
  `tool_wait_deadline`). Every later call and batch entry waits only
  until the same instant.
- The slot is re-checked before a `warming_up` refusal.
- When the wait runs out with work pending and `--start-daemon-to-finish`
  was given, the server starts the code-index daemon through the shared
  recipe `lifecycle::daemon_command` (detached, null stdio, own log,
  daemon.lock, idle exit). `attach_or_spawn_daemon` now uses the same
  recipe.
- A daemon already registered is reported, not started again. The pid
  reported is the one the registration names.
- The reply carries `reconcile_pending.started_daemon {pid,
  started_by_this_call, log}`, and `converges_on_retry` is true exactly
  then.
- Without the flag, or for a `--db` other than the project's own, no
  daemon is started and the reply stays `false` with the remedy.

Deleted:
- the reconcile lock (`try_reconcile_lock`, `reconcile_lock_path`);
- the `ReconcileState` phases;
- `finish_one_shot` and the daemon-yield poll;
- the stay-behind and undisclosed-exit logic;
- the `Finisher` wire type;
- `oneshot_reconcile_e2e.rs` and the harness's `hang_up_and_wait`.

`keep_std_handles_from_children` stays, called inside `daemon_command`.
On Windows a daemon would otherwise inherit its spawner's client pipes.

Tests (mutations run, each RED):
- `oneshot_daemon_e2e` (new):
  - an explicit no-daemon one-shot never starts one (starter installed
    regardless of the flag);
  - with the flag it starts and names the daemon (`converges_on_retry`
    false constant).
- `reconcile_pending_is_for_a_one_shot_process_no_daemon_serves`:
  - `converges_on_retry` true constant;
  - `started_daemon` always `None`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`code-index query` passes `--start-daemon-to-finish` unless run with the
new `--no-daemon`. It clears its own std handles before spawning, so on
Windows the daemon the server may start cannot inherit the caller's
pipes. The first cut's stderr forwarding and stay-behind hang-up are
gone: the CLI kills its server after the reply, as in v0.32.1. The note
on stderr names the daemon, or the remedy when none was started.

query_cli (mutations run, each RED):
- a_one_shot_query_mid_upgrade_converges_on_retry: start flag never
  passed; count `mtime_ns = -2`.
- a_one_shot_query_on_a_first_index_omits_the_upgrade_count: awaiting
  filter dropped.
- two_one_shot_queries_at_once_start_one_daemon: daemon registration
  never consulted.
- query_no_daemon_never_starts_one: opt-out ignored.
- a_batched_call_stays_within_the_hook_budget: a full wait for every
  call (the batch took 41.7 s).
- a_warn_after_the_caller_exits_cannot_kill_the_work: the daemon's stderr
  inherited (its fd 2 became the caller's stream).
- the_cli_log_level_reaches_the_spawned_server: zero wait; ignore --log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The record now covers:
- the measurements behind the choice;
- the rejected first cut and why the review rejected it;
- what ships and what was deleted;
- the concurrency cases;
- django before and after: never converged in 151 s, versus answered on
  call 2 at +12 s through the started daemon;
- the full mutation table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Field outage, two Windows 11 users on 0.32.2: one elevated run left
index.db, -wal and -shm owned by BUILTIN\Administrators carrying only
"OWNER RIGHTS FullControl" and "SYSTEM FullControl", and every later
non-elevated daemon start died with SQLITE_CANTOPEN.

That DACL is ours. `restrict_to_owner` applied D:P(A;;FA;;;OW)(A;;FA;;;SY)
to the index, its sidecars and daemon.toml, on the reading that the owner
is the creating user. An elevated administrator's files are owned by the
Administrators group, so OW granted that group and the protected DACL
withheld everything from the user, whose non-elevated token holds
Administrators as deny-only.

The DACL now also grants the token user's SID, which is the same account
elevated or not. Still protected, still owner-only in intent, so the
confidentiality hardening stays; and because db::open re-applies it on
every open, one elevated run of this build repairs an index the old one
locked.

Windows-only tests (CI-verified): an explicit full-access entry for the
current user's SID on a restricted file, and on index.db plus its live
WAL sidecars created through db::open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
On v0.32 a Windows index this user could not open killed every daemon
start with `unable to open database file` (SQLITE_CANTOPEN), and every
tool answered `warming_up` with "Retries continue in the background",
so agents waited on an outage that never ended.

`perms::index_access_denied` asks SQLite first (open read-write without
create, `BEGIN IMMEDIATE; ROLLBACK`; BUSY counts as accessible) and only
when SQLite fails opens index.db, -wal and -shm raw to learn which one
refused; only PermissionDenied counts. The order matters: closing any
raw descriptor drops every POSIX lock the process holds on the file,
SQLite's included — a first cut that probed raw up front corrupted
in-process writers ("file is not a database", a SIGBUS'd daemon) in
live_activation_e2e, store_repair_e2e, language_owner_e2e and
plugin_add_mcp_e2e. Its Display is the one sentence every surface
prints: the code, the path, the owner (`uid N`; `DOMAIN\name` on Windows
when READ_CONTROL allows), PERMANENT, and the exact repair (`icacls
<dir> /reset /T` from an elevated prompt, or chown/chmod on Unix, or
renaming .code-index).

- db::open maps a FAILED open to IndexerError::AccessDenied, so the
  daemon's fatal line and daemon.exit carry the named cause.
- Both MCP legs refuse `index_unavailable_permission` at routing, for a
  slot that is not ready, beside the schema-skew refusal, with a
  structured `index_unavailable` block (converges_on_retry: false).
- `code-index query` prints the sentence on stderr; `doctor` names it in
  `database` and `index freshness`, and no longer PANICS on an index it
  cannot open (`check_parse_errors_ratio` unwrapped the open).

Tests: unix chmod 000 on both MCP legs (refusal, timing, daemon.exit),
the query CLI, doctor, db::open and a locked -shm through the probe, and
a healthy index held by this process is not denied; a Windows
DACL-staged e2e (CI-verified) that also runs the prescribed icacls
repair. Root cannot be refused by a mode, so root runs (Linux CI) use
the debug-only CODE_INDEX_TEST_DENY_INDEX_ACCESS seam instead of
skipping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
On 0.32.2 a daemon that died at every start (an index the user could not
open) was respawned about every 1.4 s for hours: the MCP server's attach,
its rediscovery loop and every call's respawn each started another,
because nothing remembered that the last one had died, and of what. Each
start also repeated the same two config WARNs, 1,126 times in four hours.

daemon.exit now counts: a record with the same cause as the one it
replaces continues the streak (`repeat`), any other cause starts at 1,
and a daemon that serves sets it to 0 (`note_started`). Both spawn
decisions — `attach_or_spawn_daemon` and `respawn_and_connect` — consult
`restart::startup_backoff` first: after the same startup failure twice,
no spawn for 10 s, doubling to 300 s, and the call answers at once with
the recorded cause instead. Because the record is the root's, the
backoff holds across every client process, not only within one. An
`index_unavailable_permission` streak is re-probed rather than waited
out, so a repaired ACL takes effect immediately.

A daemon started after a failed start loads its config with its
narration suppressed: the previous start already logged those WARNs to
the same daemon.log. The first start after a served one warns again.

Tests: unit tests for the streak and the backoff curve; the respawn path
refusing inside the backoff without spawning; a daemon that serves ends
the streak and stays quiet about config after a failure (control: warns
again after a served start); and end to end, two real fatal starts then
an MCP server that answers every call at once and starts no daemon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 re-review round 3, #1 (reproduced by the reviewer). build_channel
took the include's (newer core release's) `generated_at` along with its
`code_index`, then applied "never backwards" against THAT instead of the
base: base 5000, include 1000, `--generated-at 2000` gave 2000 - a channel
that moved backwards, which the client's freshness check would then
refuse against its own previous copy.

The stamp is now max(base, every include, --generated-at), on a measured
channel only. The repro is a case in
the_channel_stamp_moves_forward_on_a_measured_channel_only.

Mutation run: stamp from `out` only (the shipped shape) - RED on the
repro.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 re-review round 3, #2. Three paths offered a package through
`StoredPackage::parse` alone - which must admit `+build` and an
out-of-range `requires_host`, because it is also the re-read of approved
bytes - and showed a candidate the install would then refuse:

- `plugin update`'s registry arm (`update_one`): the row is now
  `unreachable`, naming the install refusal, and notifies nothing;
- MCP `plugin_add`, `file` selector and `package` selector: the install
  door's refusal (`archive_refused`) before any confirmation is rendered.

Tests: plugin_update_cli a_candidate_the_install_door_refuses_is_not_offered
(0.1.1+b1); plugin_add_mcp_e2e
a_package_the_install_door_refuses_is_never_previewed_over_mcp (+build,
file arm); plugin_add_package_fetch_e2e
a_catalogued_package_outside_the_host_range_is_never_previewed (bytes
declaring >=999.0.0 under a v1 row that cannot say so).

Mutations run, each RED: the gate replaced by Ok(()) in update_one, in
the MCP file arm, and in the MCP package arm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 re-review round 3, #3 and #4.

#3 - the freshness mark was a read-modify-write of one JSON file, so two
loads racing on a source could put back the smaller mark, and a corrupt
file reset every source silently. Now `catalog-freshness/<sha256 of the
source>/<stamp>`: recording CREATES a file and prunes only strictly
smaller names, so a concurrent writer's larger mark always survives, with
no lock. An entry that is not a stamp (or an unreadable directory) is
ignored with a `tracing` warning saying the mark was RESET to what
remains - failing open, documented at `read_freshness_mark`: a damaged
mark that refused would turn a broken cache file into a machine that can
never update, and the remedy is the state failing open reaches anyway.
`CATALOG_FRESHNESS_FILE` (never released) is replaced by
`CATALOG_FRESHNESS_DIR`.

#4 - package_publish.sh now states the interleaving the compare-and-swap
does not close (B reads, A replaces, A re-reads, B replaces: every check
green, `a` lost), that only the `pkg-channel` concurrency group closes
it, and that this is unverified until a dispatch shows it.

Tests: registry lib freshness_marks_survive_a_race_and_a_damaged_entry
(the losing interleaving staged in order; a stray entry); the existing
replay e2e still passes; package_release_scripts
the_publish_script_states_what_its_compare_and_swap_cannot_close.

Mutations run, each RED: a single-file mark (remove the source's
directory before writing) - the mark becomes 2000; drop the reset
warning; delete the CAS paragraph from package_publish.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
# Conflicts:
#	.forgejo/workflows/release.yml
`bundled::verify` checked a bundled package only through
`StoredPackage::parse`, the re-read that deliberately admits an
out-of-range `requires_host` and a `+build` version. So `languages list`
OFFERED a package that `languages enable` (the `plugin add` door) then
refused. The scan now calls `approval::install_gate` in
`Store::install`'s order, right after the parse, and lists such a
package as refused with the door's own `archive_refused` witness.

Test: `a_bundled_package_the_install_door_refuses_is_refused_not_offered`
(both arms, each with an offered twin). Mutation run: delete the call,
RED (the out-of-range package is offered).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
79ba0f7 did not compile: lane V gave `cmd_add` a ninth parameter
(`offer`, whether to print the `[update]` stanza) and lane U's
`add_bundled` still called it with eight. A bundled adoption passes
`false`: a bundled file has no source URL for the stanza, and which
version runs afterwards is `plugin update`'s question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
#309 integration. `release` used to add `code-index-packages/` to every
archive and rewrite its `.sha256` AFTER `windows-archive-smoke` had run
on `build-windows`' zip, so the smoke ran the published binaries but not
the published zip, and the bundled path was never exercised natively.

Now `assemble-archives` (was `bundle-first-party`) is the one job that
writes the final archives: it holds each build leg's archive to that
leg's sidecar, ADDS the signed `.cip`/`.cips` from the `package-plugin`
ruby leg under `<name>/code-index-packages/`, re-derives the `.sha256`,
reads each result back, and uploads them as ONE artifact,
`release-archives`. `windows-archive-smoke` downloads that artifact,
holds the zip to its sidecar, requires the bundle in its entry names,
smokes and installs it, and asks the installed `code-index languages
list` to offer the bundled packages with none refused. `release`
downloads every artifact and `release_bundle.sh select` keeps
`release-archives` and deletes the build legs' copies, refusing a built
archive with no assembled counterpart, a sidecar mismatch, or an
assembled archive that is anything but its built archive plus the
bundle. The catalog, installers, audit and upload loop are unchanged and
see one file per name: the file the smoke ran.

`assemble-archives` runs under `success() || failure()` so the optional
`build-musl` cannot cost the release its other archives; the smoke's
`if:` names its two direct results instead of relying on `success()`
over transitive needs. The script appends to the zip with python3's
zipfile (the image ships python3, not zip; the tool gate grades it).

Gates: `bundle_release_gate.rs` rewritten — the smoke downloads the
artifact the assembly uploads and the release keeps; placement happens
only in the job the smoke and the release wait for; selection precedes
the installer/catalog stages; no integration TODO survives; and the
script executed over fixture `.tar.gz`/`.zip` archives with each refusal
beside its twin. `release_gate`'s smoke-download assertion now names
`release-archives` and refuses `build-windows`' own upload.

Mutations run (all RED, restores md5-verified): smoke downloads the
build-windows upload; placement inside `release`; smoke without the
assembly in `needs`; selection after the registry stage; the old audit
line; script: built copies kept, unsigned package bundled, input sidecar
unchecked, unassembled archive accepted, assembled members unchecked;
script requiring `zip` (tool gate).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Review findings 1, 5, 6, 8 and 9 on the index_unavailable_permission work.

1. The debug-only CODE_INDEX_TEST_DENY_INDEX_ACCESS seam was read only by
   the probe, which db::open consults after SQLite FAILS. As root SQLite
   opens a mode-000 file, so a "simulated" daemon served normally: the
   backoff e2e hung past 600 s and the daemon leg never recorded the
   cause. db::open now refuses on the seam first, where a real refusal
   surfaces. COSI_TEST_AS_ROOT=1 makes the tests stage the root arm (seam
   only, no chmod) on a developer machine; both arms pass. The daemon
   starts in the backoff e2e are bounded, so a daemon that is not refused
   fails the test instead of hanging it. The doctor check moved to a
   binary e2e that asserts the refusal under the seam too.
5. A test now guards the SQLite-first order: connection A holds the WAL
   write lock, the probe runs in-process, and a CHILD process must still
   get SQLITE_BUSY. Raw-first, the child acquires the lock.
6. restrict_to_owner_grants_the_invoking_user_by_sid FAILS when run as
   SYSTEM instead of skipping its control.
8. EPERM (immutable/append-only) gets a chattr/chflags repair, not chown;
   a directory that will not let SQLite create -wal/-shm is named as the
   refusal; on Windows a refusal is re-probed once after 250 ms, so a
   delete-pending file is not called PERMANENT.
9. perms.rs and every Windows repair state that over-the-shoulder UAC (a
   different admin account) still locks out, and that icacls /reset /T
   repairs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Review findings 3, 4 and 7 on the startup backoff.

3. With `repeat: 6` and a malformed-index cause, deleting the database
   still answered "waits 160s more" — and the message promised that "a
   daemon that starts resets it" while the backoff prevented any start.
   A fatal record now stamps the database's identity (absent, or size,
   mtime and inode); `startup_backoff` releases as soon as it moved, and
   the refusal names the manual escape: delete `.code-index/daemon.exit`.
   `startup_backoff(root, db)` keeps its public signature.
4. A record stamped in the future (the clock went backwards) held the
   window for as long as the jump; `now < at` now counts as expired.
7. `daemon.exit` is replaced through a temp file and a rename, so a
   reader on another process never sees an empty or torn record — which
   read as "no record", i.e. "no backoff".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`respawn_and_connect` built its own spawn command without
`keep_std_handles_from_children`. It now uses the one spawn recipe.
A one-line swap, kept minimal because lane W adds `startup_backoff`
to the same function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Re-review MEDIUMs 2 and 3, and LOW 5c.

- A daemon registers (daemon.toml) before it opens the index, so
  "registered and alive" proved nothing: one dying in startup meant
  every query said `converges_on_retry: true` and started another.
  `started_daemon.serving` is now true only once the registration says
  `startup_phase == "serving"` (waited for at most 5 s), and
  `converges_on_retry` derives from it. A daemon not yet serving is
  named, not promised.
- `may_spawn_daemon(root)` is the one gate before a start. It returns
  true for now, with a TODO for lane W's `restart::startup_backoff`.
- Making `serving` reachable exposed the one-shot process's own resolve.
  It holds the write lock the daemon's startup waits on. The call that
  starts the daemon now cancels the in-process pass
  (`ProjectHandle::stop_in_process_reconcile`, the shutdown cancel,
  re-interrupted until the slot fills). Later calls and batch entries are
  answered from the daemon (`daemon_already_finishing`), not from the
  cancel's error.
- After the poll, a slot that FAILED during the wait gets the fast
  path's refusal, and the skew refusal is re-run. The starter runs only
  for an empty slot.
- On Unix the started daemon leads its own process group.

Tests (mutations run, each RED):
- a_daemon_that_never_serves_is_named_but_not_promised: registered
  counted as serving.
- a_one_shot_that_starts_the_daemon_stops_its_own_resolve: stop call
  dropped. Two earlier drafts of this test let the mutation survive;
  the test now fails as soon as the pass completes.
- a_one_shot_slot_that_fails_during_the_wait_is_refused_not_daemonized:
  failed slot treated as pending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Re-review MEDIUM 1, LOWs 5a and 6.

- An older code-index-mcp on PATH rejected `--start-daemon-to-finish`
  ("unexpected argument", rc 2) on every query. The flag now goes only
  to the server beside the CLI.
- A batch prints one reconcile note (`query::reconcile_pending_of`),
  and the note says when the daemon has not proved it serves.

Tests (mutations run, each RED):
- a_newer_cli_with_an_older_server_on_path_still_answers: flag passed
  regardless.
- a_batched_call_stays_within_the_hook_budget now asserts a serving
  `started_daemon` and exactly one note. Mutations: note read from the
  top level only; later entries not answered from the known daemon.
- a_warn_after_the_caller_exits_cannot_kill_the_work is behavioural on
  every platform: the caller's stderr must reach EOF once the CLI exits.
  Mutations: daemon inherits stderr; no own process group (Unix).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Records each MEDIUM and LOW, its test, its mutation, and what fixing
`serving` exposed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
After m0075 the active projection's rows carry LIVE, so a contribution
labelled with the active generation's id comes only from a writer that
predates the label: a v73 daemon inside schema_guard's window. No reader
would serve that row, so the file would be silently missing, and a later
rollback would resurrect it as the outgoing generation's "exclusive" row.
The existence triggers that stand in for the dropped foreign key now
refuse a label that names the active generation, on INSERT and on UPDATE
OF generation_id. The switch never trips them, because it flips the
states before it relabels.

The reviewer's upgrade check is now in the tree. strip_below_v75 turns a
migrated database holding a superseded, an active and a ready generation
back into the pre-m0075 shape, and reopening it runs m0075 for real. The
test then rolls back, rolls back again, promotes the ready generation and
rolls back once more. After each step it compares the projection with
its reference build and requires 0 duplicate live rows.

Two fixtures wrote the active id after m0075 and are now refused. The
m0059 test labels its post-upgrade row with live_label. reader_epoch_e2e
asserts the refusal, then plants its stale-label decoy beneath the
dropped trigger, so the readers are still graded on their own.

Mutations run: dropping the active-state clause from the INSERT trigger
and from the UPDATE trigger both turn the refusal test RED. An m0075 that
relabels every non-LIVE row is refused at open by the UNIQUE key, so that
mutation proves the table and not this test. Swapping the superseded and
ready labels turns the upgrade test RED on its own rollback comparison.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The reviewer got three spellings of the same read past the scanner:
g.state = '{}' (a format! of generations::ACTIVE), g.state = ?1 (the
active state bound as a parameter), and generation_id IN (SELECT id FROM
plugin_generations ...).

The rule is now DEFAULT-DENY. A label table's generation_id compared with
a plugin_generations id is a finding unless the literal names only
non-active states, either as a value ('building') or as an inline capture
of the constant ('{BUILDING}'). A state the literal does not name counts
as active, because the literal cannot prove otherwise. Both subquery
forms (= and IN) match, and an unspaced '=' is tokenised. A spliced state
predicate is graded on what its renderer actually renders
(generations::in_flight_predicate, evaluated), so a renderer that started
naming 'active' would turn every statement that splices it red.

Seven new anti-vacuity probes cover each bypass. A legal probe
('{SUPERSEDED}') keeps the escape hatch narrow. Each of the three bypasses
was injected into src/snapshot.rs as a production literal, and each run
was RED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
MEASURED_LOCK_FIXED_NS includes a scan of symbol_edges by to_id, and that
column has no index, so the term is the value at 100k files and grows
with the number of call edges. I took the simpler of the two fixes the
review offered. The disclosure now says the fixed term was measured at
100k files and grows with the index's call edges (symbol_edges), which
makes it a floor on a larger index, and the prediction drops "at most".
The constant's doc says the same and names the deferred to_id index.

plugin_activation_cli asserts "grows with" and `symbol_edges`. Mutation
run: dropping that phrase from confirm::lock_line turns it RED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Run without COSI_CORPUS_DIR, the instrument printed "nothing measured"
for all nine repos and exited 0, even with COSI_ATTRIBUTION_REPO naming a
repo. That reads exactly like a clean table. Every test in the binary is
#[ignore]d, so it only ever runs because someone asked for a table, and a
run with no corpus is a mistake rather than a mode. corpus_or_refuse now
panics, naming the missing variable and, when it is set, the filter that
asked for a repo. This refuses the unfiltered run as well, which is
stricter than the review asked.

The test a_selected_repo_without_a_corpus_refuses is #[ignore]d and
#[should_panic], as corpus_require_floor::every_test_is_ignored requires
of this binary. Mutation run: returning an empty path instead of
panicking turns it RED ("did not panic"). The real command
(COSI_ATTRIBUTION_REPO=python-flask, no corpus) now exits 101.

The cost_attribution command in CLAUDE.md now carries
COSI_CORPUS_DIR=$HOME/.cache/cosi-corpus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
contributions::live_label runs two statements: the foreign-key probe, and
the active id below m0075. write_upsert asked it once for every file. The
answer cannot change inside the batch's transaction, because only a
migration moves it and migrations run at open. commit_batch now asks once,
and only if the batch writes a contribution, and write_upsert takes the
label as an argument. index builds one Writer per batch, so this is also
once per writer.

The new test the_live_label_is_asked_once_per_batch counts the asks with a
test-only thread-local in live_label. It expects 1 ask for a three-file
batch and 0 for a delete-only batch. Mutation run: asking per file inside
write_upsert again turns it RED (3 asks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
For each item the reviewer filed, the record now gives the change, the
test and the mutation run with its result. That includes M18, which the
UNIQUE key caught at open rather than the test, and M18b, which reached
the test's own comparison. It also covers the two fixtures the new
trigger refused, the pass counts for this round (the indexer, daemon and
cli suites, and the eight corpus binaries at 47 passed with no baseline
moved), the review_diff findings and why none of them can be fixed in
code, and two more tool gaps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
# Conflicts:
#	crates/indexer/src/migrations.rs
#	tests/corpus/package-baseline.json
`index_access_denied` is public and its doc linked the private
`raw_probe`, which resolves only under --document-private-items and
fails the docs job (rustdoc::private_intra_doc_links under -D warnings).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
It calls index_path, which flushes through the writer, without the
seam lock RESOLVE_HOOK_LOCK's doc requires. A parallel test's injected
busy commits (FAIL_NEXT_COMMITS) could land in it, or be consumed by it:
lane W's targeted run saw the_shutdown_flush_gives_up_after_its_cap
count 6 attempts where it injects for 3. Found with search_text /
read_code over the seam's users; pre-existing on the integration head.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The resolve already honoured `ResolveControl::request_cancel`. The parse
stage did not. A one-shot process that handed its reconcile to the
daemon therefore kept writing reparse batches (a whole first index), and
the daemon's startup waited behind them. Parse tasks now skip once a
SHUTDOWN has been requested. The check is `shutdown_requested`, not
`is_cancelled`: a watcher re-arm (`WatcherStopped`) keeps its old
behaviour. An inert control never reports a shutdown, so no other caller
changes. The resolver is untouched.

Graded by oneshot_daemon_e2e::a_cancelled_first_index_stops_parsing.
Mutation "no parse check": RED, 1501 of 1501 files indexed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Round-4 review items 1, 2, 4, 5, 6 and 7.

1. index_state, at the source. Every answer passes through
   `annotate_answer_provenance`, and gets an `index_state` block
   ({projects: {name: state}, semantics: counts are FLOORS, empty is not
   absence}) while a participating project's index is not `ready`. The
   state is `PathClaims::lifecycle_state`, an in-memory daemon answer.
   This covers daemon-backed sessions as well as one-shot ones. On
   django, find_references had answered 25/14/7/0 with nothing saying
   so.
2. One deadline per process for daemon registration and serving
   together (`DAEMON_SERVING_WAIT`, 5 s), shared by every project, so a
   whole call is ≤ 10 s + 5 s.
4. The started daemon stays in its spawner's process group again,
   consistent with `lifecycle::detach_daemon_command` and the test
   leash. `process_group(0)` made leashed daemons leak on a killed run.
5. One gate: `lifecycle::daemon_command` returns a Result and refuses
   when `lifecycle::may_spawn_daemon` does. All three spawners
   (attach-or-spawn, respawn, one-shot starter) go through it, and lane
   W wires `startup_backoff` there.
6. `reconcile_pending.semantics` says `started_daemon` converges only
   when `serving`.
7. The starter calls `stop_own_pass` exactly when it hands the reconcile
   to a daemon (found or spawned), never for a foreign `--db` or a
   refused or failed spawn, and then always returns `Some`.
   - The pass's cancel control is published before the database opens.
     On a first index the late publish had made the cancel a no-op
     (measured).

Tests (mutations run, each RED):
- index_state_disclosure_e2e::an_answer_from_a_reconciling_daemon_says_so
  (real daemon held reconciling): insertion dropped.
- a_call_waits_for_the_daemon_once_registration_and_serving_together:
  5 s each, RED at 11.1 s.
- a_call_that_starts_no_daemon_keeps_its_own_pass: stop called first.
  The first draft (a first index) let the mutation survive; an upgrade
  staging grades it.
- a_cancelled_first_index_stops_parsing: control published late.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`two_one_shot_queries_at_once_start_one_daemon` failed 1 of 7 full-suite
runs: under load the daemon did not reach `serving` within the daemon
wait. It now grades what matters: exactly one daemon, named by both
replies, and a retry that converges. The first-index test does the same.
Whether a reply promises is graded where that is the subject. The WARN
test drops the process-group assertion that went with the reverted
`process_group(0)`.

Mutation (run): never consult the registration, RED.
query_cli in full, 5 runs in a row: 18/18 each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Records each MEDIUM and LOW, its test, its mutation, the cancel that was
a no-op on a first index, and the narrowed parse check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
S (#301) and W (Windows CANTOPEN) both touched the two daemon spawn
sites: W put `restart::startup_backoff` in front of each; S replaced
each spawn with the one recipe `lifecycle::daemon_command`. Resolved by
taking S's recipe and making W's backoff THE gate inside it:
`lifecycle::spawn_refusal(root, db)` is `restart::startup_backoff`, so
attach-or-spawn, the client's respawn and the one-shot starter all
answer with the recorded cause instead of spawning another daemon that
dies the same way.

Verified: the S/W overlap suites on both MCP legs (index_access_denied_e2e,
oneshot_daemon_e2e, index_state_disclosure_e2e), query_cli 19/19,
daemon restart + reconnect_e2e. MUTATION (RUN): spawn_refusal -> None
turns repeated_startup_failures_back_off_instead_of_respawning RED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The record still said schema 73, so the gate refused every run (lane U
restored it rather than bless a contended reading). Re-measured on the
integrated tree with the lanes stopped, load 1.8-2.5 on 12 cores.

Ten isolated runs: wall ratio 125,126,129,140,140,141,141,143,146,150
(median ~140.5; the schema-73 record said 134). SQLite work is
unchanged: vm_step 30.07-30.09M and fullscan_step ~0.625M match the
schema-73 record within 0.05%. Blessed through the documented
COSI_RUBY_PKG_COST_BLESS path; the blessed run read 128, so the
+50% wall ceiling TIGHTENS (201 -> 192), still above every observed run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`annotate_answer_provenance` returns early for a body that already
carries `answer_provenance`, and `context_pack` adds its own so its
budget can count it: a pack from a reconciling daemon said nothing.
The resource leg never passes through that annotator at all, so
`code-index://project/overview` was silent too.

One producer now: `index_state_disclosure` / `index_state_of` return the
fields to merge (`index_state_fields`), and all three doors merge the
same map. `context_pack` takes it before its budget arithmetic and
merges it into the reserved envelope AND the served response; the
resource leg names `primary` (no capture scope there) and carries it
onto the truncated fallback too.

Test: index_state_disclosure_e2e::
context_pack_and_a_resource_from_a_reconciling_daemon_say_so — full
and minimal pack, plus the overview resource, from a daemon held
reconciling; the full pack's `tokens_used` equals the shipped text,
fits the budget, and the safety net stays silent.

Mutations, run:
1. drop the merge into the served pack -> RED "a context_pack from a
   reconciling daemon must say so".
2. drop it from the reserved envelope only -> RED "the allocator
   reserved the block, so the safety net stays silent". SURVIVED on the
   bare fixture (the pack never saturated); the test now writes 80
   callers and asserts `omitted_dependents > 0` as a premise.
3. drop the resource-leg merge -> RED "the overview resource must say
   so".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The parse loop skips every task not yet started once a shutdown is
requested (a one-shot handing its reconcile to a daemon). The resolve
after it can then find nothing pending and report `Skipped`, so the
pass returned `Ok(stats)` over a PARTIAL index -- which
`single_process` would install in the slot and report `ready`.

`index_path_inner` now returns `IndexError::Cancelled` when
`ctl.shutdown_requested()` after the parse join (before the resolve),
and `single_process` bails "cancelled: handed to a daemon" if the flag
is set once the pass returns, covering a cancel that lands later. The
daemon's initial-reconcile loop already treats a shutdown-time `Err` as
a clean exit, not `degraded`.

Test: resolve_progress::tests::a_shutdown_mid_parse_fails_the_pass -- a
wrapper plugin requests the shutdown from inside its first `extract`
(deterministic mid-parse), premise asserted: fewer files indexed than
on disk.

Mutation, run: delete the post-join check -> RED "a pass cut short by a
shutdown must not return Ok: 12 of 400 files, IndexStats { ... }".
The `single_process` bail has no dedicated test: with the indexer
check in place it is unreachable for the parse case, and no harness
reaches a cancel landing after the parse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`index_state_of` matched only `Ok(Some(claims))`, so a `path_claims`
RPC that FAILED added nothing — and an answer with no `index_state`
reads as steady. The probe's outcome is now folded by
`index_state_fields`: a non-ready state discloses `index_state`, a
failure adds `index_state_unmeasured: "<project>: path_claims failed:
<reason>"`, and `Ok(None)` (a daemon predating the method, or one still
discovering its extractors) stays SILENT BY DESIGN, now documented at
the fold and on `index_state_disclosure`. The marker is a
`*_unmeasured` field, so the minimal envelope keeps it.

Tests:
- server::index_state_fields_tests::
  a_failed_probe_is_unmeasured_and_an_old_daemon_is_silent (the fold,
  an injected Err beside Ok(None) and a steady project).
  Mutation, run: make the Err arm a no-op -> RED "a failed probe must
  carry `index_state_unmeasured`, never read as steady".
- index_state_disclosure_e2e::
  a_failed_lifecycle_probe_is_disclosed_and_an_old_daemon_is_silent: a
  scripted daemon answers `path_claims` with a non-PathClaims value
  (decode Err) and, paired, `unknown method` (old daemon, silent).
  Read through the resource leg, since a scripted daemon reports no
  read evidence for the tool leg's participation filter.
  Mutation, run: map the probe's Err to Ok(None) in `index_state_of`
  -> RED "failing: a failed path_claims probe must say so".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Every gate in overview_payload_budget_e2e measures a SETTLED daemon,
and `index_state` ships only while a project is not `ready`, so #301's
block was behind a condition no ratchet reached.

`a_reconciling_overview_ratchets_its_index_state_block` holds the
daemon in `reconciling` (`CODE_INDEX_RECONCILE_DELAY_MS`) over the
saturated fixture and grades the block through `headroom::Ceiling`:
MEASURED 103 est. tokens (410 wire chars); new
`OVERVIEW_INDEX_STATE_MAX_TOKENS` 111 with an 8-token reserve (one more
project row). `index_state` joins `STATE_CONDITIONAL_SITES`, so it is
never charged to the content half. No existing ceiling moved.

DOES NOT FIT, reported and not asserted (printed every run):
- content 4,052 vs the settled 4,050 ceiling (settled measures 4,046).
  The +6 is not `index_state`: `plugin_activation.coverage_reasons`
  gains `"index_reconciling"`, a state-conditional ARRAY ELEMENT in the
  content half that the path-based split cannot strip.
- state disclosures 340 vs the settled 170 allowance (state 7,
  state_detail 87, resolve_progress 82, resolver_degradation 62,
  index_state 103).
- whole payload 4,451 vs the settled 4,300 worst case, over by 151.

Mutations, run:
1. append 40 chars to `INDEX_STATE_SEMANTICS` -> RED on the block
   ceiling.
2. drop the `index_state` merge from `annotate_answer_provenance` ->
   RED on the premise (`index_state.projects.primary == reconciling`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The reconciling payload was measured but not asserted. It now has
three ceilings of its own, graded through `headroom::Ceiling`; the
steady ceilings (content 4,050, state 170, whole 4,300) are unchanged
and still pass.

- content: `OVERVIEW_CONTENT_MAX_TOKENS` + 6 (the `index_reconciling`
  coverage reason, which exists only while the index is not ready) =
  4,056, with the steady half's own OWED reserve. Measured 4,052.
- state disclosures: 347 = measured 340 + "one `state`-sized field"
  (7), the steady allowance's own sizing rule; `state`/`state_detail`
  and the `index_state` block exist only while the index is not ready.
- whole: 4,461 = measured 4,451 + the halves' reserves (3 + 7), with a
  compile-time check that it does not exceed its parts' ceilings.

Measured over 9 back-to-back daemon-leg runs: 8 identical (4,451 / 4,052 / 340);
one read 4,384 with state 273, lower, so no ceiling is at risk from it.

Mutation, run: grow the reconciling payload by 40 chars (the daemon's
ordinary-reconcile `state_detail` sentence, which only a reconciling
daemon ships) -> RED "project_overview state disclosures (RECONCILING
daemon) is 350 estimated tokens, over its 347-token ceiling by 3"; the
whole went INTO THE RESERVE; steady and block ceilings stayed OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Upgrade Wasmtime and its C API to 36.0.16 for RUSTSEC-2026-0316, updating engine identity and remeasuring pinned baseline metadata without changing deterministic rows or ceilings.

Read package parity facts through the live projection label. Lock executable installation and subprocess spawning together in E2E helpers, and distinguish release archives from executable copy sources.
Cargo binary filters leave virtual-workspace feature resolution active. Name the three parent packages together and the plugin host separately in every release job.

Require explicit package roots in the shipped dependency guard instead of inferring a narrower selection from binary ownership. The original commands fail the corrected guard; all shipped graph and binary registry checks pass with explicit roots.
Share canonical extraction walkers, persist generation-scoped layout facts, and build infrastructure-only binaries with independent native fallback features. Preserve activation facts through refusal and cancellation, resume resolution durably, and verify producer identity before retry. Include signed-package acceptance, native comparison, pinned corpus corrections, grammar provenance, and staged rollout documentation. Final performance and committed-revision CI qualification remain required.
Preserves the uncommitted work recorded in
_prdoc/records/P2-progress-handoff-2026-10-03.md: coalesced concurrent
builds, retirement of obsolete pending identities, withdrawal of a
pending activation, retention by supersession order, the Python
optional-module receiver fix, first-start policy fixtures, and the
workflow guards. Compiles (cargo check --workspace --all-targets).

NOT a qualified state. Known open, per the handoff: retained package
facts deleted when routing is withdrawn (rollback FK 787), the Python
catalog/digest mismatch, and the MCP failures listed there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The catalog's per-version package_digest and extraction_identity were
compared against tests/packages/<pkg>.digest, and the record was compared
against a real pack only on bytes and entries. So the identities were
graded catalog-to-record and never record-to-artifact: a record forged to
the stale Python catalog value (6d47deb2...) left the gate 8/8 green
(M10), and so did a same-length fixture edit (M11). Both are now RED.

The chain is closed for every package directory: catalog == record ==
package_digest / extraction_identity of the container plugin pack builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
distribution/registry.v1.json states a package_digest and an
extraction_identity per version row, and nothing produced them: the gate
compared them against the .digest records, so moving a package meant
pasting digests into the catalog by hand. P2 left a Python row whose
package_digest had been refreshed while its extraction_identity had not.

package_records now checks every catalogued package (all ten directories
under tests/packages/, not only the seven it writes records for) and,
with --write, rewrites exactly those two values in place from the
records. It refuses a package or version row the catalog does not have:
that is a release edit (archive name, URLs), not a derivation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The registry schema gate was 7/8: the catalog stated extraction_identity
sha256:6d47deb2... for de.h-dv.python 0.1.0 while the record, and the
container tests/packages/python packs to, say sha256:00907dcd....

The stale side is the CATALOG. The source build reproduces the shipped
extractor.wasm byte for byte, the grammar reproduces from its pinned
crate, and the record equals what package_records derives from the pack.
Both values entered in 5d875ea, the catalog's package_digest agreeing with
the record and its extraction_identity matching no artifact in the tree:
one of the two fields was re-pasted and the other was not.

Written by: cargo run -p code-index-plugins --example package_records -- --write
The package digest does not move, so no version bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
No-daemon one-shot retries never converged and a no-daemon call stayed
warming_up: the durable batch's ref_count recount spliced the
index-eligible active-generation predicate into a correlated subquery,
so SQLite planned each per-target probe through idx_refs_generation (one
value on every live row) and scanned the whole active projection per
touched target. Measured 2.5 s per 1,024-ref batch on the 600-file
fixture against 2 ms with a post-fetch filter, longer than a one-shot
call's wait, so no batch ever committed and the queue never moved
(resolve_resume_refs stayed at 11,400 across 30 calls).

The recount now uses resolve_resume::active_refs_filter (the `+`
spelling). the_batch_recount_probes_refs_by_target grades the plan of
the statement the product runs.

The convergence e2e also staged an index with no first-start language
decision, so the first one-shot process activated an isolated
generation and retained the old rows (22,800 refs under new ids against
an 11,400-row id-keyed projection). The fixture now records the real
first-start decision before capturing the projection, as the other
generation-sensitive fixtures do.

Mutation (run): recount via active_refs (no `+`) -> RED in
the_batch_recount_probes_refs_by_target, no_daemon_retries_resume_
resolution_to_the_atomic_projection and a_call_that_starts_no_daemon_
keeps_its_own_pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`package_parity::producers_of` joined `file_contributions` onto the
ACTIVE generation's id, which since m0075 labels no row, and made
`ruby_package_parity` fail "left 0, right 153" — read as a product
regression. The checkpoint already reads it through `live_label`; this
makes the class impossible to reintroduce.

`no_production_statement_reads_rows_by_the_active_generations_id` now
also scans every shared test helper module — any `.rs` in a
subdirectory of a crate's `tests/` (mod.rs trees and #[path] support
files) and the whole test-support crate — with the same label-table
scanner, plus an exact registry of helpers that call
`contributions::current_generation` (one: generation_fixture's grant
writer, which writes generation METADATA). Anti-vacuity: the walk must
reach package_parity/mod.rs, corpus/mod.rs, test-support/src/exec.rs
and mcp-server/tests/support/mcp.rs.

Audit (scanner widened over every tests/*.rs, then reverted): no
test-side read of a label table by the active id remains. The only hits
were this file's own probe literals and generation_crash_matrix's
`state NOT IN ('active','superseded')` pending-row count; every
value-bound `generation_id = ?` on a label table binds LIVE or a
pending/superseded id.

Mutation (run): restore `JOIN plugin_generations g ON g.id =
fc.generation_id AND g.state = 'active'` in producers_of -> RED,
naming tests/package_parity/mod.rs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Three gaps between the language packages and the builds that produce them:

1. the_packaged_grammar_is_the_one_with_a_build_script compared a
   hand-written table of three copies (xaml, ruby, timeline). Svelte's copy
   was exempted from its digest row as "bound by" that test and was in no
   row of it: a midpoint flip left grammar_provenance 7/7 green. The seven
   language copies were pinned instead by a second hex beside the
   script's own, so a grammar re-recorded in its script with the package
   copy left behind stayed green. The population is now derived from
   every [grammar]/[[grammars]] entry of every tests/packages/*/plugin.toml,
   mapped by exported_name to the script-pinned tests/grammars artifact;
   the duplicated rows read "digest read from the script".

2. Nothing in cargo test rebuilt the nine build.py extractor components;
   the only source leg was an inline heredoc in ci.yml with a hand-typed
   count. every_language_extractor_is_what_build_py_produces runs the
   documented build.py and byte-compares, over a population derived from
   the manifests (a package with no lane is red by name). Same
   COSI_GUEST_REBUILD knob as the existing rebuild tests.

3. ruby_guest_wire::the_shipped_extractor_is_what_the_guest_source_builds
   still built the retired 0.7 guest crate against Ruby 0.8.0's
   shared-walker artifact: RED on the unmodified checkpoint under
   COSI_GUEST_REBUILD=1 (27741 vs 1869318 bytes), the setting CI's
   workspace-test step uses. It now runs crates/guest/ruby/build.sh.

All nine extractors reproduce byte-identically from two clean target dirs
and from a copy of the tree at another absolute path; the WASM_ARTIFACTS
notes now say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Withdrawing a package's routing leaves its package-only paths (Ruby's
.rbx) claimed by nobody. The next walk skips them and its reconciliation,
like the watcher's skip arm, sends WriterMsg::Delete for each. The writer
deleted the files row, and its FK cascade took every generation's
contributions with it, including the superseded generation's rows that a
rollback restores. The Ruby post-removal rollback then failed with SQLite
787 (153 queued file ids, 1 surviving files row).

write_delete now applies one rule at the boundary every delete crosses:
while a superseded generation holds a contribution for the file, only the
file's LIVE contributions are deleted (their cascade takes the live
symbols, refs and imports and owes the same resolve work); the anchor
row and its generation-shared text stay. That is the state a promotion
itself leaves a withdrawn path in, and readers already report it as
unclaimed. Otherwise the row is deleted as before.

Tests (generation_promotion): an owner-less path survives an ordinary
pass, a watcher start and a watcher event, then rolls back to the same
row ids; a vanished path with live and retained rows loses only the live
ones. Both mutations were run and went red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
generation_build_files has no foreign key to files (its rows live as
long as the generation), so a queued id can outlive a files row that was
legitimately replaced or removed, for example a re-indexed edit that
re-inserts the row under a new id. promote_in_transaction copied that
dead id into resolve_scope_files, whose foreign key failed the whole
switch (and so the rollback) with SQLite 787. The scope enqueue now
joins files.

Test: a_rollback_skips_queued_files_that_no_longer_exist; dropping the
join was run and went red with the 787.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Each remaining handoff failure, classified.

STALE FIXTURE (intended change): an index built by bare `index_path`
has no recorded first-start language decision. Since Phase 2 the
language config is part of the activation identity
(`activation::inputs`), so the server's own first start records the
decision, sees a different activation digest and builds an ISOLATED
generation that re-extracts every file. Three tests staged state that
rebuild replaces:
- index_coverage_e2e::a_truncated_file_says_so_...: the staged
  `extract.truncated_tree` diagnostic was re-extracted away (left []).
- index_state_disclosure_e2e::context_pack_and_a_resource_...: the
  `alpha` id the reconciling search handed out was promoted away before
  the pack asked (`seed_issues: missing`), so the pack never saturated.
- mcp_smoke::context_pack_distinguishes_an_unreadable_source_...: the
  corrupted file was re-extracted, so the pack had no targets.
Each now records the real first-start decision before staging
(`pre_index_stable`, the checkpoint's existing helper for exactly this,
already used by diagnostic_census, disclosure_contract and
partial_fixture). No assertion changed.

REAL PAYLOAD GROWTH (overview_payload_budget_e2e), measured against
master (4ecf930) built from `git archive` and dumped by the same test:
- saturated content 4,066 of 4,050 (master 4,046). The only growth is
  Phase 2's new `module_layouts` block (+19 tokens). The first-start
  enablement disclosure is in master's measurement too (7b05aa6), so the
  fixture is NOT changed here.
- the reconciling test (new in Phase 2) also carries an in-flight
  activation's `pending_*` fields on that first start (+19).
- daemon leg: a settled daemon that has run ANY resolve pass shipped
  every within-budget `stage_budgets` verdict (295 of 170 state tokens;
  the allowance was sized on 82). Master only passed because its
  daemon never ran a pass in this fixture.
Paid, no ceiling moved:
- `render_module_layouts`: measured-none ships `{"available": true,
  "total": 0}` (items/omitted restated the zero); -7.
- `coverage::EXTENSION_SEMANTICS`: drop two examples of rules the string
  still states (XAML/typed-DataSet illustration, the Dockerfile list);
  -33. The graded needles are all intact.
- `ResolveProgress::from_snapshot`: once no pass is open, keep only
  DEGRADED stage verdicts (the committed outcome is
  `resolver_degradation`'s); an open pass still shows every verdict.
Now: saturated 4,025 of 4,050; reconciling content 4,050 of 4,056, whole
4,449 of 4,461; daemon-state 163 of 170 (daemon leg). legacy_daemon_
payload_e2e passes on both legs at the checkpoint (no change needed).

Mutations (run):
- the tree before this commit: overview RED at 4,066 / 4,084 / 295.
- delete render_module_layouts' measured-none arm -> RED
  module_layouts_render_three_states_and_a_short_measured_none.
- drop the `.filter(|b| active || b.degraded)` -> RED
  a_settled_pass_reports_only_its_degraded_stage_verdicts.
- the three re-fixtured tests on `pre_index` -> RED as above (the
  handoff's failures, reproduced at 8d4be54).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The module doc cited the_record_the_refusal_protects_is_really_destroyed_without_it,
which no longer exists; doc_citation_gate failed on it. The test is now
a_builtin_transition_preserves_the_retained_package_record and proves
the inverse: a host-less pass promotes an isolated builtins-only
generation and the package record survives in the superseded one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`wpf.narrowed.the_capability_change_is_reviewable` pinned
`/plugin_activation/active_generation` to the literal 2. Isolated
activation legitimately mints later ids — measured: 4, because the first
start records its language decision as its own isolated generation — so
the clause graded a number, not the contract.

The oracle clause is now `equals_bound: db_active_generation`. The
harness reads that value straight from `plugin_generations` (exactly one
`active` row, read-only) after the phase settles, and seeds it as a
binding — never from the RPC under test. `agent_bench::bind_expectation`
resolves the clause and PANICS on a name nothing captured. The phase also
reads the active id after phase 3 and asserts phase 4's differs, which is
the "a generation was promoted" fact the literal used to stand for.
`the_plugin_oracle_is_well_formed` now refuses a literal `equals` on any
`*_generation` pointer and any `equals_bound` name other than
`db_active_generation`. Question and clause counts are unchanged (19/55).

Mutations (run):
- read `state = 'superseded'` instead of `'active'` in
  db_active_generation -> RED: "active_generation == 4, want 3".
- restore `"equals": 2` in the oracle -> RED in
  the_plugin_oracle_is_well_formed (literal generation id).

Both legs green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Conditions moved: schema 75 -> 78, Ruby package 0.7.0 -> 0.8.0 (digest
and extraction identity re-pinned by 5d875ea). Re-measured through
COSI_PACKAGE_BLESS=1 on e644a2f, against a corpus copy without the
cached .code-index state the shared checkouts carry.

Exactly 21 measured deltas, every one in the whole-table count./gen.
dimensions and none in the served active.* projection:

- 6 x gen.deleting -> 0 (ruby/active 1, ruby/removed 2, ruby/rollback 1,
  xaml/active 1, xaml/removed 2, xaml/rollback 1): ordinary indexing now
  completes collection, so no generation is observed mid-delete.
- 7 x ruby/inert (imports +2, refs +60, symbols +2, resolved +7,
  resolved_call +7, rule.tier1a_unique_own_file +7, influence +60):
  exactly the native test/yajl_test.rb rows (the absent rung's 1 file,
  2 imports, 60 refs, 2 symbols, 7 resolved), now retained by the
  superseded absent generation instead of cascaded away (cae1a2c).
- 8 x ruby/removed (files 1 -> 153, imports 2 -> 233, refs 60 -> 20506,
  symbols 2 -> 1262, resolved/resolved_call/tier1a 7 -> 14, influence
  60 -> 20506): the retained inert generation's facts (20446 refs, 1260
  symbols, 231 imports, 7 resolved) survive withdrawal beside the live
  builtin yajl_test.rb rows. The old writer deleted the owner-less .rbx
  file rows and FK-cascaded them (the rollback 787).

The ladder's removal-rollback asserts (identity, grants, served rows,
exact fact rows, no re-extraction) passed in the blessing run. A
provisional measurement taken before it produced byte-identical repos
and activation blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
FAIL_NEXT_COMMITS/FAIL_COMMITS_CODE/FAIL_NEXT_RESOLVE, the tier-3 and
tier-1Q budget overrides, the tier-1R/tier-3 oracle switches and the
TIER3_DEGRADED recorder were process-global atomics in a parallel test
binary. Any test reaching `flush` or `apply_resolution` could consume
another's injection, so every such test had to hold RESOLVE_HOOK_LOCK —
a rule nothing enforced, broken five times.

Option A, structurally. New `test_seams` (cfg(test)): every seam is
ARMED ON A DATABASE and READ FROM THE CONNECTION the product holds —
keyed by SQLite's own main-file name (`Connection::path`), or by the
connection object's address for an in-memory database — with an RAII
guard that disarms at test end. A test can only reach its own tempdir,
so no test can see another's injection:
- `flush` / `apply_resolution_observed` consume
  `take_commit_failure` / `take_resolve_failure` on their `conn`;
- `Stage::budget(conn)` reads the tier-3 / tier-1Q overrides per DB;
- the tier-1R / tier-3 oracle selection reads `tx`'s seams;
- tier-3 degradation is RECORDED on the armed database only;
- the progress allowance / op-count seams are fields of the
  `ResolveControl` that observes the pass;
- `build::WRITE_DURING_READ` and `index::FORCE_REFUSAL` are keyed by
  absolute file path (FORCE_REFUSAL used a relative suffix such as
  `src/a.rs`, which every test indexing one shared).
RESOLVE_HOOK_LOCK and all 50 acquisitions are deleted; the tests that
moved an armed in-memory connection into a thread now use a tempfile DB.

Gates:
- seams_are_scoped_to_their_own_database: B indexes cleanly while A is
  armed to fail commits and the resolve; A's injections are untouched,
  and then reach A's writer through a separately opened connection.
- no_unkeyed_process_global_test_seam_exists: any item-level
  `#[cfg(test)] static` in the crate must be registered with its key.

Mutations (run):
- `key_of` returns one constant key -> RED "A's injections must still
  be A's" (B's index consumed them).
- add `#[cfg(test)] pub(crate) static FAIL_NEXT_X: AtomicBool` to
  index.rs -> RED naming it.
Indexer lib: 501 passed, 3 ignored, at --test-threads 32 (twice before
the FORCE_REFUSAL change, once after); clippy -D warnings clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
- ref_kind_stance_registry: the batch recount's refs SQL now lives in
  `recompute_ref_counts_batch_sql` (ff245c0 split it out so its plan
  could be graded); the registry entry follows it. RED before:
  "these read the `refs` table and are NOT in the REGISTRY".
- reason_code_registry: `const_slice_keyed` required `= &[` on one line;
  rustfmt writes build.rs's `ACTIVATION_CONTROL_REASONS` as `=\n &[…]`,
  so it parsed as the EMPTY set (pre-existing at 8d4be54; caught by
  the_populations_are_not_empty's floor). The parser now skips
  whitespace after `=`. RED before at both gates.
- tool_ux_e3_e2e::a_same_build_answer_blames_the_index_rows_...: the
  same stale first-start fixture as a662b62 — the server's isolated
  activation re-resolved and refilled the NULLed columns. Now
  `pre_index_stable`; assertions unchanged. RED before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
On the daemon leg eight context_pack / dependency tests failed with
`index_updating: Index content changed while assembling this budgeted
answer` or unwrapped a missing body. The harness's `initialize` returned
as soon as `project_overview` stopped answering `warming_up`, while the
daemon could still be `reconciling` (here, the first start's isolated
activation of a policy-less fixture) — so a pack was assembled across
its commits and honestly refused.

PRE-EXISTING and environment-dependent: the same 8 fail at 8d4be54 in
this worktree, and pass from a `git archive` export of 8d4be54 in /tmp
— a timing window, not a product change. `initialize` now also waits
the daemon's `state` disclosure out (absent once ready, never present
on the snapshot leg), within the SAME 15 s deadline.

Result: mcp_smoke 109/109 on both legs (was 101/109 on the daemon leg).
Mutation: the tree before this commit — RED, 8 failures as above.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Most corpus suites (corpus_ratchet, corpus_cost, corpus_tier3_ratchet,
cost_attribution, ...) index the pinned checkout IN PLACE with the
database in a temp dir, but `languages::effective` still reads
`<root>/.code-index/languages.toml`. A stale one left by an Oct 2 daemon
run changed rust-analyzer's activation digest and failed the tier-3 run
with a message about packages, not about the cache. The likely producer
is #191: an MCP server whose environment carries COSI_CORPUS_DIR links
every checkout as a project and each linked daemon writes its state
there.

`repo_path` now panics (not skips, not deletes) when the checkout root
holds `.code-index/`, naming its contents and the remedy. `stage` already
dropped the directory from its copy; it goes through the same guard so
the rule is one rule. The sha/deleted-file probe moves to `checkout_in`
so the guard is graded without touching the process environment.

Tests: a_clean_checkout_is_accepted / a_checkout_with_cached_state_is_refused.
MUTATION (RUN): delete the `refuse_cached_state(&p);` call in
`checkout_in` -> a_checkout_with_cached_state_is_refused FAILS
("should panic"); restored by cp, md5 verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
corpus_cost fired with fullscan_step up in all seven tier-1 repos
(+5.5% .. ruby-sinatra +101%) and autoindex down 85-96%. Attributed per
statement against 2eb3f55 (the last green-cost tree), no schema change
was involved (m0076-m0078 add tables and invalidate files; they drop no
index). Three statements, all new in 2eb3f55..7628517:

A. python_imports::filter_unknown_receiver_own_file, run twice per pass,
   full-scanned refs in EVERY repo (Python or not): +2x refs
   fullscan_step everywhere (ts-zod +172,326, ripgrep +84,116). It is now
   driven from `files` through idx_files_lang/idx_refs_file_line;
   files.lang equals every row's lang (m0044's writer guards), so it
   admits exactly the same rows. Non-Python repos: ~200 vm_step.

B. The path-evidence EXISTS (index.rs and resolve_resume::initialize).
   Adding the active-generation predicate let idx_refs_generation drive
   refs and re-scan stale_path_evidence per qualified ref: ruby-sinatra
   194,628 fullscan_step. It now matches DISTINCT qualifiers in a
   co-routine (same answer, early exit kept): sinatra 3,234 fullscan_step,
   124k vm_step (was 1.09M; 1.64M at 2eb3f55), no automatic index.

C. sqlite_master probes for file_export_facts/package_layouts, once per
   extracted file (python-flask: 163 runs, 17,604 fullscan_step), now
   read pragma_table_info: 0 fullscan_step.

The autoindex fall is the path-evidence check no longer building a
refs-wide automatic index; it stays fallen. Binds are byte-identical
before/after (path, line, col, kind, name, target, resolved_by) on
python-flask (15,365 refs) and ruby-sinatra (20,541 refs).

cost_attribution now records fullscan_step, sort and autoindex per
statement as well as vm_step, and prints a second table ranked by
fullscan_step + autoindex: the vm_step-only table could not name a
statement that moved fullscan_step alone. It also refuses a checkout
carrying .code-index/, like every other in-place corpus suite.

MUTATIONS (RUN, each restored by cp + md5):
- file predicate admits nothing -> python_imports
  an_explicit_unknown_receiver_cannot_borrow_an_unrelated_own_file_method FAILS
- path-evidence match never matches -> anchor_rename FAILS
- export-facts probe names a missing table -> 3 python_imports
  module_metadata_tests FAIL

corpus_cost after: no dimension above its ceiling in any repo; it still
fails on autoindex BELOW the -10% floor in all seven (a downward bless,
left to the operator because a whole-record bless would also move
vm_step up 0.5-1.9% on four repos; that rise is present at 2eb3f55 too).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
filter_unknown_receiver_own_file treated a binding row with no type head
as "explicitly untyped" and cleared tier1a_unique_own_file binds that the
source supports (flask cli.py:623/645 `info = ctx.ensure_object(ScriptInfo)`,
Django sql/query.py `q = self.clone()`, `outer_query = self`, ...).

A missing type head is now unmeasured and keeps the bind. The bind is
refused only on one of three index facts: a type head naming no class of
the target's file, an import binding the receiver's name (the
`pywatchman = None` fallback), or delegation through an inherited
interface (the call sits in a method of the target's class on a non-self
receiver, and a resolved supertype declares the name or an imported base
cannot be expanded).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Testing evidence inside a search over every binding of the name walked on
to older bindings on a miss. The nearest in-scope binding is now chosen by
one ordered probe and the evidence read off that row; "inside C" is read
lexically off parent_id. Binds are identical to the previous revision on
python-flask and py-django.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Every delta has a source verdict (reasons are recorded in each file):
python-flask -4 tier1a_unique_own_file, all old binds wrong
(templating.py:73/93/112/117). py-django -5 tier1a_unique_own_file, all
old binds wrong (fallback.py:27/50/54, test_fileresponse.py:47/217);
+66 tier1r_receiver and +3019 module binding facts from Epic #309, all
right; rust-analyzer +2 Python module binding facts. The cost baseline is
untouched (its autoindex floor is lane K's pending bless).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Per repo vs the previous record (vm_step / fullscan_step / autoindex):
  cs-dapper    +1.3% / -5.4% / -82.2%
  js-express   +0.6% / -8.6% / -95.9%
  php-guzzle   -1.0% / -8.8% / -84.6%
  python-flask -0.3% / -5.2% / -86.4%
  ruby-sinatra -8.2% / -0.2% / -89.6%
  rust-ripgrep +1.9% / -7.1% / -93.6%
  ts-zod       +0.5% / -8.1% / -92.2%

Attribution is in the record's reason: three new Phase 2 statements
(the Python receiver filter, the path-evidence EXISTS, the sqlite_master
probes) were reduced by lane K before anything was blessed; the
remaining vm_step +0.5..+1.9% sits inside the band and mostly existed at
2eb3f55 already. Approved by the operator before blessing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The harness had never run green; three of its assertions described
messages or rows the system cannot produce:
- 0.32.2 refuses a signed archive at `manifest.unknown_field at
  requires_host` (deny_unknown_fields, before any ABI/range check) — the
  host-range wording exists only in hosts that know the field.
- `obj.member()` calls are recorded as kind `method_call`; the inherited
  -member filter listed only call/member_access and so read nothing. The
  resolutions it grades were already exactly right (unresolved through
  the inherited OutsideType, bound for Base).
- packages-only builds still index TEXT files with the base system's
  text producer; the "every producer is a language package" check now
  covers code files, which is what it meant.
Refusal still writes no project state, asserted per language.

Run: all seven signed language packages + the 0.32.2 refusal, rc=0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Native Windows CI run 943, installer_ps1_e2e::the_bundled_packages_are_
installed_beside_the_binaries: one bundled package was reported as
"2 bundled package(s)". On Windows, Get-ChildItem -Filter is evaluated by
the Win32 FindFirstFile matcher, which also matches 8.3 short names, and
the short name of `x.cips` ends in `.CIP`; so every `.cips` signature was
counted as a package. PowerShell on Linux emulates -Filter exactly, so
only the Windows runner could see it.

Both places that count `.cip` files now filter on `$_.Extension -eq
'.cip'` (exact, case-insensitive): install.ps1's installed-bundle line
and release.yml's windows-archive-smoke staged-bundle check, whose
`-lt 1` floor the same bug would have satisfied with signatures alone.

Not runnable here (no pwsh on the Linux host); native Windows CI is the
only check. ci_cadence (ASCII / PowerShell grading) stays green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Native Windows CI run 943 failed eight tests with `jq is not on PATH`
before they graded anything. The scripts they drive (package_channel.sh,
package_channel_check.sh, package_core.sh, package_publish.sh,
require_ci_green.sh) run only in Linux jobs of release.yml and
package-release.yml (runs-on: docker, the ci-rust image, which ships jq);
no Windows job calls them. Installing jq into the runner from a test would
grade the runner, not the scripts. The eight tests and the helpers only
they use carry #[cfg(unix)]; the module doc says why. The other seven
(pack, sign, verify, admit, tag, ...) need no jq and keep running on
Windows under the runner's sh.

Verified: 16/16 on Linux; `cargo clippy --workspace --all-targets
--target x86_64-pc-windows-gnu -- -D warnings` clean (it was red on the
now-unused helpers before they were gated).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Native Windows CI run 943 (71ab5c5): cli_beside_daemon_e2e's CLI index
and oneshot_daemon_e2e's one-shot server both died of `UNIQUE constraint
failed: index 'idx_plugin_generations_one_in_flight'`. At 71ab5c5
build::request ran its census outside a DEFERRED transaction, so two
requesters that both saw nothing in flight both INSERTed; the second
INSERT, started fresh after the first commit, hit the cardinality index.
8d4be54 moved the census inside a BEGIN IMMEDIATE transaction and made a
losing requester join the matching candidate. Nothing graded that.

two_builders_requesting_at_once_coalesce_on_one_generation FORCES the
interleaving: a third connection holds the write lock while two threads
run build::build to their request, then releases it inside busy_timeout.
Both must finish Ready on the same generation, and exactly one
generation row is added.

MUTATION (RUN): restore the 71ab5c5 request (conn.transaction(), no
in-transaction census) -> RED with the exact Windows error. Restored by
cp, md5 verified (2797dff1...). Green 6/6 runs after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The staged-ownership release (5d875ea) gave tests/packages/ruby a second
claim -- the whole native Ruby domain -- behind an explicit
`[[displaces]] builtin = "ruby"`. Three tests still asserted the
shadow-only shape (one claim, no builtin conflict, keys == [ext:rbx]),
so they failed against the shipped package rather than against a defect.

The property is now the one `builtin::displaced_by` enforces: the .rbx
shadow conflicts with nothing; the conflict set equals the consent list
exactly and is the builtin Ruby domain; the displacing claim takes the
builtin keys with their fold policy. Control: the same table with the
consent withdrawn is refused with package.claim_conflicts_builtin.

MUTATION (RUN): drop "gemspec" from [displaces.keys] -> RED (conflict
set and consent differ by ruby ext:gemspec). Shadow claim ["rbx","rbi"]
-> RED (declared keys pin).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`path_evidence_match_sql` (index.rs) and `withdraw_live` (writer.rs), from
d47d10f, read `refs` with no declared stance. Both are kind-blind on
purpose: the path_dirty probe must see an import's or an access ref's
qualifier as path evidence, and the retained-arm withdrawal must collect
every live resolved ref's stale name or its target's count goes stale.

The full run also reported `python_imports.rs :: receiver_evidence_binds`
(lane P): a TEST fixture under `#[cfg(all(test, feature =
"builtin-python"))]`. The stripper matched only the literal
`#[cfg(test)]`, so it had already forced two fixtures of that module into
the REGISTRY as if they were production readers. `is_test_only_cfg` now
reads the predicate: `test`, or `all(...)` with `test` as an argument.
`any(test, ...)` still ships with the feature on and stays scanned. The
two fixture rows are removed as stale.

MUTATION (RUN): rename the withdraw_live row -> RED ("NOT in the
REGISTRY: writer.rs :: withdraw_live"). Restore the literal
`#[cfg(test)]` match -> RED in cfg_test_fixtures_are_out_of_scope
(gated_fixture reported) and in the main gate (three python fixtures).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
c3afa39's `pinned_fixture` forked bare with `.output()`. The module is
compiled into targets that install executables (`extractor_cache`,
`parallel_precompile`'s siblings), and the fd a `write_executable` holds
is inherited by any fork in the same process, so the exec of that
binary can fail ETXTBSY. Every other spawn in this module already uses
`locked_output`; this one now does too.

MUTATION (RUN): restore the bare `.output()` -> RED in
exec_copy_registry::a_file_that_installs_an_executable_locks_its_spawns_too
("crates/indexer/tests/corpus/mod.rs:499  .output()").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The suite failed at php (57 vs 45) and stopped, so python, rust and
typescript had moved too, unseen. Measured per FILE against the parent
tree 312a242 (the same test with a per-file dump), every delta read at
source:

  php        45 ->  57  +12  new fixture qualified_occurrences.php
  python    145 -> 195  +39  new fixture module_bindings.py
                        +11  module-scope bindings (in_binding_scope now
                             admits module scope): c_decls +9,
                             pkg/__init__ +1, sample +1
  rust      175 -> 192  +17  new fixtures generic_associated_receivers
                             (+14) and scoped_macros (+3)
  typescript 87 -> 106  +19  new fixture typeof_members.ts

No existing file lost a ref; csharp, javascript and ruby are unchanged.
The comment decoys in the new fixtures produce nothing.

MUTATION (RUN): delete line 9 of qualified_occurrences.php -> RED
("php: 54 refs projected, 57 pinned").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
ruby_package_e2e::a_reserved_id_package... never saw its daemon ready.
Its corpus is two `.rbx` files only the Ruby package claims. Once the
package is refused at load (`language_reserved`), the desired activation
since 5d875ea is package-less and claims nothing, so its rebuild produces
zero contributions -- and gate 6 refused every such build with
"the build produced no contributions and carries none". The daemon's
startup loop retried forever, writing one more `failed` generation per
attempt (8 in two minutes), and never finished reconciling.

The positive control is kept for the cases it is about: an activation
that records a package (a package claiming nothing still fails, per
`a_package_that_claims_nothing_in_the_project_still_fails`) or a queue in
which any row was claimed. Only "no package AND every queued row
unclaimed" is accepted, which is the case where empty is the answer.

MUTATION (RUN): make the refusal unconditional again -> RED in the new
first_activation_admits::a_package_less_activation_over_a_project_nothing_claims_is_ready_and_empty
("got gate_failed: the build produced no contributions and carries
none"), and ruby_package_e2e RED as before (daemon never ready).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Step 8 compared the upgrade's activation digest with the granted
generation's, read by id AFTER `plugin disable`, `plugin enable` of the
new bytes and an `index`. Retention holds one superseded generation, and
since 5d875ea an ordinary `index` collects the `deleting` ones it finds,
so the granted generation's row is gone by then and the read panicked
with QueryReturnedNoRows -- a fixture reading a row the product had
correctly removed, not a lost identity.

The digest is now captured when the granted generation is active and
asserted present there; step 8 compares against that value. The property
graded is unchanged: the two package bodies give two identities.

MUTATION (RUN): the pre-fix read-by-id at step 8 -> RED
(QueryReturnedNoRows at release_gate_e2e.rs:600 via :1653).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
cli_beside_daemon_e2e flaked with the CLI dying "database is locked"
during its 7 s hold. Only the writer loop's running flushes waited out a
hold longer than busy_timeout (v0.32.2). Every other write path either
failed after one busy_timeout or, worse, failed at once:
  * activation::record and write_capability_grants ran in autocommit,
    one busy_timeout per statement;
  * reconcile_extraction_epoch, the activation build's queue, extraction
    windows and layouts, and collect ran DEFERRED transactions, whose
    first write is a read-to-write upgrade SQLite never retries;
  * the resolve pass, re-resolve, retire, request, the durable resolve
    batch, migrations, generations::fail/transition and promotion took
    IMMEDIATE (or autocommit) with no retry past busy_timeout;
  * the FINAL flush -- a one-shot index's normal last batch, not only
    a shutdown -- gave up after two retries.

`busy::begin_write` / `busy::begin_immediate` are now the one door: an
IMMEDIATE transaction whose BEGIN is retried with the writer's backoff
(25 ms doubling to 1 s, WARN per doubling, ERROR past a minute) for as
long as the lock is held, until the caller's stop predicate (a cancelled
pass, a shutdown) ends the wait with the SQLITE_BUSY it would have had.
Retrying the BEGIN alone suffices: once it succeeds the connection holds
the write lock, so no transaction body has to be re-runnable. Every
production write transaction above goes through it; commit_batch takes
one attempt so the writer loop keeps owning (and publishing) its wait;
the final flush keeps its bound only for a cancelled pass.

Tests: busy.rs holds the write lock on ANOTHER connection for longer than
the connection's busy_timeout across each path (test_seams::contend,
one-shot per label, which also records that the path really met the
hold): batch commit (final flush), activation record, resolve pass, and
an activation build's request, extraction window, state change and the
promotion switch. writer_lock_registry fails on any production
transaction opened around the door; four reviewed `busy: exempt` sites
(a read snapshot, a read-only temp-table tx, WAL maintenance that yields
by design, the access probe whose BUSY is its answer).

MUTATIONS (RUN), each RED on its own test:
  final flush bound made unconditional -> a_hold_on_the_batch_commit...
  "activation record" stop `|| true`   -> a_hold_on_the_activation_record...
  promotion begin_immediate stop true  -> a_hold_on_each_activation_write...
  retry_busy never retries             -> activation, resolve, build RED
  retry_busy ignores stop              -> a_stopped_wait... (Timeout)
  activation record back to conn.transaction() -> writer_lock_registry
  stripper's test_only_predicate false -> the_scan_reads_production_code...

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Windows-only `plugin_add_package_fetch_e2e::a_package_already_in_the_store_is_not_refetched`
failed "database is locked" opening a brand-new database. Read in the
code, the lane-WIN hypothesis holds and is worse than stated: while a
one-shot server's `single_process` is still inside
`code_index_indexer::open`, a tool call takes the not-ready path, and
that path opens the same file -- `perms::index_access_denied` read-write
with `BEGIN IMMEDIATE; ROLLBACK`, then the schema, counts and
reconcile-pending probes read-only. The opener's first locking statement
is `PRAGMA journal_mode=WAL`, which ran before `busy_timeout` was even
set, and which is a read-to-write upgrade SQLite never hands to the busy
handler anyway -- so any concurrent lock failed the OPEN at once.

Two halves:
  * ORDERING (structural). `ProjectHandle::begin_local_open` marks the
    open in flight; every not-ready probe takes its path from
    `probe_db_path`, which answers None meanwhile, so no probe opens a
    database this process is still creating. The open reports any real
    obstacle into the slot when it returns.
  * THE OPENER. `busy_timeout` is set first, and the WAL switch is
    retried on SQLITE_BUSY with `busy::backoff` for one busy_timeout,
    covering a second PROCESS's transient lock, which no in-process
    ordering can see. Measured: moving busy_timeout alone left the new
    test RED; the retry is what makes it wait.

The warming hint now probes `db_path_for(key)` rather than
`<root>/.code-index/index.db`, so a `--db` override is probed where it is.

MUTATIONS (RUN): `probe_db_path` ignoring the in-flight flag -> RED in
not_ready_probes_skip_a_database_this_process_is_still_opening ("a probe
opened a database this process is still creating:
Some(\"project_not_available\")"); `switch_to_wal` without its retry ->
RED in opening_a_brand_new_database_waits_out_a_short_hold_on_it ("database
is locked"). Both Linux-runnable; the Windows leg itself needs CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
With the CLI no longer dying of the lock, cli_beside_daemon_e2e failed
2 of 8 runs on the OTHER side: the daemon, started mid-index, sees an
identity the CLI has not recorded yet, rebuilds the activation, and the
build's gate 7 correctly refuses to promote a generation whose active
projection the CLI moved underneath it -- "startup activation was not
promoted; the previous generation remains active: gate_failed". That
refusal is transient (once the CLI finishes the identities match and no
rebuild is needed), but the startup activation ran as a fatal preamble to
the initial reconcile loop, so the daemon exited.

It is now `startup_activation`, run as the first step of every reconcile
attempt: an `Err` marks the daemon degraded and is retried on the
existing schedule, serving the last durable snapshot meanwhile -- the
contract the watcher-start half of the same attempt already had.
`CODE_INDEX_STARTUP_ACTIVATION_FAIL_WHILE` (debug builds only) is its
deterministic test seam, the twin of CODE_INDEX_RECONCILE_FAIL_WHILE.

MUTATION (RUN): return a startup-activation `Err` from `run`, the pre-fix
fatality -> RED in a_failed_startup_activation_is_retried_not_fatal ("the
daemon exited on a failed startup activation instead of retrying it";
log: "daemon exiting on a fatal error ... injected startup activation
failure"). After the fix the original e2e passed 6/6 runs (one log shows
the same race met and retried in the watcher half of the attempt).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
47fb314 made EVERY startup-activation failure a retry. That broke the
contract package_update_e2e grades: a startup whose activation admission
refuses (`disk_admission_refused`) must exit non-zero with the disclosure.
It retried instead, on the reconcile schedule, and the test -- a bare
`.output()` on that process -- hung the full suite for 34 minutes until
the daemon's idle timeout. Not a lock wait: a refusal retried forever.

A failure is now TRANSIENT only when it is measured to be: the ACTIVE
projection's fingerprint (`build::ActiveFingerprint`) moved while the
build ran. A failed build writes no active row (that is gate 7), so a
moved fingerprint means another writer -- the CLI of cli_beside_daemon_e2e
-- and the next attempt, once it has finished, needs no build. Every
other failure is FATAL, as before 47fb314.

The test's spawn is now bounded: 120 s for the refused startup to exit,
then kill by handle and fail with the daemon log, so this regression
fails instead of hanging.

MUTATIONS (RUN): classify every failure transient -> RED in 122 s
("a startup whose activation admission refuses must EXIT, and this one
was still running after 120 s"), not a hang. The seam test
a_failed_startup_activation_is_retried_not_fatal still grades the retry
half; the fingerprint rule itself is graded only by the cli_beside race
(2/8 RED before 47fb314), which is probabilistic -- stated, not hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
63fdf5e's waits were bounded only by the caller's stop predicate, and the
callers without one passed `never`. A lock held by THIS process on
another connection would never be released while the thread needing it
waited -- a hang, not a wait. (The 34-minute suite stall the coordinator
traced to this lane was a retried refusal, fixed separately; this closes
the class it was suspected of.)

`retry_busy` now gives up at `busy::WRITE_LOCK_DEADLINE` (600 s, far past
this product's longest hold, a resolve pass of tens of seconds) with a
`write_lock_deadline: ...` SQLITE_BUSY naming the wait, its duration and
the bound -- still busy-class, so every caller handles it as contention.
The uncancelled final flush in the writer loop takes the same bound.

MUTATION (RUN): drop the deadline return -> RED in
a_wait_on_a_lock_this_process_holds_ends_at_its_deadline ("the wait did
not end at its deadline: Timeout"), bounded by its own 10 s watchdog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The full run's one failure: `the_shutdown_flush_gives_up_after_its_cap`
pinned the old rule that a closed channel always caps the final flush at
two retries. 63fdf5e changed that rule on purpose -- the channel closing
is also a one-shot index's normal end, and capping its last batch is the
CLI dying "database is locked" -- and kept the cap for a CANCELLED pass.
The test ran an inert (uncancelled) control, so it graded the rule that
was deliberately removed.

It now grades both halves through `writer_loop_observed`: a cancelled
pass consumes exactly cap + 1 injected busy failures and propagates; an
uncancelled one waits every failure out and lands.

MUTATIONS (RUN): drop the cap -> RED on the cancelled half ((true, 7) vs
(false, 3)); make the cap unconditional -> RED on the uncancelled half
((false, 3) vs (true, 7)). Indexer lib: 511 passed, 0 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The docs job (cargo doc --document-private-items, -D warnings) refused
WRITE_LOCK_DEADLINE's [`write_lock_deadline_error`] link: public docs
linking a private item. Demoted to a citation with its module path, per
CLAUDE.md's rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Six isolated runs on a quiet box: wall ratio 151,148,155,159,160,157
(median ~156); blessed run 155, inside that band (a first bless attempt
read 129, an outlier, and was discarded). SQLite work DOWN vs the
schema-75 record: package vm_step 30.07M -> 28.73M (-4.5%), autoindex
22,833 -> 2,394 (lane K), fullscan_step +0.7%. The ratio rose because
the builtin leg got faster (~800 -> ~700 ms) while the package leg held
at ~1.09 s. Cold package overhead gates each language flip (operator
decision 2026-10-04), not this record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
no_package_native_indexes_preserve_prior_release_semantics failed for
python-flask with 15226 vs 15365 rows. Diffed on the test's own REF_SQL key
against the 312a242 baseline, the native leg differs by exactly 143 rows:
the 139 Python module-binding rows 5d875ea added (already admitted by the
AST audit) and 4 occurrences whose target moved from DispatchingJinjaLoader
methods to ~UNRESOLVED~ (rule 10 -> -1): templating.py:73/93
loader.get_source and :112/117 loader.list_templates. Those four are lane
P's receiver-evidence rule (8cadf3b9), blessed with a per-bind source
verdict in 71d10926 ("all old binds wrong"). Nothing else moved, so this is
the oracle lagging an intended change, not a native regression.

The Python audit now admits a withdrawn own-file bind only as an exact pair
(same nine columns, target -> ~UNRESOLVED~, baseline rule
tier1a_unique_own_file -> -1) and only where the source shows what the rule
refuses on: `receiver.name(...)` inside a method of class C, the target is
C's own method, the receiver is not self/cls, and C inherits from a base a
non-relative `from ... import` binds and the project declares as no class.
Every other row, rule and axis stays exact. The corpus run now reports 143
source-verified changes for flask, each withdrawn bind naming
DispatchingJinjaLoader and its foreign base BaseLoader.

Mutations run: dropping the foreign-base refusal admits the `Plain` site
(python_unbind_audit_requires_delegation_through_a_foreign_base red at the
unwrap_err); dropping the expected-rule adjustment fails the admitted pair
as "existing Python resolution rules changed" (red at the first unwrap).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
pinned_php_binding_diagnostic failed on php-guzzle: same 38733 rows, same
targets, different rules. Diffed on REF_RULE_SQL's key, 227 rows differ,
all under tests/Handler/ (CurlHandlerTest 16, CurlMultiHandlerTest 7,
EasyHandleTest 2, StreamHandlerTest 202): 191 tier1b_container_import (16)
and 36 tier1b_name_import (15) on the builtin leg, tier1b_file_key_import
(13) on the package leg.

Cause: the import_key_rel build added `NamespaceCandidates::targets`, the
PHP package's PSR-4 whole-module match, on top of the anchored import run.
Composer maps `GuzzleHttp\Tests\` onto `tests/`; the run refuses `Tests`
because no directory is spelled that way, so the builtin reaches those
files only through the name/container arms, while the package alone got
file-key reachability from composer.json. Same binds, different
provenance: a first-party package that is not builtin-equivalent. The
type's own contract already said a ready layout "retains the profile's
native reachability heuristic", and psr4_vs_builtin.rs says moving the
resolver onto the map is a bind-for-bind question of its own.

The layout now only withholds (refused, withheld, unmapped or
source-inconsistent files lose the filename guess) and adds nothing.
pinned_php_binding_diagnostic and no_package_native_indexes_preserve_prior_
release_semantics both pass; the native leg is untouched by construction
(builtin files have no layout).

New fixture test php_psr4_layout_adds_no_reachability_the_builtin_lacks
reproduces the guzzle shape without the corpus (non-vacuity: the layout
row for tests/Helper.php is ready and the builtin binds the site).
Mutation run: restoring index.rs and module_map.rs from 3aa93cb turns it
red on tests/Unit/ServiceTest.php Helper, rule 15 vs 13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
python-flask's cold package index took 30.5 s against 1.0 s native (30.6x);
py-django's packages-only CLI index took 1,155 s against ~51 s. Per-phase
debug timing put 27.3 s of flask's 30.5 s in setup_groups_buckets_stats,
and an Instant around the single statement put 27.2 s of that in the
INSERT INTO temp.python_layout_denied_refs. The native leg owns no layout
and never runs it.

The statement's binding arm (nearest binding of the receiver, a MAX probe
and an enclosing-symbol probe) sat inside EXISTS(... python_import_origin
p ...) as a fourth OR arm, so it re-ran for every unresolved import binding
of the ref's file although only its last comparison reads p. It is hoisted:
EXISTS p (A(p) OR EXISTS b (B(b) AND C(b,p))) ==
EXISTS p A(p) OR EXISTS b (B(b) AND EXISTS p C(b,p)), plus a necessary-
condition prefilter (ungated, so a superset) of (file, name) pairs whose
bindings an unresolved import of their own file types.

Equivalence, measured: with both statements run side by side in the same
pass on flask, each denied the same 2,793 refs (0 old-only, 0 new-only),
and the package leg's REF_SQL and REF_RULE_SQL projections are
byte-identical before and after. Results (contended box, single runs):
flask package 30.5 s -> 4.1 s (native 1.1 s; the step 27.3 s -> 0.23 s);
py-django package 44.5 s vs native 36.2 s in the same harness.

Mutation run: emptying the prefilter (WHERE 0) turns both
layout_withholding_blocks_foreign_imports_without_losing_local_facts and
module_bindings_cannot_carry_withheld_imports_into_mapped_members red
("withheld type or import contaminated resolution": x.member() binds), so
the hoisted binding arm is graded by existing tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Bounded one-shot calls could not drain a stale outline's queue on pinned
Django: every durable batch of 4,096 refs cost 7.4 s, almost all of it a
whole pass's fixed cost, so a 10 s call committed at most one batch and
477,379 queued refs needed ~117 of them.

- local_scope's candidate scan is driven from temp.resolve_resume_batch
  inside a batch. Files-first, the batch's `refs.id IN (...)` fragment was
  probed once per (file, batch row): 3.5 s per batch, against 2 ms.
- import_key_rel and python_layout_tainted_names are built for the
  batch's own files only (resolve_resume::batch_files_pred). Every reader
  joins them on the file of a ref the pass decides; building them for
  every file cost 1.3 s and 0.4 s per batch.
- resolve_resume::in_batch is the one definition of "deciding a batch".

Measured on Django (packages-only release): a batch 7.4 s -> ~2.6 s; the
Django probe drained 33,614 stale names / 477,379 refs in 45 one-shot
calls (each <= 10.05 s) with an exact oracle match on bindings, rules,
ref counts and edge weights. A CLI drain of the same queue also matched
the oracle exactly. The atomic (non-batch) path is unchanged.

Tests (mutations run):
- local_scope::a_durable_batch_drives_the_candidate_scan_from_the_batch
  (files-first FROM for a batch -> RED)
- resolve_resume::stale_names_drain_in_slices_across_kills_to_the_
  uninterrupted_projection (whole queue in one slice -> RED;
  import_key_rel built for no batch file -> RED)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
The field report: `Themes/Icons.xaml` and DevExpress's
`Pie2DModels.xaml` carried `extract.unsupported_syntax` and read as
"only partly indexed". The issue suspected both ceilings in
_prdoc/records/80-S12 §5.

WHAT FIRED, MEASURED AGAINST 0.2.0. Only the 4,096-byte NAME ceiling,
and on attributes the extractor never reports. It ran on every quoted
attribute value BEFORE the extractor asked whether the attribute was one
it emits, so one `Data="M0,0 L…"` / `Figures` / `Points` past 4 KiB set
the diagnostic. The scan then continued: nothing was lost, the
diagnostic was simply false.

The 196,608-byte BODY ceiling did not fire and never could have said
`unsupported_syntax`: it was 0.1.0's bare `$bp > 196608`, it reported
`extract.node_limit_reached` (the output code) in 0.1.0 as now, and
0.2.0 (#222/#223) had already replaced it with `$max_fact_bytes` =
2 MiB. The issue read two ceilings out of one sentence of §5.

And the "keys missing after the cut" had a third cause: 0.2.0 extracted
no `x:Key` and no `{StaticResource}` at all.

THE DESIGN.
  * Name ceiling scoped to values the extractor REPORTS (`x:Class`,
    `x:Name`, `x:Key`, handlers, simple binding paths, resource keys).
    The 300 KB `x:Name` of §5 is still declined, file intact.
  * `x:Key` -> `field` symbol, visibility `module`; `{StaticResource K}`
    and `{DynamicResource K}` -> `read` ref. Chosen TOGETHER against the
    resolver's pool classes: `read` lands in the MEMBER pool, which
    admits a field; binding paths (`member_access`) and handlers (`call`)
    land in the VALUE pool, which excludes one — so `{Binding Title}`
    cannot bind to a key spelled `Title`. Implicit-style keys
    (`x:Key="{x:Type Button}"`) and `{StaticResource ResourceKey=…}` mint
    nothing.
  * The manifest now requests `same_file_candidate` and
    `exported_candidate`, without which no key can be bound to.
  * The body ceiling stays: `$max_fact_bytes` is sized for
    FILE_SIZE_LIMIT_BYTES per the #228 doctrine every guest SDK follows,
    and past it reports `extract.node_limit_reached`, the SDK's "reply
    buffer ran out" and the code Ruby/Rust/TimeLine report for the same
    condition. A new `extract.fact_budget_reached` would be a second
    spelling of it for one package.

TWO LIMITS FOUND AND LEFT, BOTH ASSERTED.
  * Cross-DIRECTORY resource references stay unbound: tier 1b (I021)
    binds a unique candidate in another file only when it is reachable
    (same directory, or an import), and this package does not report the
    merged-dictionary graph. Pinned as a tripwire in the e2e test.
  * 2,000 x 6 KB = 12 MB of long attributes costs 20.6 s of the 30 s
    WALL_CLOCK_BUDGET even in a RELEASE plugin host (6 MB 10.0 s, 1.9 MB
    3.1 s, linear), and in the debug host the 12 MB e2e was refused
    `host.deadline_exceeded (process)` in 3 of 9 runs. So the gate's
    fixture keeps the shape (2,000 entries, 4,001 keys, fifty ~6 KB
    attributes) at 1.8 MB, inside the default cap where the reporter's
    files were.

PACKAGE VERSION BUMP 0.2.0 -> 0.3.0. extractor.wasm re-derived with the
locked `wat` 1.258.0 (2191 bytes, sha256 1e2e581c…, re-pinned in
grammar_provenance); a third fixture `Resources.xaml`/`.expected` so
`plugin check` grades keys, references, decoys and a 4,415-byte `Data`
with `diagnostics = []`. Packed twice from two directories: byte-identical.

  package_digest       sha256:f4770234fa8d82c5369f4bc64a1fd510660c767a29d9413cfa76026d6f98a0e5
  extraction_identity  sha256:de062e47230b360de4c99e8d5d51613988a37e5d84bb6d92632b6c2be26cd515

xaml.digest re-recorded from `code-index plugin pack` + `digest`; the
catalog row's key, archive and URLs moved to 0.3.0 by hand (a release
edit, which package_records refuses to invent) and its two identities
DERIVED by `package_records -- --write`. host_extraction_epoch.json
re-blessed through COSI_BLESS_HOST_EPOCH (the digest moved, so the gate
admits it).

LEFT RED, BECAUSE THE FIX IS NOT MINE TO MAKE:
  * first_party_anchor (4 tests): tests/packages/xaml.cips is the
    offline first-party signature over the RECORDED digest; it must be
    re-signed with the offline key over sha256:f4770234….
  * package_baseline: the three xaml CONDITIONS moved. Re-measured into
    the file and restored from an md5-verified snapshot: outcome
    `conditions_only`, `diff: []` — no count moved. Needs
    COSI_PACKAGE_BLESS=1 with a reason; tests/corpus baselines are not
    moved by this lane.

GENERIC FIXES the bump exposed: one `xaml_fixture_entries()` list where
three test files spelled the fixture set by hand; registry_schema_gate,
package_release_scripts and agent_task_plugin_bench keyed on the literal
"0.2.0", a digest prefix, or a whole `capability_withheld` line, and now
read the field, the record, or the list.

MUTATIONS (RUN), each RED:
  name ceiling back above the "reported?" test   e2e: Some(["extract.unsupported_syntax"]);
                                                 unreported-attr test; C2 outcome Failed
  $max_fact_bytes -> 194536 (0.1.0's guard)      e2e: (2418, 2416, 2416) + node_limit_reached,
                                                 last key unbound
  attribute-arm ceiling deleted                  oversized test: fact.string_too_long
  $report_ref ceiling deleted                    oversized test, {Binding} leg
  resource refs as member_access                 e2e: (4001, 4000, 0), nothing binds
  x:Key visibility file                          e2e: same-file binds, gallery unbound
  binding paths as read                          e2e: decoy binds to the key
  x:Key arm never arms                           C2 outcome Failed

RELEASE NOTE, required: "`de.h-dv.xaml` is now 0.3.0 and its digest has
MOVED to sha256:f4770234fa8d82c5369f4bc64a1fd510660c767a29d9413cfa76026d6f98a0e5.
Re-pin it. It now indexes `x:Key` resource keys and
`{StaticResource}`/`{DynamicResource}` references, and requests
`same_file_candidate` and `exported_candidate` so they can bind. A long
geometry attribute no longer reports `extract.unsupported_syntax`. The
extraction_identity moved, so every project with this package enabled
re-extracts its `.xaml` files once."

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`code-index index` records no first-start decision; the first MCP or
one-shot start then writes `.code-index/languages.toml`. The identity
hashed the table's TEXT (`languages enabled=... owners=...`), so on a
Python-only project `enabled=*` -> `enabled=["python"]` moved the digest
and requested an isolated rebuild of every file (6,984 on pinned Django),
which a --no-daemon one-shot can never finish inside a 10 s call.

[languages] acts on exactly one mechanism: whether an active package's
consented [[displaces]] takes effect (filter_displaced). Everything else
a path's owner depends on is already in the identity (host_version,
package_digest, grants). So the identity now carries
`activation::routing_config`: one `<builtin>=<package key>` line per
displacement in force, from the live set's (or the approval record's)
effective `displaces`, omitted when empty. Two tables that route alike
are one activation; an owner switch or enabling a displaced language
still builds a generation. The identity stays tree-independent, as
activation_digest's doc requires: a file census would move it when a
file appears.

Tests: indexer identity and generation tests over a real displacing
package, a builtins-only identity test for every table text, a CLI e2e
(Python-only `index` then a first one-shot start builds no generation),
Lane M's e2e without its first_start_enablement workaround, and
query_cli's two-one-shot race now staging a real activation change
(it had relied on the defect). Django probe unmodified: 43 calls,
exact oracle match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
R2 (6abb7721) moved the candidate SELECT out of local_scope::build so a
durable batch can drive it. The registry still declared build's old
kinds and had no row for candidate_sql, so both stance gates were red
on p2-integration. build now names only 'binding'; candidate_sql
carries the import-excluded / access-reaches stance unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Operator decision: nobody re-signs XAML 0.3.0; the release job signs
released packages with the Forgejo secret. So the anchor test must stop
depending on a signature over the LIVE package, which turned four anchor
tests red on every XAML version bump.

THE FIXTURE. tests/packages/first-party-anchor/de.h-dv.xaml-0.2.0.cip is
`tests/packages/xaml` exactly as at 3aa93cb1 (`git archive`, packed with
`plugin pack --expect-digest`: MATCHED, 7 entries, 60,921 bytes,
package_digest sha256:7b572f5cc32ffcd5af550900a451bbef37e255804776d7e3e3e71d2dd7d0aa79).
Its .cips is `git show 3aa93cb1:tests/packages/xaml.cips`, byte-identical.
VERIFIED: `plugin install --sha256 sha256:7b572f5c…` into a store with
an EMPTY trust directory exits 0 — the compiled-in anchor alone accepts
it. Frozen on purpose, never re-signed: any first-party-signed archive
proves the anchor.

THE TEST installs that archive instead of packing the live directory.
FROZEN_DIGEST is pinned as a literal (xaml.digest describes the live
package and moves with it); every arm keeps its meaning — empty trust
store installs, withdrawing the builtin refuses signature_untrusted, a
stranger is refused and the same bytes with the first-party .cips
install. Module doc, tests/packages/README.md updated.

tests/packages/xaml.cips REMOVED: first_party_anchor.rs was its only
reader. test-support/src/pkg.rs and tests/signed_packages.rs only use
the NAME `de.h-dv.xaml.cips` in a path example; release.yml signs fresh
in the job and reads no committed .cips. (Found by git grep: the
code-index daemon could not start — installed binary supports schema
v73, the index DB is v78.)

package_baseline BLESSED, operator-approved, reason "XAML 0.2.0→0.3.0
for #312: only the package version and its two digests moved; no repo
count, rule, influence, gen or stage delta". outcome conditions_only,
diff [], identity 5405bdc6… -> 35ef683d…; the only `activation` keys
that moved are xaml.package_version, xaml.package_digest and
xaml.extraction_identity.

MUTATIONS (RUN), restored by md5-verified cp + touch:
  flip one byte of the frozen .cips      RED 4/9, signature_invalid
  stranger-signed .cips, same archive    RED 4/9, signature_untrusted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Bump every version site to 0.33.0 (version_bump.sh, 8 sites).

version_bump.sh no longer treats a package's requires_host floor as a
version site. All seven first-party manifests carried a floor equal to
the old workspace version, so the scan listed them and the rewrite
raised the floor, which would refuse every older host that still works
and move all seven package digests (catalog, records, baselines) for
nothing. Measured in a scratch worktree: old script rewrote 7
plugin.toml files, the fixed one rewrites 0 and still bumps all 8 sites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Example versions move off 0.33.0, which is now a real release
Some checks failed
CI / cargo fmt (pull_request) Successful in 51s
CI / OSS corpus tier-3 scale (nightly) (pull_request) Has been skipped
CI / Grammar rebuild from source (nightly) (pull_request) Has been skipped
CI / guest crates (fmt, clippy, doc) (pull_request) Successful in 57s
CI / CI lane wall-clock headroom (pull_request) Successful in 1m10s
CI / cargo doc (intra-doc links) (pull_request) Successful in 5m7s
CI / cargo deny (pull_request) Successful in 5m46s
CI / cargo test (abi, 32-bit + wasm32) (pull_request) Successful in 6m26s
CI / cargo check (MSRV 1.98) (pull_request) Successful in 6m37s
CI / cargo clippy (pull_request) Successful in 6m44s
CI / cargo check (windows-gnu) (pull_request) Successful in 7m0s
CI / OSS corpus (tier 1) (pull_request) Successful in 30m59s
CI / cargo test (pull_request) Failing after 50m6s
CI / cargo test (daemon transport) (pull_request) Has been skipped
CI / Plugin path cost + pool throughput (nightly) (pull_request) Has been skipped
CI (Windows) / fmt + clippy + build + test (windows) (pull_request) Failing after 1h12m50s
5e4c602bb2
version_site_registry: seven files spelled 0.33.0 as an illustrative
'future' version in requires_host examples, comparator tables, a
script usage comment and a workflow comment. With the workspace at
0.33.0 they read as undeclared bump sites. They are not sites, so the
examples now use a far-away fictional 2.x/3.x (orderings unchanged
row for row) and the two shell/workflow comments say vX.Y.Z. The real
0.32.1 host in registry.rs's newest_compatible fixture is untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
rustc spells a dependency's absolute source path into every panic
location it keeps, as DATA. Every language extractor carried 17 of
them under /home/master/.cargo/registry/src/..., so CI (CARGO_HOME
/usr/local/cargo) rebuilt all nine 48-56 bytes shorter and the v0.33.0
candidate went red in grammar_provenance and ruby_guest_wire, while
both were green on the machine that built them.

One rule, one implementation: `build.py --print-rustflags` yields
CARGO_ENCODED_RUSTFLAGS remapping the repository root to /src,
CARGO_HOME (default ~/.cargo) to /cargo and the target dir to
/target. build.py uses it for the nine language lanes (ruby/build.sh
delegates there); svelte, timeline and example build.sh take it from
there, and the two tests that re-run a build.sh (timeline_guest_rebuild,
guest_globals) pass the same value. CARGO_ENCODED_RUSTFLAGS outranks
RUSTFLAGS and build.rustflags, so an inherited flag cannot reach a
guest either. svelte, timeline and the example guest rebuild
byte-identical under it (no path reached them before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
no_checked_in_wasm_embeds_a_builder_path (grammar_provenance) reads every
committed .wasm for a path that names its builder: /home/, /Users/,
:\Users\, \.cargo\, /root/, /usr/local/cargo, .cargo/registry, this
checkout's root, the running CARGO_HOME, and any index.crates.io- path
not under the remapped /cargo/registry/src/ prefix. Anti-vacuity: at
least the build.py extractor count must carry the remapped spelling.
It sees the CI-only failure LOCALLY, with no rebuild.

  - against the candidate's bytes, unmodified: RED, all nine, 68 hits each
  - MUTATION (RUN): remap_rustflags returning "" and rebuilt: RED, the
    same nine; the mutated build reproduced the old shipped bytes exactly
    (csharp b9c1761a, ruby bb5f9529). Restored (md5-verified), rebuilt:
    green.

build_py_components now recognises delegation as an `exec` of build.py:
svelte and timeline build.sh NAME build.py for --print-rustflags, and
the old substring test classified them as build.py packages (11, not 9).

Bytes: each extractor 216-224 bytes smaller (17 registry paths, now
/cargo/...). Identical from a second checkout at another path under a
copied CARGO_HOME at another, longer path, with a third target dir.
Versions: csharp, javascript, php, python, rust, typescript 0.1.0 ->
0.1.1; ruby 0.8.0 -> 0.8.1. WASM_ARTIFACTS rows, .digest records and
the catalog re-derived (package_records --write; rows rekeyed by hand,
as that example refuses to invent a version row).

host_extraction_epoch.json: re-recorded with COSI_BLESS_HOST_EPOCH=1;
only the seven package_digest values moved, every fingerprint, fixture
and row count unchanged, so no epoch bump.

package-baseline.json: COSI_PACKAGE_BLESS, outcome conditions_only,
diff [] -- only ruby's version, package_digest and extraction_identity
moved. Reason: "guest wasm made path-independent (remap-path-prefix);
bytes moved, no behaviour delta" (operator pre-approved).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
PR #316 Windows CI (run 952, job 39106): both index_access_denied_e2e
tests answered `warming_up` ("still loading ... subsequent calls succeed
automatically") instead of `index_unavailable_permission`. The same
tests PASSED on Windows at 71ab5c5 (run 943, 2026-10-04 13:12); the
regression is 1c5436a8, which made every not-ready probe stand down
while this process's own open is in flight (`probe_db_path`).

Why only Windows: SQLite's Windows VFS retries ERROR_ACCESS_DENIED in
winOpen (`winRetryIoerr`, 10 tries x 25 ms steps, ~1.4 s per open), and
a refused `db::open` opens more than once (its own open, then the
probe's `sqlite_can_write`). The refused open therefore stays in flight
past the 2 s tool wait, every probe skipped it, and the route answered
`warming_up` - on the snapshot leg directly, on the daemon leg through
the startup-backoff fallback into `single_process`. On Unix the refused
open returns in microseconds, so the window never showed.

Fix:
- `single_process` classifies access BEFORE `begin_local_open`
  (`perms::index_access_denied`), while this process holds no
  connection to the file, and fills the slot with the named, permanent
  refusal without entering the open. Calls racing it are outside the
  guard, so they probe for themselves.
- The route's last look after the poll now asks `index_access_refusal`
  too, as its comment already promised ("the SAME refusals the fast
  path makes"): an open that failed for this reason during the poll
  was answered `project_not_available` or `warming_up`.

Test seam: `perms::SLOW_REFUSED_OPEN_ENV` (debug builds only) makes a
refused `db::open` return late, staging the Windows window on any OS.
index_access_denied_e2e sets it (4 s) on every platform.

MUTATIONS (RUN, Linux, non-root and COSI_TEST_AS_ROOT=1 arms):
- delete the pre-open refusal in `single_process` -> RED on both tests:
  `snapshot/search_symbols` and `call 11` answer "warming_up", the
  Windows failure reproduced on Linux.
- the last-look refusal is masked by the first; graded in combination:
  with the first deleted and the seam at 1000 ms the snapshot leg
  passes, deleting the last look too -> RED (`project_not_available`).

Self-diagnosing: a failure now prints the server's own stderr (captured
to a file, `info,code_index_mcp=debug`, read after the open had time to
return: `local open began/returned` with its error and duration, each
probe that stood down), daemon.log, daemon.exit, and
`index_access_denied(db)` called from the test process with its timing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Merge branch 'w2-windows-permission': a denied index is refused before the local open, on Windows too
Some checks failed
CI / cargo fmt (pull_request) Successful in 52s
CI / OSS corpus tier-3 scale (nightly) (pull_request) Has been skipped
CI / Grammar rebuild from source (nightly) (pull_request) Has been skipped
CI / guest crates (fmt, clippy, doc) (pull_request) Successful in 1m1s
CI / CI lane wall-clock headroom (pull_request) Successful in 1m2s
CI / cargo doc (intra-doc links) (pull_request) Successful in 5m31s
CI / cargo clippy (pull_request) Successful in 5m56s
CI / cargo check (MSRV 1.98) (pull_request) Successful in 6m27s
CI / cargo test (abi, 32-bit + wasm32) (pull_request) Successful in 6m37s
CI / cargo check (windows-gnu) (pull_request) Successful in 6m57s
CI / cargo deny (pull_request) Successful in 7m27s
CI / OSS corpus (tier 1) (pull_request) Failing after 30m33s
CI / cargo test (pull_request) Successful in 49m54s
CI / cargo test (daemon transport) (pull_request) Successful in 11m46s
CI / Plugin path cost + pool throughput (nightly) (pull_request) Has been skipped
CI (Windows) / fmt + clippy + build + test (windows) (pull_request) Failing after 1h13m10s
a74a9a1c1e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Lane R rebuilt the Ruby guest wasm path-independent, which moved its
bytes and its package version but no behaviour. The band's conditions
check refused the old record (measured under 0.8.0), as designed.
Re-measured isolated on a quiet box: warm wall ratios 141,160,154,138,
151,167 (median ~152); blessed at 157, the attempt nearest that
median. SQLite work unchanged (package vm_step +0.01%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Two Windows-only failures in PR #316 run 5710 (job 39122, a74a9a1c),
both passing on Linux, both reproduced on Linux here by staging the
Windows timing.

1. schema_newer_refusal_e2e, snapshot leg, answered project_not_available
   with the RAW chain "opening database ...: schema migration failed at
   version 79" instead of the named schema refusal. The first call
   arrived while single_process's own open was in flight, so the
   not-ready probes stood down; the open then failed inside the 2 s
   wait, and routed_index's last look answered the stored error
   (`Some(Err) if !can_reattach => resolve_slot`) BEFORE it asked
   schema_skew_refusal. w2's pre-open access check made the window
   reachable on Windows (one more SQLite open before the local one).
   Fix, structural:
   - `pre_open_refusal` (main.rs): single_process asks BOTH permanent
     classifications - access, then schema newer than this build -
     before `begin_local_open`, and fills the slot with the named cause.
   - `CodeIndexServer::permanent_refusal` (server.rs): one set, asked by
     BOTH looks of routed_index, and on the last look BEFORE any stored
     error is answered.

2. index_state_disclosure_e2e's first answer had results but no
   `index_state`. Not from w2: the daemon serves before package
   discovery fills its ProjectExtractors, and until then `path_claims`
   answers None - which carried the lifecycle away, so answers in that
   window lost the disclosure although the daemon is by construction
   still reconciling. Windows discovery is slow enough to land the first
   answer there. Fix: `index_state_of` asks `stats().state` (the same
   process lifecycle) when a live daemon's `path_claims` is None; the
   steady path never pays for it.

Seams (debug builds only): `perms::SLOW_FAILED_OPEN_ENV` (replaces w2's
SLOW_REFUSED_OPEN_ENV) delays any FAILED db::open; the daemon's
`eligibility::PACKAGE_DISCOVERY_DELAY_ENV` holds package discovery.
schema_newer_refusal_e2e and index_access_denied_e2e set the first (4 s),
index_state_disclosure_e2e's first test the second (3 s).

MUTATIONS (RUN, Linux; restored by md5-verified snapshot):
- `pre_open_refusal` -> None: RED in schema_newer_refusal_e2e (snapshot
  leg `warming_up`) and in both index_access_denied_e2e tests.
- the last look restored to answer a stored error first, on top of the
  above with the seam at 1000 ms: RED with exactly the Windows payload
  (`project_not_available`, hint "opening database ...: schema migration
  failed at version 79 ..."); the same with the last look intact: green.
- `index_state_of` answering a daemon's Ok(None) as Ok(None): RED,
  `index_state` null on the first answer - the Windows failure.

schema_newer_refusal_e2e now prints, on failure, the server's captured
stderr (info,code_index_mcp=debug: local open began/returned with its
error, each probe that stood down), daemon.log, and the schema the test
process reads from the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Merge branch 'w2b-windows-ordering': permanent refusals before stored errors; index_state during package discovery
Some checks failed
CI / cargo fmt (pull_request) Successful in 51s
CI / OSS corpus tier-3 scale (nightly) (pull_request) Has been skipped
CI / Grammar rebuild from source (nightly) (pull_request) Has been skipped
CI / CI lane wall-clock headroom (pull_request) Successful in 1m20s
CI / guest crates (fmt, clippy, doc) (pull_request) Successful in 1m31s
CI / cargo doc (intra-doc links) (pull_request) Successful in 5m18s
CI / cargo check (MSRV 1.98) (pull_request) Successful in 6m22s
CI / cargo clippy (pull_request) Successful in 6m35s
CI / cargo deny (pull_request) Successful in 6m51s
CI / cargo test (abi, 32-bit + wasm32) (pull_request) Successful in 6m55s
CI / cargo check (windows-gnu) (pull_request) Successful in 7m3s
CI / OSS corpus (tier 1) (pull_request) Successful in 31m0s
CI / cargo test (pull_request) Failing after 50m20s
CI / cargo test (daemon transport) (pull_request) Has been skipped
CI / Plugin path cost + pool throughput (nightly) (pull_request) Has been skipped
CI (Windows) / fmt + clippy + build + test (windows) (pull_request) Failing after 1h12m57s
9ad0d97a2e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
ruby-package-cost: the bless reason must not spell the release version
All checks were successful
CI / cargo fmt (pull_request) Successful in 52s
CI / OSS corpus tier-3 scale (nightly) (pull_request) Has been skipped
CI / Grammar rebuild from source (nightly) (pull_request) Has been skipped
CI / guest crates (fmt, clippy, doc) (pull_request) Successful in 1m10s
CI / CI lane wall-clock headroom (pull_request) Successful in 1m26s
CI / cargo doc (intra-doc links) (pull_request) Successful in 5m9s
CI / cargo deny (pull_request) Successful in 5m53s
CI / cargo test (abi, 32-bit + wasm32) (pull_request) Successful in 6m27s
CI / cargo check (MSRV 1.98) (pull_request) Successful in 6m36s
CI / cargo clippy (pull_request) Successful in 6m45s
CI / cargo check (windows-gnu) (pull_request) Successful in 7m0s
CI / OSS corpus (tier 1) (pull_request) Successful in 30m43s
CI / cargo test (pull_request) Successful in 50m15s
CI / cargo test (daemon transport) (pull_request) Successful in 11m51s
CI / Plugin path cost + pool throughput (nightly) (pull_request) Has been skipped
CI (Windows) / fmt + clippy + build + test (windows) (pull_request) Successful in 1h22m36s
73e31f4011
version_site_registry treats any file naming the current release as an
undeclared bump site. The reason text is history, so it names the round
instead of the version number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
buildagent deleted branch release-v0.33.0 2026-10-05 17:20:06 +02:00
buildagent referenced this pull request from a commit 2026-10-05 17:20:08 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index!316
No description provided.