Skip to content

test(lifecycle): corpus train 1 (T-1 batch 1 + T-2 drain 1) - #4598

Merged
Daniel Meppiel (danielmeppiel) merged 20 commits into
mainfrom
ql/corpus-train-1
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 20 commits into
mainfrom
ql/corpus-train-1

Conversation

@danielmeppiel

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

Copy link
Copy Markdown
Collaborator

Description

Corpus train 1 lands the ready lifecycle-corpus batches together with ONE regenerated tests/quality/lifecycle_obligations.json. Each source PR rewrites that generated file, so landing them one by one would invalidate the next. Both source branches are merged with --no-ff to preserve authorship (no squash). The JSON is produced by python -m tests.lifecycle.generator on the merged tree, never hand-merged. The only manual resolution is the witnesses.py module docstring, which now lists both the M-SOURCE context ids and the M-GATE matrix ids.

Source PR Lane Obligation counts before -> after (alone, on main)
#4575 (W2): M-GATE matrix credits OP x PRIM x GATE cells (T-1 batch 1) T-1 baseline 1468 -> 1331, required 1023 -> 1160 (T-1 254 -> 133, T-7b 63 -> 47)
#4592 (W1): M-SOURCE context ids, native and bundle primitives (T-2 drain 1) T-2 baseline 1468 -> 1390, required 1023 -> 1100, known-failing 0 -> 1 (T-2 496 -> 418; strict known cell tracks #4572)

Train total, regenerated on the merged tree:

baseline required known-failing
main 1468 1023 0
train 1253 1237 1

Baseline by lane: T-1 254 -> 133, T-2 496 -> 418, T-7b 63 -> 47; other lanes unchanged. Counts are the generator's output on the merged tree, not a hand sum. Review fixes on both source branches (#4575 ac8a431/1e81bf9, #4592 52732d2) are re-folded (merge, then regenerate).

The source PRs stay open, are linked here, and are superseded by this train.

Issue and approved scope

Issue: Refs #4564, Refs #4565

Human scope-approval comment: #4564 (comment)

Does this PR complete the issue, or what remains? No. #4564 closes when the baseline is <= 500 (1234 after this train). Further T-1, T-2 and T-3 batches follow.

Type of change

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

Testing

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

On the merged tree (macOS, host-guarded):

  • python -m tests.lifecycle.generator --check -> up to date
  • pytest tests/quality/test_promise_obligations.py tests/quality/test_generated_obligations.py tests/lifecycle/generator/test_generator_rules.py tests/quality/test_gate_cell_obligations.py -> 80 passed
  • Lint contract: uvx [email protected] check and format --check (src, tests, scripts), pylint R0801 (10.00/10), lint-auth-signals.sh, check_complexity_ratchet.py --base-ref origin/main, tests.quality.taxonomy --changed and check_test_assertions.py -> all clean

The source PRs' own validation (machine spines on the engine driver) is in #4575 and #4592. The lifecycle shards here run both spines at the train head.

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

A deterministic spine on the shared lifecycle world walks six gate levels
(gate off, allowed, revoked after deploy, denied before deploy, unapproved,
org dependency deny) and credits G1 machine ids through check_obligation
after I1-I9 on every step. witnesses.py translates them anchored on GATE.

Refs #4564
Refs #4565

Co-authored-by: Copilot App <[email protected]>
Credit no bin cell (no spine step observes a bin outcome), keep
.github/instructions unchanged under install --mcp, compare MCP servers
against a set read before the command, hold prune under a dependency deny
to never-widen, and require each resolving step to deploy exactly the
model's observable set.

Refs #4564

Co-authored-by: Copilot App <[email protected]>
#4006/#4019 shifted the update command options by 8 lines, so
test_every_rule_cites_code_that_still_says_it failed on the merge.

Refs #4564

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

M-SOURCE now credits context ids X|<op>|<form>|<FACTOR>=<value> at the
real steps that ran in that state (scope, network, unchanged target set,
gate, a clean prior deployment, --force/--update/--frozen/--target), and
the generator reads each one as {OP, SRC, FACTOR}. Native plugins name
the primitives they carry (skill, mcp, bin via p-native-claude-bin), the
LSP bundle joins the bundle form, and compile/lock now act on a project
holding a local bundle. One context pass (multi-target, force/update,
frozen, bundle reinstall) adds 10 CLI steps to the spine.

Baseline 1468 -> 1380 (T-2 496 -> 408); one strict known cell:
X|install|pkg-registry|UPDATE=on (#4572, a git->registry source switch
leaves a stale .apm-pin until install --update drops it).

Also re-anchors the update.py evidence lines of the generator rules,
which drifted on main (test_every_rule_cites_code_that_still_says_it).

Refs #4564
Refs #4565

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

GATE=none is GateLevel('none', authority=None): no executables gate.
The lifecycle world configures executables.allow, so a skill-only
package there has no gate level; its GATE=none cells move to the
gate-off phase of the next batch.

Refs #4564

Co-authored-by: Copilot App <[email protected]>
…2-source-drain

# Conflicts:
#	tests/quality/lifecycle_obligations.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 tests credit obligations without exercising the relevant gate states, deployment artifacts, or target history, allowing missing outputs, no-ops, and collateral removals to earn receipts.

6 open issues
What changed in this PR

This train combines the M-GATE and M-SOURCE lifecycle coverage batches for #4564, aiming to reduce unwitnessed obligations without changing production behavior.

Changes:

  • Adds a deterministic gate matrix covering six gate states with lifecycle oracle receipts.
  • Expands source witnesses with execution context, native primitives and local bundles, plus a strict known cell for #4572.
  • Extends the shared model, runner and witness translation to support both batches.
File Description
tests/​lifecycle/​world/​test_world.py Adds expected results for the dependency-deny policy.
tests/​lifecycle/​world/​services.py Defines the matrix's dependency-deny policy.
tests/​lifecycle/​model/​state.py Models gate-off behavior and the new policy.
tests/​lifecycle/​model/​expected.py Allows executable deployment when the gate is off.
tests/​lifecycle/​machines/​test_m_source.py Adds context credits, native and bundle coverage, and a known defect cell.
tests/​lifecycle/​machines/​test_m_gate.py Runs the matrix and checks receipt completeness.
tests/​lifecycle/​machines/​_kit.py Extracts a reusable deterministic step runner.
tests/​lifecycle/​machines/​_gate_matrix.py Implements the six-state gate matrix and outcome checks.
tests/​lifecycle/​generator/​witnesses.py Translates source context and gate matrix receipts into obligations.

Review effort: Balanced

Per review on the corpus train: drop other-file credits (no compile-staged
output is asserted for copilot) and MCP credits of install --mcp (the
requested registry server is never gated). The U7 oracle now asserts the
requested server is declared, locked and configured, that no other server
appears, and that only servers the gate no longer allows may go, with a
negative control for each defect.

Refs #4564

Co-authored-by: Copilot App <[email protected]>
…gets, bundle ops)

- Native plugins are observed by the primitives they carry (skill, MCP)
  as well as the gated native unit, so an unapproved native deployment
  is an I4 violation the oracle sees.
- TGT=*-unchanged is judged per slot: a step is "unchanged" for a form
  only when that form's last resolving step ran under the same targets.
  The context pass installs the bundle twice under the multi-target set.
- compile and lock no longer act on a local bundle in this batch: an
  unapproved bundle deploys nothing, so those cells wait for the
  gate-off batch, where its artifacts are deployed and checked.

Baseline 1468 -> 1390 (T-2 496 -> 418), 1 strict known (#4572).

Refs #4564

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.

2 participants