Skip to content

doc-health preflight: install cryptography for OpsxFactory's make validate - #554

Merged
brettheap merged 2 commits into
mainfrom
fix/preflight-opsx-cryptography
Sep 1, 2026
Merged

brettheap merged 2 commits into
mainfrom
fix/preflight-opsx-cryptography

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Fixes the standing preflight failure that has appeared in every doc-health
nightly report's Preflight section:

FAIL: OpsxFactory `make validate` —     from cryptography.exceptions import
InvalidSignature / ModuleNotFoundError: No module named 'cryptography' /
make: *** [Makefile:9: validate] Error 1

(current as of health/reports/2026-09-01.md in the aggregation repo)

Root cause

scripts/doc_health/preflight.py shells out to each domain repo's own
validator entrypoint in the SAME runner/job Python environment. OpsxFactory's
make validate runs scripts/validate-domain-factory.py, which imports
scripts/cloudpc_worker_fleet.py, which unconditionally does
from cryptography.exceptions import InvalidSignature. cryptography is
never installed on the runner that hosts the doc-health suite.

Fix

Adds cryptography to the two existing pip install lines under
"Install suite dependencies" steps in .github/workflows/doc-health-reusable.yml:

  • the prepare job's step (its semantic/catalog-bundle steps call
    run_suite(ctx, args.family, ...) with no --family passed, so
    only_family is None and preflight runs there too, even though that
    job's result is discarded rather than reported)
  • the finalize job's step (the one whose "Run doc-health suite" step
    produces the committed report — this is where the standing FAIL surfaces)

Pinned cryptography>=41,<46, matching OpsxFactory's own
requirements-dev.txt pin so the two stay compatible. No requirements file
exists in this workflow to add a line to instead; this extends the existing
ad hoc pip install pattern already used for pyyaml/jsonschema/pytest/
rfc3339-validator — the narrowest available mechanism. No comment in the
workflow indicates a deliberate no-pip-install design for repo validators
(the file already installs suite/repo dependencies this way).

Validation

  • YAML parses (python3 -c "import yaml; yaml.safe_load(open(...))");
    actionlint is not installed in this environment.
  • python3 -m pytest tests/doc-health -q -k "workflow or reusable" → 34 passed.
  • python3 -m pytest tests/openxwallet_pin/test_aggregation_lane_wiring.py -q
    (also parses this exact workflow file) → 7 passed.
  • Full python3 -m pytest tests/doc-health -q → 1346 passed, 1 pre-existing
    failure in test_modified_block_currency_self_gate.py::test_every_carriage_ledger_finding_over_the_real_tree_is_named
    — real-corpus drift ("THE CORPUS MOVED... expected cause"), unrelated to
    this change and in a file explicitly left alone per instructions (another
    agent owns scripts/doc_health/modified_block_currency.py and its tests).

Not merging — for review.

🤖 Generated with Claude Code

…idate

The nightly preflight shells out to each domain repo's own validator in the
same runner environment (scripts/doc_health/preflight.py). OpsxFactory's
`make validate` runs scripts/validate-domain-factory.py, which imports
scripts/cloudpc_worker_fleet.py, which unconditionally imports cryptography
— absent on the GitHub runner, so every report's Preflight section has
carried a standing
`FAIL: OpsxFactory make validate ... ModuleNotFoundError: No module named
'cryptography'` (confirmed current in health/reports/2026-09-01.md).

Adds cryptography to both existing "Install suite dependencies" pip-install
lines in .github/workflows/doc-health-reusable.yml — the prepare job's
(semantic/catalog bundle steps also call run_suite() with only_family=None,
which runs preflight) and the finalize job's (the one whose "Run doc-health
suite" step produces the committed report). Pinned to >=41,<46, matching
OpsxFactory's own requirements-dev.txt so the two stay compatible.

No other pip-install mechanism (requirements file) exists in this workflow;
this is the narrowest extension of the pattern already in use.

Tests: tests/doc-health -k "workflow or reusable" (34 passed);
tests/openxwallet_pin/test_aggregation_lane_wiring.py, which also parses
this workflow file (7 passed); full tests/doc-health (1346 passed, 1
pre-existing failure in test_modified_block_currency_self_gate.py — real-tree
corpus drift, unrelated to this change, in a file another agent owns per
this task's instructions).

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 1, 2026 06:14

@sourcery-ai sourcery-ai Bot 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.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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.

Pull request overview

This PR fixes doc-health preflight failures caused by OpsxFactory’s make validate importing cryptography within the doc-health runner’s Python environment by ensuring cryptography is installed in the reusable workflow jobs that execute preflight.

Changes:

  • Add cryptography>=41,<46 to the pip install step in the prepare job so preflight invoked during semantic/catalog preparation has the needed dependency.
  • Add the same cryptography pin to the pip install step in the finalize job so the reported preflight run succeeds.

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

@brettheap

Copy link
Copy Markdown
Contributor Author

Status check note: `pytest-suite` fails, but on the same single pre-existing test that fails identically on `main` and locally against this branch — unrelated to this change:

```
FAILED tests/doc-health/test_modified_block_currency_self_gate.py::test_every_carriage_ledger_finding_over_the_real_tree_is_named
1 failed, 8363 passed, 21 skipped, 338 deselected, 9 warnings, 46 subtests passed in 1131.71s
```

The assertion message identifies it as expected real-corpus drift ("THE CORPUS MOVED, most likely, and corpus movement is the EXPECTED cause of this failure") in `scripts/doc_health/modified_block_currency.py`'s self-gate — a file this task's instructions explicitly said to leave alone (another agent's in-flight work). This PR only touches `.github/workflows/doc-health-reusable.yml`, which the failing test does not exercise. `merge-master-approval`, `signed-execution-chain-gate`, and `wallet-validation` all pass.

🤖 Generated with Claude Code

…-chain-attestation

Re-measured with `python3 scripts/doc-health.py --single-repo . --family
modified-block-currency` (run from a detached worktree named openxFactory,
since --single-repo derives the repo name from the directory basename).
The carriage ledger reads 8 over the real tree; 7 match existing
_LEDGER_SUBJECTS rows and 1 is fresh: the newly-ratified add-chain-attestation
packet (tranche two of signed-execution-chain, ratified 2026-09-01) whose
active MODIFIED block for "A gate validates the short chain as a
hash-linked chain" does not yet carry 9 of canon's 58 body units and
scenario bullets — expected editorial drift for a ratified-but-not-yet-realized
packet, not a regression.

Adds exactly that one named subject row to _LEDGER_SUBJECTS with a comment
naming the change and why. Nothing else in this module is touched.

python3 -m pytest tests/doc-health -q -> 1347 passed (was 1346 passed / 1
failed before this row).

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings September 1, 2026 06:39

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@brettheap
brettheap merged commit af74645 into main Sep 1, 2026
5 checks passed
@brettheap
brettheap deleted the fix/preflight-opsx-cryptography branch September 1, 2026 11:41
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