Skip to content

test(lifecycle): corpus train 7 (policy promises, strict Known #4784/#2824/#4852, v0.38 sweep) - #4877

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

Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
ql/corpus-train-7

Conversation

@danielmeppiel

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

Copy link
Copy Markdown
Collaborator

Description

Corpus train 7. Train 6 (#4814) landed at 26a4025 and is merged in. It contains train 6's head 699e837 and main fc1866b and re-merges #4814's final head with one regenerate before it goes to the desk (H7). Until #4814 merges, this diff includes it.

car branch @ head effect
W3b policy promises danielmeppiel-ql-w3b-train7-promises @06262268b7a test_policy_promises.py: org-policy promise rows with a control each (scripts deny, self_defined, max_depth, require_resolution, source_attribution, unmanaged_files (the #4826 install refusal is now required: #4853 fixed it on main), fail_on_drift, pinned constraint, explicit includes). Per the QL ruling, rows without a filed-issue cite stay off this train and land with their fix PRs (#4827, #4838).
W4 #4784 + #2824 danielmeppiel-w4-t7-mcp-retarget-4784 @b6cf97cfdca an APM-written MCP entry for a runtime no longer targeted (#4784: fixed on main, main's required row is kept); a codex hook copy that cannot read its plugin's skill (#2824, test_hook_plugin_root.py)
W4 lane C differential danielmeppiel-w4-t7-lane-c-differential @8595238e492 test_incremental_deploy_differential.py; #4852 was fixed by #4862, so its Known is dropped, and the kit _deploy_diff.py comes from main (#4849 landed)
W4 v0.38.0 sweep danielmeppiel-w4-t7-v038-sweep @50da7436 compile dependency-policy run and preview cells (#4734); a converged install writes nothing (#4790, no-write stamp oracle); hook bundle approval pin (#4688); a registry URL on a local host (#4521)
ledger main acb0423 (pre-#4814) train 6 (#4814) @ 699e837 train 7 @ 92b7efb
baseline 37 3 3
required 2388 2419 2423
known-failing 3 1 1

New cells in this train are scenario- and security-module promise rows outside the generated factor space, plus the four scope-free T1 bin x denied-dependency cells, now required through the project matrix refusal (U-USER-SCOPE-ORG-POLICY applies to explicit user-scope cells only). Baseline left: audit x bin x none, plus approve-deny and uninstall x bin x denied-dependency (named #3703 removals from #4814). Strict Known cells cite open issues only (checked live, L15; the full list is tests/quality/known_cell_issue_states.json); new in this train: #5070 (install reports no finding for a self-defined MCP server under mcp.self_defined: warn).

Review follow-up: a hermetic plain-http recorder for the registry URL rows is #5055.

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 adds promise rows and strict Known cells the generated corpus has no factor for yet.

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 verifies this head. Under host rule 17(g), local checks were ruff 0.15.12 on changed files and the guarded python -m tests.lifecycle.generator --check, tests.lifecycle.witnesses and tests.quality.known_cell_issues --check-live, all clean. The car authors verified their rows on scratch lifecycle runs (45083674997, 45088453607, 45086039207). CI's Lint job is the lint mirror.

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.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 01:08
@danielmeppiel Daniel Meppiel (danielmeppiel) added the full-integration Run the full integration suite (ci-integration.yml) on this PR before merge label Nov 23, 2026

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

Unresolved test gaps can hide security and deployment regressions, and the closed-issue snapshot conflicts with a remaining strict xfail, causing a consistency test to fail.

7 open issues
What changed in this PR

This stacked lifecycle-test train expands APM's promise-driven regression coverage for the v0.38 cycle and issues #4564/#4565. It builds on trains 5 and 6 without changing production behavior.

Changes:

  • Adds lifecycle scenarios for deployment history, policy enforcement, hook approvals, registry URLs and write-free repeated installs.
  • Extends test-world fixtures, machine coverage and generator rules, including strict known-failure cases.
  • Refreshes replay expectations, CI duration estimates and quality-gate coverage.
File Description
tests/​quality/​test_scenario_refusal_credit.py Accepts lockfile and owner-based refusal credits.
tests/​quality/​test_oracle_compile_record.py Adds compile home-record allowance controls.
tests/​quality/​known_cell_issue_states.json Refreshes issue states for known failures.
tests/​lifecycle/​world/​test_world.py Updates user-scope canvas expectations.
tests/​lifecycle/​world/​services.py Expands dependency-denial fixtures.
tests/​lifecycle/​world/​registry.py Publishes additional registry packages.
tests/​lifecycle/​world/​packages.py Adds mixed-content and native executable fixtures.
tests/​lifecycle/​world/​builder.py Serves and bundles the additional fixtures.
tests/​lifecycle/​snapshot.py Adds file stamps to detect identical-byte rewrites.
tests/​lifecycle/​security/​test_registry_url_local_host.py Tests HTTP registry host restrictions.
tests/​lifecycle/​security/​test_incremental_deploy_differential.py Compares incremental and fresh deployments.
tests/​lifecycle/​security/​test_hook_bundle_approval_pin.py Tests approval invalidation after bundle changes.
tests/​lifecycle/​scenarios/​test_policy_pairs.py Expands 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 Adds closed-gate and inline-MCP dry-run coverage.
tests/​lifecycle/​scenarios/​test_mcp_write_receipts.py Adds the lockless runtime-retargeting known case.
tests/​lifecycle/​scenarios/​test_mcp_ownership_history.py Tests current and legacy MCP ownership histories.
tests/​lifecycle/​scenarios/​test_host_identity_pairs.py Checks host, port and proxy lock identities.
tests/​lifecycle/​scenarios/​test_hook_plugin_root.py Tests hook access to bundled plugin files.
tests/​lifecycle/​scenarios/​test_history_upgrade.py Strengthens successful target-history witnesses.
tests/​lifecycle/​scenarios/​test_file_routing.py Checks per-target routing and Claude compiled instructions.
tests/​lifecycle/​scenarios/​test_deployed_absent.py Covers missing deployments across lifecycle operations.
tests/​lifecycle/​scenarios/​test_converged_install_writes_nothing.py Detects writes during repeated converged installs.
tests/​lifecycle/​scenarios/​test_compile_source_files.py Checks remote file preservation during compilation.
tests/​lifecycle/​scenarios/​_sources.py Shares package-source scenario setup.
tests/​lifecycle/​replay/​rows/​generated_cover-16-source-refusals.yaml Adds inline-MCP dry-run replay credits.
tests/​lifecycle/​replay/​rows/​generated_cover-08-exec-git-single-deny-mcp.yaml Removes vacuous bin packing credit.
tests/​lifecycle/​replay/​rows/​generated_cover-06-exec-git-single-approve-mcp.yaml Refreshes row ID and bin packing credits.
tests/​lifecycle/​replay/​rows/​generated_cover-05-exec-lsp-git-single-deny-mcp.yaml Aligns the generated row ID.
tests/​lifecycle/​replay/​rows/​generated_cover-03-skill-exec-git-multi-unapproved-mcp.yaml Removes vacuous bin operation credits.
tests/​lifecycle/​replay/​rows/​generated_cover-02-skill-exec-canvas-local-multi-deny-mcp.yaml Removes bin audit and prune credits.
tests/​lifecycle/​replay/​rows/​generated_cover-01-skill-exec-lsp-canvas-git-single-approve-mcp.yaml Removes unsupported bin audit and prune credits.
tests/​lifecycle/​oracles.py Allows the compile-specific home record.
tests/​lifecycle/​machines/​test_m_gate.py Extends gate coverage and hook reapproval checks.
tests/​lifecycle/​machines/​_gate_matrix.py Strengthens gate-state and instruction-render evidence.
tests/​lifecycle/​machines/​_gate_bin.py Adds user-scope dependency-denial known cells.
tests/​lifecycle/​journeys/​enterprise/​E03-proxy-only-air-gapped.yaml Updates the fixture marketplace count.
tests/​lifecycle/​journeys/​consumer/​J09-switch-harness.yaml Updates target-switch cleanup expectations.
tests/​lifecycle/​journeys/​consumer/​J08-uninstall-cleanup.yaml Updates instruction cleanup expectations.
tests/​lifecycle/​generator/​witnesses.py Prefers passing witnesses and registers new scenarios.
tests/​lifecycle/​generator/​test_rule_evidence_cli.py Adds live evidence for first-party MCP rules.
tests/​lifecycle/​generator/​test_generator_rules.py Tests exclusions, predicate pins and witness selection.
tests/​lifecycle/​generator/​rules.py Defines additional exclusions and MCP mappings.
tests/​lifecycle/​generator/​emit.py Corrects target-history routing and emits policy pins.
tests/​lifecycle/​generator/​covering.py Generates inline-MCP dry-run steps.
tests/​lifecycle/​generator/​bin_pin.py Generalizes predicate hashing for policy rules.
tests/​integration/​test_compile_dependency_policy_lifecycle.py Adds run and preview dependency-policy coverage.
.github/​workflows/​merge-train.yml Runs compile-record quality checks.
.github/​workflows/​main-architecture-ratchets.yml Adds post-merge compile-record checks.
.github/​workflows/​ci.yml Adds compile-record checks to CI.
.github/​ci-durations/​linux-x86_64.json Updates lifecycle shard duration estimates.

Review effort: Balanced

Comment thread tests/lifecycle/oracles.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/oracles.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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

🟡 Changes recommended

The tests leave rollback side effects unchecked and can misclassify missing skill output from a successful hook as a known failure.

2 open issues
3 resolved since last review

Review effort: Balanced

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 tests can miss metadata-preserving overwrites, accept unsuccessful control exits, and pass refusal cases despite partial installs or overwritten handwritten files.

2 open issues
5 resolved since last review

Review effort: Balanced

Comment thread tests/lifecycle/snapshot.py Resolved
…C, v0.38 sweep)

Stacked on corpus train 6 (699e837) and merged with main fc1866b. Cars:
- policy promise rows in test_policy_promises.py with a control each (scripts
  deny, self_defined, max_depth, require_resolution, source_attribution,
  unmanaged_files, fail_on_drift, pinned constraint, explicit includes,
  transitive MCP trust, content types); the #4826 install refusal is required
  now that #4853 fixed it on main.
- an MCP entry of a runtime no longer targeted (#4784) takes main's required
  row (its fix landed); a strict known cell for a codex hook copy that cannot read its plugin's skill (#2824).
- lane C incremental deploy differential (kit from #4849).
- v0.38.0 sweep: compile dependency-policy run and preview (#4734), a converged
  install writes nothing (#4790), hook bundle approval pin (#4688), a registry
  URL on a local host (#4521).
- burndown: a denied local bundle is refused unwritten (#4646), present-
  provenance-unknown x denied-executable (#4767), audit --ci judges locked
  content with apm_modules gone, merged-hook entry detection end to end (#4798).
Review folds: I5 admits the compile record only as a regular file and its
newly created ancestor directories; run/preview, content-types, plugin-root
hook, lane C fresh twin, source-machine bundle identity, self_defined warn and
hook bundle update oracles tightened; the self_defined warn row is a real
warn-mode policy now and is strict known on #5070; the #4826 refusal row checks rollback; no-write stamps add the POSIX change time. U-USER-SCOPE-ORG-POLICY removes explicit
user-scope cells only: the four scope-free T1 bin x denied-dependency cells are
required, witnessed by the project matrix refusals.
Ledger regenerated (baseline 3, known-failing 1, required 2423).

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

Rollback has a critical race that can delete another writer’s user files, and policy-result caching can prevent retries after a transient source failure.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

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 read-only audit check can miss modifications to the external symlink target, and filesystem helper controls are misplaced in an e2e lifecycle module.

2 open issues

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 5c89995 into main Nov 23, 2026
89 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the ql/corpus-train-7 branch November 23, 2026 18:00
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…le corpus

Regenerated against main (#4877, #4727, #5071); the #4981 named removals
match the 123 bin cells the filter demotes (two new project gate-matrix
cells: lock and mcp-install under a denied dependency).

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Gregory (gdelpu) pushed a commit to gdelpu/apm that referenced this pull request Nov 23, 2026
…#4784)

The server stays declared, cursor leaves the targets and apm.lock.yaml is
deleted: install must retire the cursor entry or keep and report it, and the
report must persist through audit --ci and later installs. Today it keeps it
silently. Adapted from microsoft#4877's strict Known cell.

Co-authored-by: copilot-swe-agent[bot] <[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