Skip to content

test(lifecycle): corpus train 4 (T-2 b4 + T-6c + T-7b) - #4711

Merged
Daniel Meppiel (danielmeppiel) merged 75 commits into
mainfrom
ql-w1-t2-drain-4
Nov 22, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 75 commits into
mainfrom
ql-w1-t2-drain-4

Conversation

@danielmeppiel

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

Copy link
Copy Markdown
Collaborator

Description

Corpus train 4, stacked on #4700 (corpus train 3, head eab79ec). It lands in the window after #4700; until then this diff includes #4700's commits. T-7b depends on T-6b, which ships in #4700.

car branch @ head baseline -> required
W1 T-2 b4 already folded into #4700 (merge 2b57594), 140 cells (counted in #4700)
W3 T-6c FILEROUTE danielmeppiel-w3-t6c-fileroute @44ac8cd7e 28 (8 of its 36 were already required in #4700)
W4 T-7b policy pairs + lost-lock deny flips + ratchet-list fix danielmeppiel-t7b-corpus @e2b9912317f 42 required + 1 strict known (#3703)
ledger main 488a4b1 #4700 eab79ec train 4
baseline 1196 602 531
required 1286 1838 1908
known-failing 0 7 8

No cell is lost against either car or #4700 (checked id by id). Every known-failing cell cites an OPEN issue: #3703, #4626, #4685, #4697, #4268, #4634.

Integration notes:

Issue and approved scope

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

Human scope-approval comment: #4564 (comment)

Does not complete #4564: 531 baseline cells remain after this train (target <= 500).

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): the 10 touched scenario tests passed. python -m tests.lifecycle.generator --check and python -m tests.lifecycle.witnesses are up to date. The obligation-status ratchet, assertion-quality ratchet, complexity ratchet, tests.quality.taxonomy --changed 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
  • Manifest edit
  • Test edit
  • CONFORMANCE.{md,json} regenerated
  • N/A -- this PR does not change OpenAPM-observable behaviour.

…ckfiles

A second scope-lock spine drives a stale lockfile (the manifest and the lock
disagree on the toggle package), an absent lockfile and the side-door commands
(deny, install --mcp, a local bundle, marketplace list) through every lock
state the lockfile spine leaves open. Each step runs I1-I9; admitted side
doors also assert their own outcome. Lockfile cells now carry the context
their step acted on and credit, anchored on LOCK, the pairs it implies.
apm marketplace list creating ~/.apm/marketplaces.json is a strict known
cell (#4600).

Refs #4564
Refs #4097

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

The GATE matrix gains a user-scope spine (install --frozen at every gate
level an approval store reaches, T2 FROZEN x SCOPE=user x GATE) with the
user-scope copilot surfaces observed (Bench.surface_globs). Marketplace
commands map onto rule U-MKT (Q&L ruling 2026-11-21): one rule cell
witnessed at the allowed and revoked levels with every project byte
unchanged; the org-policy level keeps its own cells, witnessed under the
dependency deny. The allowed level also uninstalls and reinstalls p-lsp.

Refs #4564
Refs #4095

Co-authored-by: Copilot App <[email protected]>
credits() is the one place that says which ids a machine receipt
discharges (rule ids themselves, anchored cells only their anchor), and
the witness test reads it. U-MKT evidence follows main's line moves.

Refs #4564

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

Per review on corpus train 2: outcome checks now run before a drift cell
is credited. A resolving command must leave a readable lockfile whose rows
match the manifest and that records each deployed declared skill; a local
bundle install must record p-lsp's approval key and LSP type in
apm_modules/.local-bundle-pending.json while its server stays parked.

Refs #4564

Co-authored-by: Copilot App <[email protected]>
Per review on corpus train 2: the allowed and the revoked marketplace
probes each hold their checked step; the rule cell's receipts are emitted
only once both levels are present, so dropping either probe leaves the
rule uncovered (negative control: umkt_ready per dropped level).

Refs #4564

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

Discharges the T-6b pair obligations (DEPLOYED in {edited, unowned,
present-provenance-unknown} crossed with OP, modifiers, SRC, PRIM, GATE,
TGT and NET) with real-CLI oracle receipts in
tests/lifecycle/scenarios/test_ownership_siblings.py.

- The user's bytes are declared (Scenario.user_write) and must survive
  (I1-X2); a closed gate that keeps them is exempt from I4 only when the
  keep is announced and audit --ci detects it (I4-X2).
- Declared refusals earn credit only through EXPECTED_REFUSALS (exit code,
  cause, the promise it upholds, its source); a refusal on any other pair,
  or a declared pair that exits 0, fails the step
  (tests/quality/test_scenario_refusal_credit.py negative controls).
- run(says=...) asserts announced outcomes and records them as evidence.
- Product failures are strict known cells: #4626 (edited hook, canvas and
  LSP files overwritten silently), #4628 (a user's LSP entry taken over),
  #4268 (refused install --mcp writes first), #4634 (local bundle reinstall
  after a lost lockfile leaves MCP lock state the gates reject).
- TGT reads the declared target set before the step: narrowed drops at
  least one declared target (a switch counts); widened adds and drops none.

T-6b obligations: 141 baseline -> 132 required, 6 known-failing, 3 baseline.

Refs #4564 #4565

Co-authored-by: Copilot App <[email protected]>
Two deterministic spines credit OP x PRIM x GATE for the side doors:
apm install <local bundle> (a run-time packed p-bmix bundle with a skill,
an instruction, a hook and an MCP server, plus the world's p-lsp bundle)
and apm pack --dry-run over git dependencies, each at five gate levels
(unapproved, denied before deploy, allowed, revoked after deploy, gate
off). Every step runs I1-I9; bundle installs must leave exactly the
per-bundle model set and record parked executables as pending; pack must
ship exactly the dependency executables the gate deploys and never a
managed MCP server.

Refs #4564
Refs #4095

Co-authored-by: Copilot App <[email protected]>
Target history (ruling #3): install and every command after a declared
target change, with real-CLI receipts crediting the scenario-lane pairs
their assignments imply (CREDITS). U11 maps changed-TGT x FROZEN onto
refusal|TGT=changed|FROZEN=on, witnessed by
test_frozen_refuses_a_target_change. Strict known cells: #4636 (uninstall
after a target change) and #4638 (frozen widened refusal leaves hook
config).

Refs #4564, #4565, #4100

Co-authored-by: Copilot App <[email protected]>
The local-bundle hook row at present-provenance-unknown credits its pair and
asserts the converged pair state; the obligation is required.

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 standalone Nothing was written alternative can accept unrelated exit-1 failures as denied-dependency receipts, allowing MCP scenarios to pass without enforcing policy.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread tests/lifecycle/scenarios/_kit.py Resolved
POLICY_BLOCK accepted any exit-1 output ending in 'Nothing was written', so an unrelated failure could earn a denied-dependency receipt. Each alternative now names its policy cause: the package denial (command_logger._policy_reason_blocked) or the MCP server denial (commit_gate.refuse_blocked_mcp). A negative control proves a non-policy refusal that wrote nothing earns no credit. No cell loses credit: test_policy_pairs passes (51) with the tightened cause.

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 lifecycle tests can pass without deploying the required Claude instruction or installing the requested MCP server, leaving gaps in target projection and server configuration checks.

No open issues 🎉

2 previously missed issues

In code that hasn't changed since last review

Medium severity Validate instruction paths for every current target

tests/​lifecycle/​scenarios/​test_file_routing.py:147

For the copilot-to-copilot+claude history, _assert_route accepts just the existing Copilot instruction, so this row can pass without deploying the Claude instruction. The skills-only model does not require that missing projection. Compare the marked instruction paths with the expected paths for every current target, rejecting retired-target paths, before crediting the history row.

Medium severity Verify MCP server declaration and target configuration

tests/​lifecycle/​scenarios/​test_policy_pairs.py:393

These rows can pass without installing the requested MCP server: the empty Scenario models no service, and a successful no-op with the announcement satisfies the current checks. Assert the server's manifest declaration and its connection in the target MCP config for both registry and inline sources before emitting the receipt.

1 resolved since last review

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 84a893b into main Nov 22, 2026
71 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the ql-w1-t2-drain-4 branch November 22, 2026 15:09
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 22, 2026
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 22, 2026
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 22, 2026
…3921; lockfile imports the native record module

#4711 added test_a_native_plugins_skill_in_the_users_hands_survives_install,
which assumes p-native-claude splits into .agents/skills at project scope;
claude and copilot now install it whole (#3921), so the cell pins cursor,
which always splits (agreed with QL). lockfile.py reads the native record
helpers through one module import instead of an in-function import.

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 22, 2026
Generator rules cited product source as path:line (Ev(path, line, needle)
plus prose comments). A line moves on every edit to the cited file, so two
unrelated PRs that refresh it conflict in a merge train, and anchors drift.
Evidence now names a symbol: path::qualname for Python (function, class or
method with its decorators, or a module-level assignment) and path::heading
for Markdown (code fences ignored; a fence closes only with nothing after it),
resolved in tests/lifecycle/generator/anchors.py; the needle must appear
inside that symbol's span.

test_every_rule_cites_a_symbol_that_still_says_it rejects any file:line
citation in the generator sources and in the ledger's rule evidence. All 88
anchors on main (including #4711's U11, U-MKT and the marketplaces.md
needle) were converted mechanically: needle located, innermost enclosing
symbol taken. Obligation statuses are unchanged.

Fixes #4696

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 22, 2026
Generator rules cited product source as path:line (Ev(path, line, needle)
plus prose comments). A line moves on every edit to the cited file, so two
unrelated PRs that refresh it conflict in a merge train, and anchors drift.
Evidence now names a symbol: path::qualname for Python (function, class or
method with its decorators, or a module-level assignment) and path::heading
for Markdown (code fences ignored; a fence closes only with nothing after it),
resolved in tests/lifecycle/generator/anchors.py; the needle must appear
inside that symbol's span.

test_every_rule_cites_a_symbol_that_still_says_it rejects any file:line
citation in the generator sources and in the ledger's rule evidence. All 88
anchors on main (including #4711's and #4734's) were converted mechanically:
needle located, innermost enclosing symbol taken. Obligation statuses are
unchanged.

Fixes #4696

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 22, 2026
Generator rules cited product source as path:line (Ev(path, line, needle)
plus prose comments). A line moves on every edit to the cited file, so two
unrelated PRs that refresh it conflict in a merge train, and anchors drift.
Evidence now names a symbol: path::qualname for Python (function, class or
method with its decorators, or a module-level assignment) and path::heading
for Markdown (code fences ignored; a fence closes only with nothing after it),
resolved in tests/lifecycle/generator/anchors.py; the needle must appear
inside that symbol's span.

test_every_rule_cites_a_symbol_that_still_says_it rejects any file:line
citation in the generator sources and in the ledger's rule evidence. All 88
anchors on main (including #4711's and #4734's) were converted mechanically:
needle located, innermost enclosing symbol taken. Obligation statuses are
unchanged.

Fixes #4696

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] apm pack --archive silently drops root skills/ when the package also has an .apm/ directory

2 participants