Skip to content

T096: the contract family's tests read the composed farm where the run is composed (plan 038, T094's R2-INV-R9, CS) - #53

Merged
brettheap merged 6 commits into
mainfrom
r2/t096-contract-family-tests
Oct 7, 2026
Merged

brettheap merged 6 commits into
mainfrom
r2/t096-contract-family-tests

Conversation

@brettheap

@brettheap brettheap commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Authored by lane openXfactory-3, delegated by lane openxfactory-4 (#656 6021862323)

Arc: neutral-product-standalone-operability

T096: the contract family's tests (plan 038; T094's map R2-INV-R9, means CS)

Realizes (no tasks.md entry yet; the contract is the slice outline row of R2-INV-R9 plus the holder's rulings 6021830531): requirement 9's declared composed tests, toward T073's composed step 5a (F9.1). This is the CS constants half for the four contracts-only files.

Falsifier (the outline row): the 74 composed reds of these four files read 0 (11 / 13 / 32 / 18). Each file runs alone and composed, red first, then green. The unchanged set reads unchanged: 12.5's 16 governed suites, F5.2's files, and test_column_contributions_governed.py at 9 passed. tests/test_declared_exclusion.py reads green lone.

Ruled / Decisions: T094 RULED 6021830531 (OQ-R9-2 at its default: the farm is built by the conftest, composed-only, and named CONTRACTS_DIR), under 6016982816 (ARC-Q2 (a)). There are no decisions of this slice's own.

After: T095 (#46), which defines CONTRACTS_DIR. It landed as e2340bb, and this branch has merged it.

The change (the four files only)

Each file took Path(__file__).parents[2] as openxFactory's root. Composed, that is the directory above the checkout. Each file now reads T095's CONTRACTS_DIR (from conftest import CONTRACTS_DIR):

  • Composed: SCRIPT is this leg's own scripts/validate-ideation-dashboard-contracts.py, which reads the farm through the CONTRACTS_DIR environment variable. SCHEMAS and REGISTER_SCHEMA read CONTRACTS_DIR/schemas, and EXAMPLES reads CONTRACTS_DIR.parent/examples/ideation-dashboard.
  • Lone: CONTRACTS_DIR is None, and every path is byte-identical to before. So each file still fails alone for its declared reason, openxfactory-contracts.

The consumer-validator test's docstring now states which validator find_validator answers in each case (Copilot r4201041192). No test, guard, fixture or assertion is added or removed.

Files: tests/test_project_action_contracts.py, tests/test_project_schema_election.py, tests/test_validate_ideation_dashboard_contracts.py, tests/test_wheel_action_contracts.py.

Measured: base = main e2340bb, head = fd16d70 (this branch, merged with it)

The composed form, R1Q23 (a):

  • openxFactory 92010d3e with openDox, openXdox and openXwallet initialized recursively, and its scripts/ on PYTHONPATH;
  • openDox installed from openDox-code main 84f8ed83;
  • T022's placement made before the run and removed after it, with git status clean afterwards;
  • colour variables unset, TERM=dumb;
  • Python 3.12.3, pytest 8.4.2, Node v24.21.0;
  • each file run alone.
base  test_project_action_contracts.py              1 failed, 10 errors
base  test_project_schema_election.py               13 errors
base  test_validate_ideation_dashboard_contracts.py 1 failed, 1 passed, 31 errors
base  test_wheel_action_contracts.py                1 failed, 17 errors
      every red: FileNotFoundError / can't open file on <workspace>/scripts/validate-ideation-dashboard-contracts.py,
      <workspace>/contracts/schemas/project-register.schema.yaml or .../gate-intent.schema.yaml, where <workspace> is the
      directory above the checkout
head  test_project_action_contracts.py              11 passed
head  test_project_schema_election.py               13 passed
head  test_validate_ideation_dashboard_contracts.py 33 passed
head  test_wheel_action_contracts.py                18 passed

Unchanged set, composed, each file alone, at the same base and head:

  • 12.5's 16 governed suites (computed by git grep -l -e open-pr -e open_pr -e FakePullRequests -- 'tests/test_*.py');
  • the 7 files F5.2's set names (test_generator.py, test_snapshot*.py, test_session_snapshot.py);
  • test_column_contributions_governed.py, at 9 passed.

Together they are 1004 nodes, with 0 red at base and 0 red at head, and 0 nodes differ.

Lone (a venv from pip install -e ".[test]", openDox at the pyproject pin dede32b4, no PYTHONPATH):

  • tests/test_declared_exclusion.py: 207 passed at base and at head;
  • the validate.yml form at head: 1161 passed, 4 skipped, 1 deselected (selected 1165 / passed 1161 / skipped 4; floors 1099 / 1095 / 4).

Mutants, each applied to all four files at head. All were killed:

  • M1, the lone half reads the leg (parents[1] always): test_declared_exclusion.py lone, the 4 entries fail;
  • M2, the composed half keeps parents[2]: composed, 68 red (every case that loads the validator);
  • M3, the schemas not from the farm: composed, all four files red;
  • M4, the examples not beside the farm: composed, three files red;
  • M5, the composed flag inverted: lone, the 4 entries fail; composed, 74 red.

In M5's lone run, test_hosted_actor.py's entry also failed once. That file is not one of these four and is not mutated, and it reads green in the unmutated head run (207 passed). It was one-off noise on a loaded host.

Earlier rounds measured the same falsifier over local integrations of main + #40 + #46 7ad77ae, and of main f70bc9c + #46 c2192e3, with the same results for these four files.

CI and Copilot

Not done

  • The commit carries Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>, the harness's attribution form, not WRITER-RULES' "(1M context)" form.

🤖 Generated with Claude Code

Summary by Sourcery

Update the contract-family tests to read the appropriate contract sources in composed and standalone environments.

Bug Fixes:

  • Make the contract-family tests resolve schemas, examples, and the validator from the composed contract farm so all composed test cases run successfully.

Enhancements:

  • Preserve the existing standalone checkout paths and failure behavior while supporting composed test execution.
  • Clarify which validator is used by the consumer-validator test in standalone, composed, and installed runs.

brettheap and others added 2 commits October 6, 2026 19:00
…n is composed (plan 038; T094's map R2-INV-R9, CS)

The four contracts-only files took Path(__file__).parents[2] as
openxFactory's root. Composed, that is the directory above the checkout, so
T094 measured all 74 of their nodes red composed (11, 13, 32 and 18).

Where the run is composed, tests/conftest.py (T095) names the family's
composed farm CONTRACTS_DIR. SCHEMAS, EXAMPLES and REGISTER_SCHEMA now read
that farm, with the examples beside it, and SCRIPT is this leg's own
validator, which reads the same farm. In a lone checkout CONTRACTS_DIR is
None and every path is what it was, so each file still fails alone for its
declared reason, openxfactory-contracts. One docstring's account of SCRIPT
is brought up to date.

Lane: openXfactory-3

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brettheap
brettheap requested a balanced review from Copilot October 6, 2026 22:26
@sourcery-ai

sourcery-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown

Reviewer's Guide

The four contract-family test modules now use T095’s CONTRACTS_DIR and the composed leg’s validator, schemas, and examples during composed runs, while preserving their intentional lone-checkout failure behavior and updating one explanatory docstring.

File-Level Changes

Change Details Files
Route contract-family test paths through the composed farm while preserving lone-checkout behavior.
  • Import the fixture-provided CONTRACTS_DIR and detect composed versus lone execution.
  • Use the composed leg’s validator and farm schemas, while retaining the existing above-checkout paths when run alone.
  • Resolve examples beside the composed contracts farm, including negative examples.
  • Update the validator-path documentation to describe both execution modes.
tests/test_project_action_contracts.py
tests/test_project_schema_election.py
tests/test_validate_ideation_dashboard_contracts.py
tests/test_wheel_action_contracts.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The validator documentation is contradictory, and the branch depends on unmerged PR #46 to provide CONTRACTS_DIR.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Updates contract-family tests to use the composed contracts farm while preserving standalone paths.

Changes:

  • Select validator, schemas, and examples based on CONTRACTS_DIR.
  • Update validator-location documentation.
File Description
tests/​test_project_action_contracts.py Resolves project contracts from the composed farm.
tests/​test_project_schema_election.py Resolves the register schema from the composed farm.
tests/​test_validate_ideation_dashboard_contracts.py Redirects validator assets and updates documentation.
tests/​test_wheel_action_contracts.py Resolves wheel contracts from the composed farm.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/test_validate_ideation_dashboard_contracts.py Outdated
brettheap and others added 2 commits October 6, 2026 23:29
…ce-tree case from the lone one (Copilot r4201041192)

Run from this source tree, snapshot.find_validator() answers this checkout's
scripts/validate-ideation-dashboard-contracts.py, which is the module's
SCRIPT where the run is composed and not where it is lone. The docstring
said "never SCRIPT", so it now states each case. Docstring only; no
behaviour changes.

Lane: openXfactory-3

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Dependency PR #46 remains open, so CONTRACTS_DIR is currently unavailable and validation fails.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The path selection is consistent with the composed harness and preserves declared lone-run behavior.

Review effort: Balanced
Findings: None

@brettheap brettheap changed the title DRAFT: T096: the contract family's tests read the composed farm where the run is composed (plan 038, T094's R2-INV-R9, CS) T096: the contract family's tests read the composed farm where the run is composed (plan 038, T094's R2-INV-R9, CS) Oct 7, 2026
@brettheap
brettheap marked this pull request as ready for review October 7, 2026 00:25
@sourcery-ai

sourcery-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 16 hours and 54 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap
brettheap requested a balanced review from Copilot October 7, 2026 00:35
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The updated docstring incorrectly states that the installed validator’s package tree has no contracts/ directory.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

Comment thread tests/test_validate_ideation_dashboard_contracts.py
@brettheap

Copy link
Copy Markdown
Contributor Author

READY (holder, manual landing) at 49dcb2f

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Holder, at READY: T096 (lane openXfactory-3), the contract family's tests read the composed farm where the run is composed. Landing on Brett's word "land lane 3's PRs when green".

  • The head: 49dcb2fa is the green loop's update-branch merge of main 6f259156.
  • Gates at the head:
    • the rollup is SUCCESS;
    • the merge state is CLEAN, which this strict ruleset requires;
    • 0 closing references and 0 keywords.
  • Copilot 4201833198, "Changes recommended", is an ACCEPTED LIMIT under 5988818366. It is a factual error in a test comment about the wheel-install case, not an assertion and not a bypass. Lane 3 owes the comment correction. The thread is answered and resolved.

@brettheap
brettheap merged commit 34e1c1f into main Oct 7, 2026
4 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

LANDED — lane openxfactory-4, 2026-10-07T00:40:46Z, PR #53 → 34e1c1f (opensoft/openXdox-code main; plain gate)

Landed on Brett's word "land lane 3's PRs when green". Copilot 4201833198 (a test comment's wheel-install claim) is an ACCEPTED LIMIT; lane 3 owes the comment fix.

brettheap added a commit that referenced this pull request Oct 7, 2026
…'s contracts/ (#56)

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Authored by lane openXfactory-3, delegated by lane openxfactory-4 (lane4-to-lane3.log 2026-10-07T00:40:52Z; Copilot 4201833198 accepted at #53's landing)

Arc: neutral-product-standalone-operability

## T096 follow-on: the validator-root comment names the openxdox package's contracts/

When the holder landed #53 (T096) as 34e1c1f, it accepted Copilot `4201833198` and owed lane 3 a correction. This PR makes it. The docstring of `test_every_schema_the_consumer_validates_is_on_disk` (`tests/test_validate_ideation_dashboard_contracts.py`) said that in an install "its tree carries no `contracts/`". That is wrong:
- The packaged validator is `openxdox/contracts/validate-ideation-dashboard-contracts.py`, and its `ROOT` (`parents[1]`) is the installed `openxdox` package.
- So `ROOT / "contracts"` exists, and the three schemas are the packaged copies in it, each held to `copies.yaml`'s digest (`scripts/validate-ideation-dashboard-contracts.py:118`, `:138-145`, `:317-320`).
- Only a source tree has no `contracts/` of its own. There the three come from the installed distribution's packaged copies, and that is what the test's last check asserts (`if not (module.ROOT / "contracts" / "schemas").is_dir()`).

The docstring now says each case. **It is a docstring-only change: no code, test, assertion or behaviour moves.** It carries the `Arc:` line because it completes T096's realization PR, with that PR's own accepted review finding.

**Files:** `tests/test_validate_ideation_dashboard_contracts.py`, docstring only (+7 / -3).

**Ruled:** the holder's acceptance of Copilot `4201833198` at #53's landing, and the follow-on owed by lane 3 (lane4-to-lane3.log, 2026-10-07T00:40:52Z). There are no decisions of this PR's own.

## Measured at 0c268bd (`main` da73609 + this commit)

- The file alone, composed, in T096's composed form (openxFactory `92010d3e` with its three submodules initialized recursively and `scripts/` on `PYTHONPATH`, openDox-code `84f8ed83`, and T022's placement): `33 passed`.
- The file alone, lone: `1 failed, 1 passed, 31 errors`, the same shape as before, for its declared reason, `openxfactory-contracts`. `tests/test_declared_exclusion.py` lone reads `207 passed`.
- The lone `validate.yml` form (`pip install -e ".[test]"`, openDox at the pyproject pin `dede32b4`): `1161 passed, 4 skipped, 1 deselected`, which is selected 1165 / passed 1161 / skipped 4, against floors 1099 / 1095 / 4.
- No guard or behaviour is added, so there are no mutants to kill.

## CI and Copilot

- CI at 0c268bd: `validate` success (run 37603206350: `1161 passed, 4 skipped, 1 deselected`), and SonarCloud Code Analysis success.
- Copilot review 5440559691 at 0c268bd: Approval recommended, Findings None. 0 review threads.

## Not done

Nothing else is owed by this follow-on.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Oct 8, 2026
Brings T101 (#48), T098 (#51), T103 (#49), T096 (#53), T100 (#54), T099
(#47), T021's follow-on (#55), T102 (#52), T022 (#41, landed as aefd109),
T097 (#50) and T096's follow-on (#56).

Conflicted: scripts/composed_placements.py and tests/test_composed_placements.py,
both T022's files, which this branch carried from #41 through #44. Main's
landed side is kept for both. tests/declared_exclusion.yaml merged clean
(T101's entry edits beside T073's header and open_until).

Lane: openXfactory-3

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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