Skip to content

test(lifecycle): corpus train 5 (T-1/T-2/T-3/T-6a drain; baseline 531 -> 37) - #4758

Merged
Daniel Meppiel (danielmeppiel) merged 74 commits into
mainfrom
ql/corpus-train-5
Nov 23, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 74 commits into
mainfrom
ql/corpus-train-5

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Corpus train 5, on main 4a1f9fd. Only Q&L cars ride (the dissolved lapse train #4725 is not included). Each car was folded with --no-ff or carried as its net diff, and the ledger was regenerated after every fold, never hand-merged. It also folds the stacked credit-integrity follow-up #4756 (merge it first or with this train).

car branch @ head effect
W4 T-1 remainder danielmeppiel-t1-remainder @8fb753cad5c T-1: 56 -> 6 baseline (the rest are excluded by documented rules)
W1 T-2 b5 (#4723, closed; rides here) + b6 + b7 + b8 ql-w1-t2-b5 @78620c73a93, b6 net diff @66fa19c30bc, ql-w1-t2-b7 @7bb6968e9c2, ql-w1-t2-b8 @07dc404b6c2 M-SOURCE audit and approve/deny per source (R5); GATE levels with install and marketplace update; remote p-lsp; canvas/LSP from git, catalog and registry; native exec plugin; lock/compile keep local bundles
Gate-level flips (W2) b07ed32 bundle canvas cell; bundle and pack spines gain a denied-dependency level (install and pack refuse; nothing changes or ships); successful bundle installs credit SRC=local-bundle
Hook re-park witness (W2) e2059af test_m_gate.py::test_an_approved_hook_reparks_when_any_file_of_its_bundle_changes (P-OWN-executable-item-admission)
Witness-picker fix (W2) c60054c, 5311693 see below
W4 T-3 remainder danielmeppiel-w4-t3-remainder @79bf0ea5dbb user scope, DEPLOYED=absent and pack lock-state scenarios; T-3 added to SCENARIO_LANES
W3b T-3 LOCK lane + T-6a history danielmeppiel-ql-t3-lock-lane-w3b @6dfce50ca60 T-3 LOCK pairs; T-6a target and MCP-ownership history; rule U-MCPOWN-USER
T-6a plugin bin x TGT (W2b) 6b54456 test_user_scope.py::test_a_target_change_keeps_a_plugin_bin_only_while_claude_is_declared: 3 required + 1 strict known (#4744)
Credit-integrity follow-up #4756 @7302d8ef lane routing of unchanged TGT, user-scope gate on, per-target file routes (no status change)
ledger main train 5
baseline 525 41
required 1921 2383
known-failing 1 3

Baseline by lane after the train: T-1 9, T-2 30, T-6b 1 (T-3, T-6a, T-6c, T-6e, T-7b empty).

No cell moves from required to baseline against main except the 6 U-BIN-OPS removals below (checked id by id).

Removals by rule (no witnessed cell lost):

Witness-picker fix (tests/lifecycle/generator/witnesses.py::machine_witnesses): when two spines imply the same cell, a passing spine now wins over a spine whose implying cells are all strict known cells. Before the fix, 5 project-matrix pairs regressed to known-failing (#3703) only because the user-scope bin spine sorted first by node id. Regression test: test_generator_rules.py::test_a_strict_only_spine_never_hides_a_passing_spine.

Known cells (L15, checked live at this head): #3703, #4626 and #4874 are OPEN. #4744 was closed by #4751, so the user-scope bin target-change cell is required. #4759 was closed by #4803, so pair|SRC=inline-mcp|DEPLOYED=unowned is required, crediting only SRC as a refusal (H2). #4874 is new from this train: after a target narrowing, apm install leaves the dropped harness enabling a whole native plugin. It is a strict Known on its own row; #4895 fixes it, and whichever lands second drops the Known.

Review fixes (Copilot, 7 threads): other-file credits need the instruction on disk under every declared target and in the lock; the scenario kit observes a user-scope Claude skill, assert_deployed fails when an undeclared target keeps an exclusive surface, and a shared MCP oracle checks requested servers are declared, locked and configured; the user-scope registry source configures APM_HOME's manifest and asserts a registry lock row; pack's stale-lock row proves lock-based packing against an approved-LSP control; the target-history bundle row models the bundle so I4 observes its executables.

Honest drop (review round 3): T1|OP=pack|PRIM=skill|GATE=revoked-after-deploy returns to baseline. Its only credit came from a skill-only package labeled with the spine's level; a plain file reads that level only beside a revoked executable (U2).

Review rounds 2-3 (Copilot, 11 threads): MCP rows prove the requested server is declared, locked and configured; the user-scope native plugin earns its source credit only after approval, with a lock row and an enabled Claude settings entry; three new scenario modules join lifecycle_smoke; Claude's project LSP plugin is an observed surface (with a negative control); the target-history pack row checks the bundle it wrote; allowed-gate drifted-lock rows check deployment on their own step; the MCP-ownership uninstall row requires pkg to leave the lock. The M-SOURCE instruction uses a file-type glob after #4005 (as main's test_file_routing does).

Review rounds 4-6 (Copilot, 13 threads): entry-aware surfaces for Claude and Copilot MCP/LSP, and for Claude and Gemini merged hooks (registered entries with sidecar ownership, dependency and local-bundle markers), each with negative controls; unowned stale/absent lock rows are skill-collision refusals; drift repair restores lock rows; the offline kinds row proves a whole native plugin (skill inside the root, enabledPlugins per harness); a dropped target that still enables a whole plugin keeps a cell; the live approve-scan proof moved to an e2e module.

CI durations seed: .github/ci-durations/linux-x86_64.json gains 51 measured lifecycle node durations (M-SOURCE spine weighted 600 s). Without them the balancer weighed both machine modules at the mean and Lifecycle Smoke shard 4 hit its 15-min timeout.

Integration notes:

  • Generator rules: the U-BIN-OPS and U-MCPOWN-USER checks were both kept (they name disjoint cells; test_definition_rule_removes_exactly_the_cells_its_text_names proves each).
  • Assertion-quality ratchet: two folded tests asserted only through in-process readers. The U-MCPOWN-USER test now also checks the ledger records exactly the retired-owner removals, and the DEPLOYED=absent uninstall test reads the lockfile on disk.
  • No E01 journey file is touched.
  • Added PR-shard wall time: M-SOURCE spine about +240 s (b6). Scenario modules added: test_user_scope, test_deployed_absent, test_pack_lock_states, test_lock_states, test_mcp_ownership_history, test_target_history_sources (timings in the Integration run).

Issue and approved scope

Issue: Refs #4564 (0.38 burn-down; done when baseline <= 500 on main), Refs #4565 (epic)

Human scope-approval comment: #4564 (comment)

Does this PR complete the issue? It takes the baseline to 41, which meets #4564's done-when (<= 500). Closing #4564 stays with the maintainer once this lands on main with CI green.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Local (through host_guard, real CLI, -n 2): before the main merge, the car sets passed (572, then 196 and 111 on the folds); a full local run on this head is in progress. python -m tests.lifecycle.generator --check and python -m tests.lifecycle.witnesses are up to date. The obligation-status ratchet, assertion-quality ratchet, duplicate ratchet, complexity ratchet, R0801, tests.quality.taxonomy --changed, the auth-signal lint and [email protected] check/format are clean. CI and Integration run the full suites.

Changelog

  • One fragment per section, changelog.d/<pr>.<section>.md, holding
    one line: user-visible effect first, 25 words or fewer, ending with
    (#PR); breaking changes only under upgrade notes; no Highlights; no
    new lines under ## [Unreleased]. See changelog.d/README.md and
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

Review round 7: four witnesses tightened (native plugin files on disk; srv2 for every stale-lock MCP owner; both user lock rows after the approved executable install). G1|mcp-install|bin|denied-dependency|user and G1|lock|bin|denied-dependency|user move from known (#3703) to required: install --mcp (U7) and apm lock (reference/cli/lock.md) keep bin/ byte-identical at every gate level, and the org deny targets the plugin.

#4874 flip (H4): #4895 landed first, so this train drops the strict #4874 known cell on test_a_narrowed_target_retires_a_whole_plugins_enable_entry; it is now required.

audit x bin (review): audit is no longer exempt under U-BIN-OPS; its drift replay fingerprints a whole native plugin's root (drift.verify_claude_native_cache). Four T1|OP=audit|PRIM=bin gate levels are required via the covering rows; GATE=none is honest baseline (+1, 40 -> 41). #4894 tracks the whole-plugin audit/prune row.

… now required

Merge main (keep U11 and U-FIRST-PARTY-MCP), drop the #4636 strict cells and
the uninstall output cell, credit every uninstall history row, regenerate.

Refs #4100, #4565

Co-authored-by: Copilot App <[email protected]>
…les and marketplaces

Seven first-command-after-a-target-change rows x four TGT changes, and fix
the history row CREDITS keys (pytest ids are row-tgt; 48 credits named
nodes that never ran). New quality guard: every scenario credit names a
collected node (negative control: the old keys fail it). T-6a 101 -> 165
required.

Refs #4100, #4565

Co-authored-by: Copilot App <[email protected]>
Three MCP owners (current .mcp.json, legacy .github/mcp.json receipts,
removed-vscode .vscode/mcp.json) from the 0.36.0 fixtures, one command per
row: heal on install/update/stale-lock install, keep the retired file on
uninstall/prune/install --mcp/lockless install; a newer-generator lock is
refused for every owner. U-MCPOWN-USER (lead ruling) removes user-scope x
retired owner, bound to split_mcp_claims(user_scope=True) with a negative
control. T-6a 165 -> 196 required (6 left, unchanged-TGT cells T-6e covers).

Refs #4100, #4565

Co-authored-by: Copilot App <[email protected]>
…t-lane

# Conflicts:
#	tests/lifecycle/generator/rules.py
#	tests/lifecycle/generator/witnesses.py
#	tests/lifecycle/scenarios/test_history_upgrade.py
#	tests/quality/lifecycle_obligations.json
… cells)

The user-scope bin spine gains a denied-dependency segment: the org
policy denies the plugin, the user has approved it, and a user-scope
command discovers no org policy (#3703), so install, install --frozen,
install --mcp, lock and update keep bin/ the deny should retire
(strict known I4 cells, KNOWN_DD). approve, compile and uninstall under
the deny hold every law and earn their ids.

Refs #4095 #4565

Co-authored-by: Copilot App <[email protected]>
U-BIN-OPS (definition rule, OP x PRIM x GATE only): bin/ deploys only for a
marketplace plugin at user scope (exec_gate.plugin_bin_deployable); audit,
prune, pack and marketplace have no user-scope form and a local bundle is
never a marketplace plugin, so a gate level of bin/ under them is vacuous
(the #4575 review: an absence U-BIN guarantees proves nothing about the
gate). It removes 9 baseline cells and 11 required T1 cells whose covering
receipts only proved bin/ absent (T-1 required -11 by design). An org-policy
level stays its own cell (U2 no-collapse); OP x SRC x PRIM and OP x PRIM
cells keep their absence witnesses. A tripwire binds the rule to the live
CLI (no --global on audit, prune, pack, marketplace), the U-BIN predicate
pin and the closed-world bin/ writer pin.

U-FIRST-PARTY-MCP now also maps OP=mcp-install x PRIM=mcp at the executable
gate levels: install --mcp declares the server in the root apm.yml, so it
is first-party and never gated.

Refs #4095 #4565

Co-authored-by: Copilot App <[email protected]>
…wn cells

- p-skill joins the pack set (plain file ships at every gate level)
- a canvas-only pack project; its three parked levels are strict R
  known cells tracking #4714 (pack refuses a gate-parked canvas)
- the world serves p-canvas from git for pack only (GIT_PACK_ONLY)
- the pack side door also credits the OP x PRIM pair

Co-authored-by: Copilot App <[email protected]>
…y levels

The deny-all-deps world policy also denies every MCP server (**), so at
the denied-dependency level install --mcp of the registry server is a
refusal that preserves state; with the gate off the requested server is
declared, locked and configured. Both levels now credit PRIM=mcp.

Co-authored-by: Copilot App <[email protected]>
…--force-instructions

compile deduplicates an instruction .github/instructions/ already holds,
so the matrix observes compile x other-file through a forced render: at
the gate-off and revoked-after-deploy levels, where the gate keeps the
plain files, AGENTS.md must carry the instruction body. The render also
credits the OP x PRIM pair.

Co-authored-by: Copilot App <[email protected]>
- route the T-3 lane through scenario credits (SCENARIO_LANES); machine
  witnesses still win
- new tests/lifecycle/scenarios/test_user_scope.py: first install from
  every source, install --mcp, approved executables, plugin bin/, target
  changes, modifiers, offline and the deployed states, all under HOME
- package-source helpers move to scenarios/_sources.py (scope-aware;
  marketplace registration at user scope is a global input)

Co-authored-by: Copilot App <[email protected]>
The M-SOURCE spine now drives two more ops through the real CLI:

- audit_pass: `apm audit --dry-run` then `apm audit` on each converged
  remote-skill state and after the registry exec pass; read-only for every
  declared form, local bundles included.
- decide_pass: `apm approve --all` pins every installed package with
  executables; a local bundle is approved by the content key `approve
  --pending` prints and installed again as that hint says; `apm deny` of a
  catalog plugin and the `apm install` its hint names retire its
  executables (I4); the gate is then restored. The model now carries the
  executables decisions, so the deploy oracle checks approved state.

The p-lsp bundle stays parked: its LSP server shares the local p-lsp's name,
and once the bundle owns it the manifest install is refused by design.

R5 (Q&L ruling): approve-deny x {mcp-registry, inline-mcp} maps onto
U-FIRST-PARTY-MCP; approve decides only installed packages
(scan_installed_executable_packages), witnessed by a live-scan test.

Ledger vs #4711: baseline 531 -> 452 (75 T-2 cells required, 4 mapped by
R5); T-2 baseline 220 -> 141.

Refs #4564
Refs #4565

Co-authored-by: Copilot App <[email protected]>
…-lane-w3b

# Conflicts:
#	tests/lifecycle/scenarios/test_ownership_siblings.py
…ck lock cells

- new scenarios/test_deployed_absent.py: gate levels over an absent
  deployment, offline and target-change redeploys, uninstall and
  marketplace with nothing deployed, an approved local bundle at both
  scopes (runs the approval hint the parked install prints)
- new scenarios/test_pack_lock_states.py: pack builds from a stale lock;
  pack refuses a lock a newer APM wrote (declared NEWER_LOCK refusal)
- user-scope canvas row; the kit observes user-scope lsp and canvas
  surfaces; the world table records the user-scope canvas path
- pair|DEPLOYED=absent|GATE=denied-dependency joins POLICY_REFUSALS

Co-authored-by: Copilot App <[email protected]>
…-lane-w3b

# Conflicts:
#	tests/lifecycle/scenarios/test_ownership_siblings.py
#	tests/quality/lifecycle_obligations.json
…ane-w3b

# Conflicts:
#	tests/lifecycle/generator/witnesses.py
#	tests/lifecycle/scenarios/_kit.py
#	tests/quality/lifecycle_obligations.json
…pendency deny

The local-bundle spine packs a canvas into p-bmix and installs both bundles under an org dependency deny (the install refuses and changes nothing); the pack spine packs under the same deny (pack refuses and ships nothing). Bundle installs that deploy credit the local-bundle source cells they act on.

Co-authored-by: Copilot App <[email protected]>
…t-only one

machine_witnesses took the first spine by node id; when that spine held only strict known cells (the user-scope bin spine under a dependency deny, #3703) the project matrix's passing receipts were hidden and five pairs read known-failing.

Co-authored-by: Copilot App <[email protected]>
…remote LSP)

Restores the b5 M-SOURCE code the b5 squash left unstaged (audit_pass,
decide_pass, the parked p-lsp bundle) and adds b6:

- decide_pass drives every package with executables through allowed,
  denied-executable and revoked-after-deploy, with an install (and a
  marketplace update) at each level; local bundles are approved by the
  content key approve --pending prints, after the deny (the p-exec
  bundle's hook file shares the p-exec package's name).
- lsp_source_pass declares the git-published p-lsp as a git shorthand and
  from the world's git catalog, through install/update/prune/compile/lock,
  audit, approve and a withdrawn approval, and uninstall.
- prune_pending: install keeps a departed dependency's apm_modules checkout
  and prune removes it (install.md), so prune after such a change is not a
  converged byte no-op.

Ledger vs train 5 @9e909beb: baseline 385 -> 351; T-2 baseline 94 left.

Refs #4564
Refs #4565

Co-authored-by: Copilot App <[email protected]>
The U-MCPOWN-USER reader test also checks the ledger records exactly the retired-owner removals; the DEPLOYED=absent uninstall test reads the lockfile on disk.

Co-authored-by: Copilot App <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Changes to hundreds of obligations and shared deployment oracles require human review of completed final-head real-CLI validation and full-shard results, including strict known-cell behavior, but the reported full local run remains in progress.

No open issues 🎉

4 resolved since last review

Review effort: Balanced

…egrator-w2b

# Conflicts:
#	tests/quality/known_cell_issue_states.json

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The lifecycle gate incorrectly expects apm lock to retire denied plugins, violating its preservation contract and skipping bin-preservation checks instead of testing the missing policy refusal.

1 open issue

Review effort: Balanced

Comment thread tests/lifecycle/machines/_gate_bin.py Resolved
…known cell

lock preserves deployed files and exec status (reference/cli/lock.md), so
G1|lock|bin|denied-dependency|user runs the usual outcome checks.

Co-authored-by: Copilot App <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Broad changes to obligation crediting and shared deployment oracles require human confirmation of real-CLI receipt validation and smoke-shard completion on the final integrated head, which the supplied evidence does not establish.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

… to required

#4895 landed first, so train 5 drops the strict #4874 known cell
(test_a_narrowed_target_retires_a_whole_plugins_enable_entry) and
regenerates the ledger and known_cell_issue_states (H4).

Co-authored-by: Copilot App <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The extensive lifecycle and strict known-failure changes require human confirmation of real-CLI receipts, smoke/integration evidence, and definition-rule exclusions that static review cannot validate.

No open issues 🎉

Review effort: Balanced

…tegrator-w2b

# Conflicts:
#	.github/ci-durations/linux-x86_64.json

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The rule incorrectly excludes audit from reachable bin/ checks for whole native plugins, leaving required obligations and replay coverage missing.

1 open issue

Review effort: Balanced

Comment thread tests/lifecycle/generator/rules.py Resolved
… a whole plugin's bin/

U-BIN-OPS no longer exempts audit: verify_claude_native_cache checks a
project-scope whole native plugin's deployed root, bin/ included. Its bin
gate levels return as obligations; GATE=none is honest baseline (+1).

Co-authored-by: Copilot App <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Reclassifying hundreds of lifecycle obligations across deployment, policy gates, and ownership migrations requires maintainer review of exact-head CLI receipts and complete CI to validate credit integrity and shard runtime.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit aea3f96 into main Nov 23, 2026
65 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the ql/corpus-train-5 branch November 23, 2026 13:09
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…rate

test_policy_promises keeps this train's sections and takes main's G2 content_types section (#4838). The U-BIN-OPS text takes train 5's prune-free premises and keeps the Q&L baseline sentence for the org-policy level. test_mcp_write_receipts keeps W4's #4784 row and main's #4801 follow-ups. The workflow selections list both new quality modules.

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…atalog

The restored source_digest is sha256 of the served catalog's canonical JSON. #4758 added
p-canvas to the world catalog, so the hand-pinned value went stale (it is the pre-#4758
catalog's digest). The expected digest now comes from the world's catalog document.

Refs #5159

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…atalog

The restored source_digest is sha256 of the served catalog's canonical JSON. #4758 added
p-canvas to the world catalog, so the hand-pinned value went stale (it is the pre-#4758
catalog's digest). The expected digest now comes from the world's catalog document.

Refs #5159

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-integration Run the full integration suite (ci-integration.yml) on this PR before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants