Skip to content

openxFactory's own Merge Master review lane, advisory: the repository gate floor finally gets a reader - #439

Merged
brettheap merged 2 commits into
mainfrom
025-openxfactory-review-lane-caller
Aug 28, 2026
Merged

brettheap merged 2 commits into
mainfrom
025-openxfactory-review-lane-caller

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

What this is

openxFactory's own Merge Master review lane — the workflow-instance half of
add-substantive-review-lane task 5.1 ("opensoft/openxFactory gets its own workflow
instance ... since pull_request_target fires in the repo the PR targets").

One pull_request_target job, named exactly merge-master-approval, checks out
opensoft/codexFactory at a recorded pin, gathers the candidate's changed paths provably
complete, and reports which of this repository's never-clearable paths the pull request
touches — evaluated by the pinned core's own repository_floor.py against
scripts/merge_master/openxfactory-review-authority-floor.yaml.

That floor has been committed in codexFactory since the 015-widen-review-authority-floor
work and nothing in openxFactory read it.
Now something does.

A correction to the framing this was requested under

The brief named xFactory's .github/workflows/review-lane.yml and its
uses: …/review-lane-reusable.yml@<sha> line as the precedent to mirror. That is the wrong
precedent for the stated goal, and the reason is recorded in the workflow header and
plan.md D1 so nobody re-derives it:

  • review-lane-reusable.yml reports no check named merge-master-approval, and its
    xFactory caller is workflow_dispatch only — it never runs on a pull request.
  • The merge-master-approval check name comes from a job id. GitHub names a called
    workflow's check-runs <caller job>/<called job>, so a caller that uses: a reusable can
    only ever produce merge-master-approval / prepare — never the literal token a future
    ruleset would require.

The workflow that actually produces that check is a single non-reusable pull_request_target
job: codexFactory's own merge-master-approval.yml and xFactory's aggregation caller of the
same name. That is the shape mirrored here.

What it does NOT do

Itemized, because each is a thing a reader would otherwise assume landed.

  • No approval. No approver-App token minted, no review submitted, no merge call, no
    auto-merge. The absence is structural — the steps are gone, not disabled by a condition
    — and the test asserts the absence over the file text (MERGE_MASTER_APP_*, gh pr review,
    gh pr merge, /reviews, --auto, enablePullRequestAutoMerge, event=APPROVE).
  • No ruleset touched. This check is required by nothing, satisfies nothing, blocks nobody.
    Permissions are contents: read + pull-requests: read and nothing else.
  • No enrolled candidate class, and no envelope instance. codexFactory's envelope schema
    requires candidates with minItems: 1 (and envelope.py mirrors it at runtime), so there
    is no legal empty envelope — and add-substantive-review-lane task 3.2 still owes the
    gate_rules_council record that would define openxFactory's classes. A placeholder
    candidate would be inventing the enrollment task 3.2 exists to grant. No tier-1 decision is
    computed at all.
  • No wallet-bound exercise record. governance/review-authority/register.yaml row
    row-mrc-0001 records act-tier authority for the merge-readiness council over
    opensoft/openxFactory. This lane claims no exercise of it. A wallet-signed exercise
    verified at check_verdict is S3 of add-wallet-carried-review-authority and is
    unlanded; until it does, such an act records as event_class: unauthenticated_request /
    unattributed, which openxwallet/spec.md rules "is not assigned to a holder".
  • No revocation check. S5's revocation-at-verdict-consumption, staleness bound, and
    unreadable-register-refuses rule are not implemented.
  • Task 5.1 is not ticked. Its ruleset half stays owed, behind S3 + S5 and its own ratified
    ruleset change.

The pinned sha

opensoft/codexFactory@58bd3cf79b91da26aced95c2000576981d9445c8 (origin/main HEAD as observed
2026-08-27), recorded in contracts/review-lane-pin.yaml (kind: pinned_workflow),
code-owner-routed in .github/CODEOWNERS, declared as a CROSS_REPOSITORY derivation-pin-class
member in scripts/doc_health/pin_class.py, and tied by
tests/review_lane_pin/test_review_lane_caller.py.

It diverges from xFactory's 3c35ca8b by force, not by preference. xFactory pins that
commit in lockstep across both its merge-master surfaces, and at 3c35ca8b
scripts/merge_master/ contains neither repository_floor.py nor
openxfactory-review-authority-floor.yaml. Since the floor evaluation is the only thing this
caller does, the older pin cannot run it. The pin file records the divergence, names both
xFactory surfaces it is out of step with, and states the convergence obligation for a future
re-point ceremony.

Why a pin file at all: xFactory vendors codexFactory as a submodule, so its working rule
#2 can say the pin must equal the gitlink and tests/test_review_lane_workflow.py asserts it.
openxFactory has no such gitlink, so the file is the referent and the test is the tie.

Secrets status — one is missing, and nothing was created

identifier where available to openxFactory
OPENXFACTORY_APP_ID / OPENXFACTORY_APP_PRIVATE_KEY repo yes (tried first)
XFACTORY_APP_ID / XFACTORY_APP_PRIVATE_KEY org, selected no — only opensoft/Omnigent-Install, opensoft/xFactory
MERGE_MASTER_APP_KEY / vars.MERGE_MASTER_APP_ID org, selected no — and not needed: this lane cannot approve

So the lane needs exactly one grant, whichever is easier:

  1. install the App behind OPENXFACTORY_APP_* on opensoft/codexFactory (Contents: read), or
  2. add opensoft/openxFactory to the selected list for XFACTORY_APP_ID /
    XFACTORY_APP_PRIVATE_KEY.

Until then the check fails red, by name, listing exactly the above. That is deliberate:
codexFactory's own caller goes green on absent App config because there the check is a required
gate and red would wedge every PR. Here it gates nothing, so a green run that read no core would
manufacture the appearance of a review that did not happen. A red advisory check blocks nobody.

The one thing this PR cannot prove about itself

pull_request_target runs the workflow definition from the base branch, so this workflow
does not run on the pull request that introduces it, and workflow_dispatch does not rescue
that (the platform resolves dispatchable workflows from the default branch). The first live
merge-master-approval report is the next openxFactory pull request after this lands.

The alternative — a plain pull_request trigger — would run this file from the PR head with the
credential that reads a private repository in scope, i.e. the exfiltration shape the base-branch
rule exists to prevent. Refused; pull_request is absent and the test asserts its absence.

What stands in pre-merge: the static test pins the trigger set, the single-job invariant, the
exact job id, three-way pin agreement (workflow ref: / job env / pin file), and the absence of
every approval-shaped step — with negative controls so each positive is one mutation from failing.

Validation run

  • pytest tests/review_lane_pin — 33 passed, 18 subtests, 0 skipped
  • pytest tests/doc-health/test_pin_reachability.py tests/review_lane_pin — 86 passed, 0 failed, 0 skipped
  • openspec validate --all --strict — 75 passed, 0 failed
  • actionlint v1.7.7 on the new workflow — clean, exit 0
  • openXwallet/scripts/wallet-yaml-syntax-gate.py . (pinned gate) — exit 0
  • whole-suite collection — 7196 collected (floor 7090), zero new skips so
    EXPECT_SKIPPED: "20" is unchanged

Named follow-ups, not performed here

  1. Operator: the one secret grant above.
  2. codexFactory: add contracts/review-lane-pin.yaml to
    openxfactory-review-authority-floor.yaml's never_clearable_paths — it determines which
    core judges this repository, the same argument the wallet pin's entry already makes.
  3. add-substantive-review-lane task 3.2 remains the gate on any envelope instance here.
  4. Task 5.1's ruleset half, behind S3 + S5.
  5. A re-point ceremony converging this pin with xFactory's two surfaces.

🤖 Generated with Claude Code

… a reader

Realizes the WORKFLOW-INSTANCE half of add-substantive-review-lane task 5.1.
codexFactory has shipped openxFactory's repository gate floor
(scripts/merge_master/openxfactory-review-authority-floor.yaml) since the
015-widen-review-authority-floor work and nothing in openxFactory read it.
Now one `pull_request_target` job named exactly `merge-master-approval` checks
out the decision core at a recorded pin, gathers the candidate's changed paths
provably complete, and reports which never-clearable paths the pull request
touches.

ADVISORY, structurally. No approver token is minted, no review is submitted,
no merge is called, no auto-merge is enabled, no ruleset is touched, and no
candidate class is enrolled — the envelope schema requires a non-empty
`candidates` list and task 3.2 still owes the gate_rules_council record that
would define one. The absence is the mechanism, not a condition, and the test
asserts it over the file text.

Two things this deliberately does NOT claim: no wallet-bound exercise record
(S3 of add-wallet-carried-review-authority) and no revocation check (S5). The
`act`-tier authority in governance/review-authority/register.yaml is not
exercised here.

The pin is recorded rather than trusted. openxFactory has no codexFactory
gitlink, so contracts/review-lane-pin.yaml (kind: pinned_workflow) is the
referent and tests/review_lane_pin/ is the tie; the pin is code-owner-routed
and declared as a CROSS_REPOSITORY derivation-pin-class member. It diverges
from xFactory's 3c35ca8b by force, not by preference: that commit carries
neither repository_floor.py nor the openxFactory floor, so it cannot evaluate
the only thing this caller evaluates. The convergence obligation is recorded
in the pin.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 27, 2026 22:42

@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 ✨

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 introduces openxFactory’s own merge-master-approval GitHub Actions workflow instance (advisory-only) that pins and checks out opensoft/codexFactory’s Merge Master decision core, gathers PR changed paths provably-complete, evaluates the openxFactory repository-floor from the pinned core, and renders an advisory verdict to the job summary. It also adds a committed pin artifact and a static pytest module to prevent silent pin drift and to assert the workflow’s “cannot approve” constraints.

Changes:

  • Add .github/workflows/merge-master-approval.yml advisory pull_request_target workflow that checks out the pinned codexFactory core and evaluates the openxFactory floor.
  • Add contracts/review-lane-pin.yaml and extend scripts/doc_health/pin_class.py so the cross-repo pin is a declared derivation-pin-class member.
  • Add tests/review_lane_pin/test_review_lane_caller.py to statically assert pin agreement, trigger/permissions invariants, and the structural absence of approval/merge behavior; route the pin file via CODEOWNERS.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/merge-master-approval.yml New advisory Merge Master lane workflow; pins codexFactory core, gathers complete changed paths, evaluates openxFactory floor, renders summary.
contracts/review-lane-pin.yaml Records the pinned codexFactory commit and the governed caller plus pinned members and scope constraints.
scripts/doc_health/pin_class.py Declares contracts/review-lane-pin.yaml as a CROSS_REPOSITORY pin-class member keyed by core_commit.
tests/review_lane_pin/test_review_lane_caller.py Static drift/invariant test suite tying workflow ref: to the committed pin and asserting non-approval constraints.
.github/CODEOWNERS Routes the new pin file to a human code owner.
specs/025-openxfactory-review-lane-caller/{spec.md,plan.md,tasks.md,checklists/requirements.md} Feature spec/plan/tasks/checklist documenting goals, constraints, and validation expectations.

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

Comment on lines +538 to +560
floor_path = None
for name in sorted(os.listdir(governance_dir)):
if not name.endswith((".yaml", ".yml")):
continue
candidate = os.path.join(governance_dir, name)
with open(candidate, encoding="utf-8") as handle:
document = yaml.safe_load(handle)
if not isinstance(document, dict):
continue
if document.get("kind") != "repository_gate_floor":
continue
if (document.get("floor") or {}).get("repository") != target:
continue
floor_path = candidate
try:
floor = parse_repository_floor(document, tree_paths=tree)
except GovernanceDocumentError as exc:
print(json.dumps({"ok": False, "stage": "floor_unreachable",
"document": candidate, "reason": str(exc)}))
raise SystemExit(0)
break

matched = list(floor.matching_paths(changed))
@brettheap

Copy link
Copy Markdown
Contributor Author

Pre-merge evidence: the floor evaluator was run verbatim against the pinned core

Since pull_request_target cannot report on this pull request (the definition is read from the
base branch, where this file does not exist yet), the substantive check was run locally, from
the shipped bytes
: the inline Python was extracted verbatim out of
.github/workflows/merge-master-approval.yml (80 lines, no edits) and executed against
opensoft/codexFactory@58bd3cf7 materialized at the recorded pin, with this repository's real
git ls-tree -r --name-only HEAD supplied as tree_paths so the floor's reachability check was
live.

Case A — this pull request's own 9 changed paths:

{"ok": true,
 "floor_id": "openxfactory-review-authority-register",
 "repository": "opensoft/openxFactory",
 "never_clearable_paths": ["governance/review-authority/register.yaml",
                           "contracts/openxwallet-pin.yaml", "openXwallet"],
 "changed_path_count": 9,
 "matched_paths": [],
 "rule_documents": ["codexfactory-routine-code-clearance.yaml",
                    "nightly-sweep-council-clearance.yaml"]}

Case B — a candidate touching all three floored paths plus one unfloored path:

{"ok": true,
 "changed_path_count": 4,
 "matched_paths": ["governance/review-authority/register.yaml",
                   "contracts/openxwallet-pin.yaml", "openXwallet"]}

So all four of the moving parts are proven together: the pinned core imports, its
load_governance_paths accepts the whole governance directory (both per-repo rules resolve, no
unknown kind, no duplicate floor), the opensoft/openxFactory floor is selected by repository,
the opt-in reachability check passes against the live tree, and matching_paths discriminates
correctly in both directions.

What did and did not report on this pull request

  • wallet-validation — pass (the required check; the register was positively asserted read)
  • pytest-suite — running
  • merge-master-approval — absent, exactly as designed. pull_request_target evaluates the
    base-branch definition, so a workflow not yet on main does not run. This is stated up front
    in the workflow header and in plan.md D4 rather than discovered. The first live report is the
    next openxFactory pull request after this lands.

🤖 Generated with Claude Code

Sections 1-5 are ticked against measured evidence, not against intent: the
forced pin divergence (3c35ca8b carries neither pinned member), the secret
reality (no secret created), the verbatim end-to-end run of the workflow's own
floor evaluator against the pinned core in both directions, and every gate's
result including actionlint fetched because it was not on PATH.

5.6 records the gap rather than hiding it: `merge-master-approval` did NOT
report on #439, because `pull_request_target` evaluates the base-branch
definition and this file is not on main yet. That was predicted in the header
and in plan.md D4, and it is why the floor evaluator was proven by hand instead.

Section 6's five follow-ups stay OPEN on purpose — the secret grant, the
codexFactory-side floor entry for this pin, task 3.2's gate_rules_council
record, task 5.1's ruleset half behind S3+S5, and the pin convergence ceremony.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 27, 2026 22:59

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 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

.github/workflows/merge-master-approval.yml:226

  • The token-mint step is gated on steps.preflight.outputs.identity, so if both the repo App secrets and org App secrets are present, only the repo token is minted. That makes the workflow fail even when the org App would have worked (e.g., if option 2 is granted but the repo App is not installed on opensoft/codexFactory). Gate this step directly on env.HAS_REPO_APP_KEY so both tokens can be minted when available and the checkout can fall back to the org token.

This issue also appears on line 233 of the same file.

      - name: Mint content-App token (this repository's App)
        id: repo-token
        if: steps.preflight.outputs.identity == 'repo'
        continue-on-error: true
        uses: actions/create-github-app-token@v2

.github/workflows/merge-master-approval.yml:237

  • The org App token mint is currently gated on steps.preflight.outputs.identity == 'org', which prevents minting it when the repo App secrets are also present. To enable a true repo-first / org-fallback behavior, mint the org token whenever env.HAS_ORG_APP_KEY is true and let the core checkout pick the first non-empty token.
      - name: Mint content-App token (the org App)
        id: org-token
        if: steps.preflight.outputs.identity == 'org'
        continue-on-error: true
        uses: actions/create-github-app-token@v2

@brettheap
brettheap merged commit b223b0b into main Aug 28, 2026
3 checks passed
@brettheap
brettheap deleted the 025-openxfactory-review-lane-caller branch September 2, 2026 18:54
brettheap added a commit that referenced this pull request Sep 14, 2026
… three places the hold was, mismatches named

LIFT posted on cxF #279 (5661634651), PR #439 (5661635340) and LANES.md (837c9e9) after § 13.1 (EMPTY) and § 13.2 (ahead). § 9 carries a dated pointer; § 13.6 row closed; § 13.2 gains its 'posted in full at' line (#279 5661631470). Releases the gate_rules_council hold only; the two 2026-09-11 C2 words stay owed at 6.25–6.26.

Lane: codexfactory-2 (codeXfactory-2)

Co-Authored-By: Claude Fable 5.1 <[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