Skip to content

test(lifecycle): corpus train 6 (T-1 closure, HOSTID/offline, b9; baseline -> 4) - #4814

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

Daniel Meppiel (danielmeppiel) merged 68 commits into
mainfrom
ql/corpus-train-6

Conversation

@danielmeppiel

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

Copy link
Copy Markdown
Collaborator

Description

Corpus train 6, stacked: it lands after #4702 (merged) and #4758 (corpus train 5). Train 6 contains train 5's head (66da26f) and re-merges #4758's final head with one regenerate before it goes to the desk (H7). It opens now so the ci.yml Lifecycle Smoke lane, which runs only on PRs into main, validates the T-1 spine credits. Until #4758 merges, this diff includes train 5.

car branch @ head effect
W3b T-1 closure danielmeppiel-ql-w3b-train6-v2 @22d7e6288e9 audit and compile x denied-dependency, bundle-install x bin, pack x bin, the T-6b closed-gate row
W4 T-2 HOSTID and offline (#4789) danielmeppiel-w4-t2-hostid @2be41b0e3b4 10 HOSTID cells (test_host_identity_pairs.py), offline source cells (T-2 joins SCENARIO_LANES)
W1 T-2 b9 + U-USER-SCOPE-ORG-POLICY (#4796) ql-w1-t2-b9 @e2d68ee61fa 12 T-2 T3 cells; the ruled rule removes the five #3703 user-scope dependency-deny cells (user scope discovers no org policy)
ledger main 9959a49 train 6 @ a48b7aa
baseline (pre-#4975) 7
required 2414
known-failing 1 (`pair

Baseline left: prune x bin {none, unapproved-exec, denied-dependency} and marketplace x bin x denied-dependency (#4894 lane, witnessed by #4975), audit x bin x none, plus approve-deny and uninstall x bin x denied-dependency, which carry a named #3703 removal (tests/quality/obligation_removals.json): user scope discovers no org policy, so the user-scope bin spine no longer credits those ungoverned steps (review threads on _gate_bin.py and witnesses.py). The compile, lock, mcp-install, approve and uninstall denied-dependency pairs are witnessed by the project matrix refusals. This head is re-merged with main once #4975 lands, with one regeneration.

Scope (review thread on generated_obligations.json): this PR does not change tests/quality/generated_obligations.json or any security/journey table; the file equals main. Deferred, needs its own scope approval: any promotion in the security and journey tables.

Known cells (L15, checked live): #4626, #4744, #4759 are OPEN.

Integration notes:

  • Rule evidence uses test(lifecycle): cite generator rule evidence by symbol, never by line #4702 symbol anchors; U-USER-SCOPE-ORG-POLICY's six line-form Ev became core/scope.py::policy_discovery_uses_git_remote, policy/discovery.py::_auto_discover and docs headings. Every Ev resolves.
  • _gate_bundle.GatePack.pack combines W3b's _SHIPS_ALSO kinds under the dependency deny with train 5's per-package plain-file labels.
  • The user-scope policy pin test also reads the committed pin (assertion-quality ratchet).
  • Ledger regenerated, never hand-merged; generator --check, witnesses, ruff, AQ, duplicates and taxonomy are clean. CI and Integration run the suites (no local pytest under the host rule).

Issue and approved scope

Issue: Refs #4564 (0.38 burn-down), Refs #4565 (epic)

Human scope-approval comment: #4564 (comment)

Does not complete the epic; it takes the lifecycle baseline to 5.

Type of change

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

Testing

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

CI and Integration verify this head; no local pytest under the host rule. 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.

Re-merge (train 5 @ 26a253e + main @ 2b4e751): #4895 landed, so the #4874 narrowed-target cell is required; every remaining strict known cell is discharged or retired here, so known-failing is 0.

Re-merge after train 5 landed (main aea3f96): the five remaining baseline cells are the T1|PRIM=bin gate levels #4894 tracks (prune none/unapproved-exec/denied-dependency, audit none, marketplace denied-dependency).

…evel; pack refusal covers bin/

A deny that arrives in apm.yml after the lockfile is lost retires the
receipted hook like a revoke does; credit LOCK=absent at each closed gate
level. An org dependency deny refuses pack for every primitive a package
ships, bin/ included.

Co-authored-by: Copilot App <[email protected]>
(cherry picked from commit a9c953b)
…ndition (AQ003)

Co-authored-by: Copilot App <[email protected]>
(cherry picked from commit b1e325b)
…ve, bundle ops)

- route the T-2 lane through scenario credits; existing T-6e credits now
  witness 5 DEPLOYED=clean / GATE=allowed pairs
- new scenarios/test_source_pairs.py: canvas from git and a git
  marketplace, canvas and LSP from the package registry, a native
  plugin's hook and LSP server, compile and lock over a local bundle
  (scenario-local publications; no shared world change)
- _sources.py serves any package from each source

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

New scenarios/test_host_identity_pairs.py: the lock row records the
exact host (bare github.com, a GHES host with a port, the registry
proxy) and audit replays it; a newer-generator lock is refused for each
(declared NEWER_LOCK keys); a git marketplace plugin records the proxy
or a ported host it was fetched from.

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

Train 5's M-SOURCE b7 earns canvas/LSP from git, catalog and registry and
the native plugin's hook and LSP, so the scenario copies go; the module
keeps compile and lock over a local bundle (test_local_bundle_commands.py).

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

test_m_source (T-2 b8) already proves lock and compile keep every local
bundle's records, so this module credited no new cell. Regenerated on
train 5 (e1e9faf): 14 cells flip (10 HOSTID, 4 offline sources),
baseline 37 -> 23.

Co-authored-by: Copilot App <[email protected]>
…primitive (T-2)

The world's remote packages ship skills only, so each row serves its own
package from a scenario-local git repository: an instruction package from
git and from a git catalog, and a native Claude plugin with an agent. compile
leaves the lock bytes and every marked deployed file unchanged, and the
instruction stays under copilot's instruction root and in the lock.

Credits T3|OP=compile|SRC={git, marketplace-git, native-plugin}|PRIM=other-file.
Both T-2 scenario modules join Lifecycle Smoke so PR CI runs them.

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

claude_plugins/admission.py registers a plugin natively only at user
scope; at project scope the plugin's agents/ deploy under .claude/agents
and are recorded in the lock like any primitive. The native-plugin row
now asserts that deployed agent instead of a native_plugin lock record.

Co-authored-by: Copilot App <[email protected]>
…ill, hook, canvas, LSP, instruction)

World: p-kit is published to the package registry and p-pack is packed as a
local bundle (distinct names: an installed bundle owns its LSP server name).
M-SOURCE declares both; the model tracks p-pack's surfaces
(_MODELED_BUNDLES): its skill deploys on the bundle install, its executables
only with an approval of that exact bundle content. preview_names reads the
paths a local-bundle dry run lists.

Spine green on the real CLI (55 min under load); obligation gates 92
passed. Ledger vs b8: baseline 37 -> 25 (12 T-2 T3).

Refs #4564
Refs #4565

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

Org policy does not govern user-scope (-g) installs (#3703, a 0.39 design gap,
documented in enterprise/apm-policy.mdx:18, enterprise/security.md:99 and
reference/cli/policy.md:56). The rule removes the user-scope
GATE=denied-dependency cells under install, lock, update and install --mcp
(5 known-failing cells) and pins core/scope.policy_discovery_uses_git_remote:
when #3703 changes that decision the cells return as must-cover and the
tripwire test fails.

Refs #4564
Refs #4565

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

- Gate matrix: a declared refusal under the org deny (exit 1, nothing
  changed, AGENTS.md included) credits every primitive the denied
  packages ship, p-exec's bin/ and p-mixed's instruction too.
- Bundle spine: under the org deny, a p-bmix copy that ships bin/ and no
  integrity manifest is refused on policy (integrity is skipped with a
  warning), crediting bundle-install x bin x denied-dependency.
- U-BIN-OPS records the Q&L ruling: prune and marketplace x bin at the
  org-policy level stay baseline (vacuous absence witness).

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

# Conflicts:
#	tests/lifecycle/scenarios/test_ownership_siblings.py
Copilot AI balanced review requested due to automatic review settings November 22, 2026 20:33
@danielmeppiel Daniel Meppiel (danielmeppiel) added the full-integration Run the full integration suite (ci-integration.yml) on this PR before merge label Nov 22, 2026
…4005)

A '**' instruction under targets: [claude] never becomes a .claude rule; install asks for apm compile, which writes it to AGENTS.md beside a CLAUDE.md importing @AGENTS.md (P-OWN-claude-agents-md-instruction-routing).

Co-authored-by: Copilot App <[email protected]>
…r (T5 DRYRUN)

cover-16 runs apm install --mcp p-inline --dry-run -- <inert> --stdio before declaring the inline server; it credits T5|OP=mcp-install|SRC=inline-mcp|DRYRUN=on (M-SOURCE credits install --mcp as OP=install, so no machine reaches it).

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.

🟡 Changes recommended

The gate-bundle test opens a generated ZIP archive as gzip-tar, causing a ReadError before the denied-dependency check can run.

3 open issues
What changed in this PR

Expands APM's lifecycle test corpus for the 0.38 baseline burn-down, building on train 5. The changes add command-and-state coverage without modifying production behavior.

Changes:

  • Adds scenarios for host identity, user scope, lock states, target changes, and package sources.
  • Extends gate machines and deployment checks for bundles, executables, and policy refusals.
  • Updates obligation rules, witness selection, generated replay rows, and CI duration estimates.
File Description
tests/​quality/​test_scenario_refusal_credit.py Accepts lock-state and owner-law refusal credits.
tests/​lifecycle/​world/​test_world.py Checks user-scope canvas deployment.
tests/​lifecycle/​world/​services.py Extends dependency and MCP denial fixtures.
tests/​lifecycle/​world/​registry.py Publishes additional test packages.
tests/​lifecycle/​world/​packages.py Adds mixed-primitive and native executable fixtures.
tests/​lifecycle/​world/​builder.py Builds new bundles and publishes canvas sources.
tests/​lifecycle/​scenarios/​test_user_scope.py Adds user-scope lifecycle coverage.
tests/​lifecycle/​scenarios/​test_target_history_sources.py Exercises target changes across sources and gates.
tests/​lifecycle/​scenarios/​test_policy_pairs.py Adds lock-policy credits and shares source setup.
tests/​lifecycle/​scenarios/​test_pack_lock_states.py Tests packing with stale and newer-generator locks.
tests/​lifecycle/​scenarios/​test_ownership_siblings.py Extends closed-gate coverage and updates defect tracking.
tests/​lifecycle/​scenarios/​test_mcp_ownership_history.py Tests current and retired MCP ownership states.
tests/​lifecycle/​scenarios/​test_lock_states.py Exercises lock states across lifecycle factors.
tests/​lifecycle/​scenarios/​test_host_identity_pairs.py Tests host identity recording, audit, and refusals.
tests/​lifecycle/​scenarios/​test_history_upgrade.py Adds successful audit and pack history witnesses.
tests/​lifecycle/​scenarios/​test_file_routing.py Checks instruction routing to current and dropped targets.
tests/​lifecycle/​scenarios/​test_deployed_absent.py Covers missing deployments and restoration.
tests/​lifecycle/​scenarios/​test_compile_source_files.py Checks compile preserves remote file primitives.
tests/​lifecycle/​scenarios/​_sources.py Centralizes scenario source setup.
tests/​lifecycle/​scenarios/​_kit.py Extends deployment checks, scenario lanes, and refusals.
tests/​lifecycle/​replay/​rows/​generated_cover-08-exec-git-single-deny-mcp.yaml Removes a vacuous bin gate credit.
tests/​lifecycle/​replay/​rows/​generated_cover-06-exec-git-single-approve-mcp.yaml Updates row identity and removes a bin credit.
tests/​lifecycle/​replay/​rows/​generated_cover-05-exec-lsp-git-single-deny-mcp.yaml Updates generated row identity.
tests/​lifecycle/​replay/​rows/​generated_cover-03-skill-exec-git-multi-unapproved-mcp.yaml Removes vacuous audit, pack, and prune bin credits.
tests/​lifecycle/​replay/​rows/​generated_cover-02-skill-exec-canvas-local-multi-deny-mcp.yaml Removes vacuous audit and prune bin credits.
tests/​lifecycle/​replay/​rows/​generated_cover-01-skill-exec-lsp-canvas-git-single-approve-mcp.yaml Removes vacuous audit and prune bin credits.
tests/​lifecycle/​machines/​test_m_gate.py Extends gate coverage and hook approval regression checks.
tests/​lifecycle/​machines/​_gate_matrix.py Adds instruction rendering and policy-refusal coverage.
tests/​lifecycle/​machines/​_gate_bundle.py Extends bundle and pack gate sequences.
tests/​lifecycle/​machines/​_gate_bin.py Models user-scope org-policy limitations.
tests/​lifecycle/​journeys/​enterprise/​E03-proxy-only-air-gapped.yaml Updates the expected marketplace plugin count.
tests/​lifecycle/​generator/​witnesses.py Prefers passing witnesses and registers new scenarios.
tests/​lifecycle/​generator/​test_generator_rules.py Adds rule, pin, and witness-selection checks.
tests/​lifecycle/​generator/​rules.py Defines exclusions and first-party MCP mappings.
tests/​lifecycle/​generator/​emit.py Corrects target-history routing and emits the policy pin.
tests/​lifecycle/​generator/​bin_pin.py Adds a user-scope policy predicate digest.
.github/​ci-durations/​linux-x86_64.json Adds lifecycle duration estimates for shard balancing.

Review effort: Balanced

Comment thread tests/lifecycle/scenarios/_kit.py Resolved

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.

Comment thread tests/lifecycle/generator/witnesses.py Resolved
# Conflicts:
#	tests/lifecycle/generator/rules.py
#	tests/quality/lifecycle_obligations.json

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

…rned #3703 credits

- user-scope bin spine: steps under the org deny that no strict known cell tracks
  are still checked but earn no denied-dependency credit (user scope discovers no
  org policy, #3703); the project matrix refusals witness compile, lock,
  mcp-install, approve and uninstall pairs. approve-deny and uninstall x bin x
  denied-dependency get a named #3703 removal; pair SCOPE=user goes known-failing.
  Regression test pins both.
- I5: a compile --dry-run gets no home-record allowance (DRYRUN modifier).
- compile record test is a component test.
- HOSTID audit rows run audit --ci so drift or a failed replay fails.
- Claude always-on routing row: assert the skill and a path-scoped instruction
  under .claude/rules before and after compile.
- compile of a native plugin and target-history whole plugin: assert the
  enabled registration and the native_plugin lock record.

Co-authored-by: Copilot App <[email protected]>
bin_pin: main's element_tokens refactor plus train 6's user_org_policy_digest on it (pins unchanged). Ledger 3/1/2419: audit x bin x none and the two named #3703 removals.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Comment thread tests/lifecycle/generator/rules.py Resolved
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.

🟡 Changes recommended

The generator drops reachable project-scope bin policy obligations, while the oracle’s prefix-based allowlist incorrectly permits extra HOME files beneath the exempt record path.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread tests/lifecycle/oracles.py Resolved
… judges

A component test must assert durable state (AQ003): each control asserts the record is on disk before judging the verdict, so an empty verdict cannot come from a missing write.

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.

🟡 Changes recommended

The exclusion predicate incorrectly treats scope-independent T1 bin cells as user-scoped, removing four reachable project-scope denied-dependency coverage obligations from the ledger.

2 open issues

Review effort: Balanced

Comment thread tests/lifecycle/generator/rules.py Resolved
…N-OPS text matches #4894

The compile home-record allowance admits the record and its ancestor directories, never a path below it; a negative control writes below the record. U-BIN-OPS no longer calls the marketplace org-policy level a vacuous baseline: the plugin bin spine witnesses it (#4894).

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 scope-free bin exclusion removes four reachable project-scope T1 obligations despite existing refusal witnesses, so it must be limited to explicit user scope and the tests and ledger updated.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 26a4025 into main Nov 23, 2026
88 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the ql/corpus-train-6 branch November 23, 2026 16:31
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