Repository navigation
B1b: codexFactory is a foreign owner to the doc-health nightly — owner slot via the openxfactory App - #853
Conversation
…he slot count keeps its spare Lane: provenance-autonomous-merge `tests/doc-health/test_submodule_owner_tokens.py` landed with PR #831 after the four B-slice drafts forked, so the identity sweep never saw it. Its three fixture rows spelled `xFactories/codexFactory` as `[email protected]:opensoft/codexFactory.git` and used it as the SAME-ORG, not-foreign, needs-no-slot control. After the 2026-09-09 transfer that repository is a FOREIGN owner to `opensoft/openxFactory`, so a bare respell would have left three tests asserting something now false — the reason the 6.5 precheck ruling (codeXfactory/codeXfactory#279, 2026-09-09T15:25Z) classes these four occurrences RENAME, non-mechanical, and assigns them to slice B1b rather than folding them into #801. WHAT THE PRODUCTION CHANGE TURNED OUT TO BE, and why it is only this: #831's mechanism derives the owners DYNAMICALLY from the aggregation's `.gitmodules` and lets `actions/create-github-app-token@v2` resolve the installation from its own `owner:` input, so nothing in the workflow names any organization and the moved core needs no new line and no new secret. The App behind `XFACTORY_APP_ID` is App `4253636` (`openxfactory`); it already carries installation `160352673` on `codeXfactory` (all repositories, `contents: write`, created 2026-09-09), beside `157085693` on `MedxSoft` and `160353680` on `ledgerXfactory` — one App, one installation per organization, exactly the shape the slot mechanism assumes. What the flip DOES consume is the SPARE slot. `FOREIGN_OWNER_SLOTS` was "3" for two owners, and the file says why in its own words: "one spare slot so the next repoint is a `.gitmodules` edit and not a red nightly". From opensoft/xFactory#376 the governed set spans THREE — `MedxSoft`, `ledgerXfactory`, `codeXfactory` — which fills all three and leaves the next repoint to red the nightly in the refusal step, the #366 failure again one organization later. So the count moves 3 -> 4 with a fourth mint step and a fourth `OWNER_`/`TOKEN_` pair in BOTH the prepare and finalize jobs, which is the procedure the refusal message itself prescribes, carried out ahead of the flip rather than after it. Today's still-`opensoft` URL is untouched by all of this: at two owners the detection behaves exactly as it does on main. The tests now measure that, not a literal: * the same-org controls move to submodules that genuinely stayed in `opensoft` — `xFactories/OpsxFactory` and `openxFactory`. NOT `xFactories/MedxFactory`, which the ruling suggested: it lives in `MedxSoft` and would have made a one-foreign-owner tree into a two-owner one; * `test_installs_are_not_governed_and_do_not_demand_a_slot` respells its governed row to `codeXfactory/codexFactory` and now proves the filter by the DIFFERENCE between two foreign rows — the governed one takes a slot, the `installs/` one reaches neither a slot nor `owners_all`; * the broad-rewrite assertion resolves `[email protected]:codeXfactory/codexFactory.git` to the codeXfactory INSTALLATION token, not to the caller-org token it used to get as a same-org repository, with a still-`opensoft` submodule left in the test to prove the broad key still serves everything else; * new `test_the_moved_core_becomes_a_foreign_owner_and_gets_a_slot` runs the detection over the aggregation's post-#376 governed shape: three owners, return code 0, all three in slots, the moved core's slot has a mint step in both jobs, and slot 4 is still empty. The pre-flip shape is not duplicated — it is already `test_two_foreign_owners_now_fill_two_slots`, which is today's real tree; * the behavioral fixtures read `FOREIGN_OWNER_SLOTS` out of the workflow instead of typing `3`, so the over-the-limit refusal case is derived from the declared count and the `clean_env` leak list covers every slot rather than the three someone listed by hand. No `openspec/` path is touched, deliberately: the gated drafts #802/#805/#806 share that evidence file and this PR must stay outside the Rule 6 landing window. The coverage arithmetic is in the PR body. Local: `pytest tests/doc-health` 1637 passed / 0 failed (371s), of which this file is 29 (28 before). The four other suites that read this workflow (`tests/openxwallet_pin/test_aggregation_lane_wiring.py`, `tests/avatar_runtime/test_ruled_values_pinned.py`, `tests/ideation-dashboard/test_nightly_lane.py`, `tests/ideation-dashboard/test_dashboard_source_seal.py`) 116 passed. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
🔵 Needs a closer look
It changes CI authentication behavior in a reusable workflow and relies on external GitHub App installations/owner topology that can’t be fully validated from the diff alone.
Pull request overview
This PR updates the doc-health reusable workflow and its fixtures to treat codeXfactory as a foreign submodule owner after the codexFactory repository transfer, ensuring the nightly can mint an installation token for the moved owner while preserving a spare foreign-owner slot.
Changes:
- Increase
FOREIGN_OWNER_SLOTSfrom 3 → 4 and add the corresponding “Mint app token for foreign submodule owner 4” +OWNER_4/TOKEN_4wiring in bothprepareandfinalize. - Update
tests/doc-health/test_submodule_owner_tokens.pyfixtures to reflectcodeXfactoryas a foreign owner, move same-org controls to stableopensoftsubmodules, and derive slot-count expectations from the workflow instead of hardcoding. - Add a new behavioral test asserting the “moved core” is detected as a foreign owner and is assigned a slot while keeping at least one spare slot.
File summaries
| File | Description |
|---|---|
tests/doc-health/test_submodule_owner_tokens.py |
Updates fixtures/expectations for the moved owner, derives slot count from workflow, and adds coverage for the third-foreign-owner scenario. |
.github/workflows/doc-health-reusable.yml |
Expands foreign-owner token minting capacity (slots 3→4) and wires slot 4 through mint + rewrite steps in both jobs. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| `codeXfactory`, so the repository these fixtures used as the SAME-ORG, | ||
| not-foreign, needs-no-slot control is now the very thing that DEMANDS a slot. | ||
| Respelling the string alone would have made three tests assert something now | ||
| false, which is why the ruling classes it a rename that is not a `sed`: |
Lane: provenance-autonomous-merge
Slice B1b of
adopt-codexfactory-repository-identity, assigned by the 6.5 precheck ruling on codeXfactory/codexFactory#279: https://github.com/codeXfactory/codexFactory/issues/279#issuecomment-5604370445 (2026-09-09T15:25Z, under the 15:24Z precheck that found the four unassigned occurrences).tests/doc-health/test_submodule_owner_tokens.py:264,275,286,378landed with #831 ("doc-health-nightly: mint one App token per foreign owner") after the four B-slice drafts forked at7681e409, so the identity sweep never saw the file. Its three fixture rows spelledxFactories/codexFactoryas[email protected]:opensoft/codexFactory.gitand used it as the same-org / not-foreign / no-slot control. After the 2026-09-09 transfer that repository is a foreign owner toopensoft/openxFactory, so a bare respell would have left three tests asserting something now false — hence RENAME, non-mechanical.What the production change turned out to be, and why only this
#831's mechanism derives the owners dynamically from the aggregation's
.gitmodulesand letsactions/create-github-app-token@v2resolve the installation from its ownowner:input. No organization is named anywhere indoc-health-reusable.yml, so the moved core needs no new line of detection logic and no new secret — only its installation, which exists:MedxSoftopenxfactoryledgerXfactoryopenxfactorycodeXfactoryopenxfactorycontents: writeApp 4253636 is the App behind
XFACTORY_APP_ID(the org secret isvisibility: selectedtoopensoft/xFactory, the nightly's caller). One App, one installation per organization — exactly the shape the slot mechanism assumes.What the flip DOES consume is the spare slot.
FOREIGN_OWNER_SLOTSwas"3"for two owners, and the file states the reason in its own words: "one spare slot so the next repoint is a.gitmodulesedit and not a red nightly." From opensoft/xFactory#376 the governed set spans three (MedxSoft,ledgerXfactory,codeXfactory), which fills all three and leaves the next repoint to red the nightly in the refusal step — the #366 failure again, one organization later. So the count moves 3 → 4, with a fourth mint step and a fourthOWNER_/TOKEN_pair in both theprepareandfinalizejobs. That is precisely the procedure #831's own refusal message prescribes, carried out ahead of the flip rather than after it.Today's still-
opensoftURL is unaffected: at two owners the detection behaves exactly as it does onmain(test_two_foreign_owners_now_fill_two_slots, which is today's real aggregation tree).Test changes
opensoft—xFactories/OpsxFactoryandopenxFactory. NotxFactories/MedxFactory, which the ruling's parenthetical suggested: measured against the aggregation'smain.gitmodules, MedxFactory lives inMedxSoft, so it would have turned a one-foreign-owner tree into a two-owner one.test_installs_are_not_governed_and_do_not_demand_a_slotrespells its governed row tocodeXfactory/codexFactoryand now proves the governed filter by the difference between two foreign rows: the governed one takes a slot; theinstalls/one reaches neither a slot norowners_all.[email protected]:codeXfactory/codexFactory.gittocredentialed(<codeXfactory installation token>, "codeXfactory", "codexFactory")— its own installation, not the caller-org token it used to receive as a same-org repository — with a still-opensoftsubmodule kept in the test so the broad key is still proved to serve everything else.test_the_moved_core_becomes_a_foreign_owner_and_gets_a_slot: runs the detection over the aggregation's post-Tick 2.5: wallet-validation is now a REQUIRED check via org ruleset 21538893 #376 governed shape (six rows, three organizations) and asserts count 3, exit 0, all three owners in slots, a mint step present in both jobs for whatever slot the moved core lands in (position issort -u+ locale, so it is looked up, not assumed),codeXfactoryinowners_all, and slot 4 still empty. It measures the invariant, not a literal pin.FOREIGN_OWNER_SLOTSout of the workflow instead of typing3: the over-the-limit refusal case derives its owner count from the declared one (a literal 4 would have stopped being over the limit the moment slot 4 landed), andclean_env's leak list covers every slot rather than the three someone listed by hand.opensoft/codexFactoryoccurrences remain in the file, including in prose — the two comments that would have carried one are worded without it, so the sweep closes here rather than leaving a literal to disposition.Coverage arithmetic
RENAME-class coverage at main: union 125/54 (B1–B4) + mapping key 2/1 (frozen by construction) + B1b 4/1 = 131/56.
Ordering
Lands AFTER #801 (merged
e86eca35) and BEFORE opensoft/xFactory#376 (the aggregation.gitmodulesflip); merge only on Brett Heap's word via laneprovenance-autonomous-merge.No path under
openspec/is touched, deliberately: the gated drafts #802/#805/#806 share that change's evidence file, and staying out ofopenspec/keeps this PR outside the Rule 6 landing window.Local verification
python3 -m pytest tests/doc-health -q→ 1637 passed, 0 failed (371.7s). The changed file alone: 29 passed (28 tests before, 29 after).doc-health-reusable.yml(tests/openxwallet_pin/test_aggregation_lane_wiring.py,tests/avatar_runtime/test_ruled_values_pinned.py,tests/ideation-dashboard/test_nightly_lane.py,tests/ideation-dashboard/test_dashboard_source_seal.py) → 116 passed.tests/tree is left to thepytest-suitegate on this PR (~24 min there): the change adds passing tests only, soEXPECT_SKIPPED: "21"is unmoved and theMIN_SELECTED/MIN_PASSEDfloors only gain margin.🤖 Generated with Claude Code