Skip to content

T015: the submit verb, route and control (plan 038) - #96

Merged
brettheap merged 35 commits into
mainfrom
r2/t015-submit-verb
Oct 9, 2026
Merged

brettheap merged 35 commits into
mainfrom
r2/t015-submit-verb

Conversation

@brettheap

@brettheap brettheap commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Arc: neutral-product-standalone-operability

T015: the submit verb, route and control (plan 038, P4-C)

Stack: #92 (T011) landed as 09b8d44a, #93 (T014) as a7a1c4d3, and #90 (T012/T013) as 6827cafc. This branch merges main at 6827cafc, so its diff against main holds T015's files and the collateral the holder admitted (listed below), nothing else.

What it adds

  • opendox submit --repo-root PATH --branch BRANCH [--local] [--json] (new src/opendox/cli_branch_actions.py). This is 12.4a's ratified shape.
    • It is contributed through default_profile.py's SUBCOMMAND_EXTENSIONS (N-2).
    • It pushes through T014's cli._submission_port binding: LocalGitSubmissions by default, which is plain git and never gh. Where a host contributes a port, it uses that one (R2Q4 (a)).
    • It prints the Submission report (remote, ref, URL with any credential redacted, branch and commit), or one JSON object with --json.
    • No actor gate (OQ-12-9).
    • The install mode is not read (N-17). --local is refused only where it disagrees with OPENDOX_INSTALL_MODE=hosted, and the refusal names both.
    • Refusals are a named sentence on stderr with exit 1, with nothing pushed and no traceback:
      • main (R2Q5 (a)), before any port is asked;
      • no remote, or several and none named origin;
      • several push URLs, or a rejected push;
      • a report that does not name where the work went;
      • a failure the port did not name. This one gets a fixed sentence naming the exception's type alone.
    • Redaction and checks at the boundary.
      • The report's url and remote, and every refusal's message, pass through redacted_text where both doors print them (12.1a). Every scheme:// URL in them goes through redact_destination first, which treats any non-ssh userinfo, and every query and fragment value, as a secret. The host is kept.
      • The report's branch, ref and commit are checked rather than trusted. They must be the submitted branch, refs/heads/<that branch>, and a full object name.
      • Both hold whoever answered, a host's contributed port included.
  • POST /actions/session/submit (new src/opendox/serve_branch_actions.py). It is contributed through the default profile's ROUTE_EXTENSIONS (BranchActionRouteExtension) and HANDLER_CONTRIBUTIONS (the BranchActionRoutes mixin).
    • 12.4a's three-clause gate runs before any body byte is read:
      1. off loopback → 403 loopback_only. This is the hosted plane's refusal, and it is the route's own.
      2. no session capability or no resolved actor → 403 action_unavailable.
      3. not the human console (the console token, a trusted Host, a JSON body, no foreign Origin or Referer) → 403 agent_invocation.
    • The body carries branch alone. Any other key, repo_root included, gives 400. The route takes no repository from the request.
    • Answers:
      • no port → 403;
      • NoSubmissionTarget → 409 no_submission_target;
      • other SubmissionError → 409 submission_refused;
      • any other exception → 500 submission_failed, with only the type logged;
      • success → 200 with the Submission object.
  • actions.submit (serve.py compute_capabilities).
    • The key is PRESENT only where a route binding answers POST /actions/session/submit, which happens only under openDox's own profile.
    • Its VALUE is the local human's: actor, real checkout and loopback, derived from the bindings as gate's is (answers_the_submit).
    • Core _DEFAULT_CAPABILITIES gains nothing (OQ-12-14). A host profile that replaces the default sees no submit key, route, handler or verb (R2Q3 (a)).
  • The submit control (new src/opendox/web/views/branch-actions.js, wired by web/app.js and web/index.html).
    • It is keyed on actions.submit === true and the console token, never on session.
    • It is not offered in a composed render.
    • It is withheld while an active key names another repository than the one /capabilities declares as repository, because the route pushes from the served checkout alone. With no repository active, as on a standalone plane, which has no snapshot index, it is offered (anotherRepositoryIsActive; Copilot's finding and lane 3's MAJOR, below).
    • The account menu's access line names submit where it is granted (views/account-menu.js, admitted below; Codex's finding, below).
    • It never proposes or sends main, and it states a refusal in the server's own words.
    • The census fixture and tests/test_web_boundary.py gain its rows and its two boundary tests.

The falsifier, run (red first)

Red, stage 1. The base tree with this PR's tests and no src change:

E   ImportError: cannot import name 'serve_branch_actions' from 'opendox' (…/red-base/src/opendox/__init__.py)
ERROR tests/test_submit_route.py
1 error in 0.60s

Red, stage 2. The two modules present but not wired into the default profile. Each route node answered {'error': 'unknown_action', 'message': 'no such action route'}, and each CLI case exited with SystemExit: 2:

FAILED tests/test_submit_route.py::test_submit_route_is_refused_off_loopback
FAILED tests/test_submit_route.py::test_submit_route_is_refused_without_a_resolved_actor
FAILED tests/test_submit_route.py::test_submit_route_is_refused_without_the_console_token[absent]
FAILED tests/test_submit_route.py::test_submit_route_is_refused_without_the_console_token[wrong]
FAILED tests/test_submit_route.py::test_submit_route_is_refused_from_a_foreign_origin[Origin]
FAILED tests/test_submit_route.py::test_submit_route_is_refused_from_a_foreign_origin[Referer]
FAILED tests/test_submit_route.py::test_submit_route_takes_no_repository_from_the_request[repo_root]
FAILED tests/test_submit_route.py::test_submit_route_takes_no_repository_from_the_request[repository]
FAILED tests/test_submit_route.py::test_submit_route_takes_no_repository_from_the_request[checkout_root]
FAILED tests/test_cli_branch_actions.py::test_submit_pushes_the_branch_and_reports_where_it_went
…
FAILED tests/test_cli_branch_actions.py::test_the_default_profile_contributes_submit
31 failed, 4 passed in 22.32s

Green, at e7ee97b8:

$ python -m pytest -q -rA <F12.2's five test_submit_route.py nodes> tests/test_submit_route.py::test_a_host_profile_replacing_the_default_sees_no_submit_key
PASSED tests/test_submit_route.py::test_submit_route_is_refused_off_loopback
PASSED tests/test_submit_route.py::test_submit_route_is_refused_without_a_resolved_actor
PASSED tests/test_submit_route.py::test_submit_route_is_refused_without_the_console_token[absent]
PASSED tests/test_submit_route.py::test_submit_route_is_refused_without_the_console_token[wrong]
PASSED tests/test_submit_route.py::test_submit_route_is_refused_from_a_foreign_origin[Origin]
PASSED tests/test_submit_route.py::test_submit_route_is_refused_from_a_foreign_origin[Referer]
PASSED tests/test_submit_route.py::test_submit_route_takes_no_repository_from_the_request[repo_root]
PASSED tests/test_submit_route.py::test_submit_route_takes_no_repository_from_the_request[repository]
PASSED tests/test_submit_route.py::test_submit_route_takes_no_repository_from_the_request[checkout_root]
PASSED tests/test_submit_route.py::test_a_host_profile_replacing_the_default_sees_no_submit_key
10 passed in 7.31s
$ python -m pytest -q tests/test_submit_route.py tests/test_cli_branch_actions.py
102 passed in 33.12s

F12.2's submission half, verbatim (opensoft/openXfactory#1144 tasks.md, the FALSIFIED BY block, dedented). It ran at e7ee97b8, this head, from a git archive of the commit, in a fresh venv (pip install ".[test]"), with a PATH holding git and no gh:

command -v gh: absent
…
Successfully installed … opendox-0.1.0 …
e8cc902cf58b660669f6b8ffff8349d5781a4b41        # git -C "$W/remote" rev-parse --verify sess-1
1 passed in 1.17s                                # test_server_unset_submission_factory_binds_the_neutral_default
1 passed in 1.57s                                # test_a_credential_in_the_remote_url_never_reaches_the_report
9 passed in 6.75s                                # the five test_submit_route.py nodes (parametrized)
F12.2-submission-half EXIT 0

Mutants: 74 over the code at this head, all killed

41 over the first head. One mutant first SURVIVED: S-gate2 capability dropped, which kept the actor clause and dropped the session capability. test_a_plane_whose_verdict_says_no_session_refuses_whatever_its_actor was added for it, and the kill was re-proven at 19b5aba5:

UNMUTATED: 1 passed in 1.74s
MUTATED: capability clause dropped
MUTANT: FAILED tests/test_submit_route.py::test_a_plane_whose_verdict_says_no_session_refuses_whatever_its_actor

The other 40, each killed by a named node:

S-gate1 loopback clause off | S-gate2 actor dropped | S-gate3 console clause off
S-body read before the gate | S-body problem ignored
S-requested not-a-dict | extra keys | message pick | str check | empty check
S-no port ignored | S-no-target code merged | S-unvetted text logged | S-success body | S-binding method
C-main refusal off | C-report str check | C-report empty check
C-mode always read | C-mode flag dropped | C-mode refusal ignored | C-refusal exit 0 | C-json off | C-binding bypassed
D-no submit verb | D-no submit route | D-no mixin
V-key always present | V-key always true | V-answers method
J-keyed on session | J-empty token | J-proposes main | J-sends main | J-refusal styled as success
J-button stays disabled | J-no token header | J-unoffered mounts | J-composed mounts | A-no mount

10 over lane 3's R1 fixes, run at a9616ee4 against tests/test_cli_branch_actions.py:

MN1 catch-all removed                    | KILLED …test_a_port_failure_it_did_not_name_is_refused_without_its_text[binding]
MN2 exception text printed               | KILLED …test_a_port_failure_it_did_not_name_is_refused_without_its_text[binding]
MN3 type not named                       | KILLED …test_a_port_failure_it_did_not_name_is_refused_without_its_text[binding]
MN4 unnamed failure exits 0              | KILLED …test_a_port_failure_it_did_not_name_is_refused_without_its_text[binding]
MN5 binding built outside the try        | KILLED …test_a_port_failure_it_did_not_name_is_refused_without_its_text[binding]
NM1 hosted not refused                   | KILLED …test_local_beside_hosted_is_refused_naming_both[hosted]
NM2 any non-local value refused          | KILLED …test_local_beside_any_other_value_is_accepted[Hosted]
NM3 value not stripped                   | KILLED …test_local_beside_hosted_is_refused_naming_both[ hosted ]
NM4 value matched case-insensitively     | KILLED …test_local_beside_any_other_value_is_accepted[Hosted]
NM5 flag not required                    | KILLED …test_without_local_the_install_mode_is_not_read[hosted]
DONE 10 / 10

1 that lane 3 did not reach: gate clauses 2 and 3 swapped. It was killed by F12.2's own node:

FAILED tests/test_submit_route.py::test_submit_route_is_refused_without_a_resolved_actor - AssertionError: {'error': 'agent_invocation', …}
FAILED tests/test_submit_route.py::test_each_refusal_is_made_before_the_body_is_read[no-actor]
2 failed, 49 passed in 24.38s -> KILLED

10 over the review-round guard (anotherRepositoryIsActive, 7dc8214b), run on an archive of 7dc8214b against tests/test_submit_route.py and tests/test_web_boundary.py. Two of them make the node harness throw, so its fixture errors:

BASELINE rc=0 | 72 passed in 23.69s
MS1 the predicate is always false                | KILLED …test_the_control_is_withheld_only_while_another_repository_is_active (2 failed)
MS2 the predicate is always true                 | KILLED …test_a_standalone_plane_offers_the_control_as_the_page_derives_it (2 failed)
MS3 no active key counts as another repository   | KILLED …test_the_control_is_withheld_only_while_another_repository_is_active (3 failed)
MS4 an empty key counts as another repository    | KILLED …test_the_control_is_withheld_only_while_another_repository_is_active (1 failed)
MS5 the comparison is inverted                   | KILLED 67 passed, 5 errors
MS6 the mount ignores the predicate              | KILLED …test_the_control_is_withheld_only_while_another_repository_is_active (2 failed)
MS7 the mount negates it (the e149dc56 shape)    | KILLED …test_a_standalone_plane_offers_the_control_as_the_page_derives_it (1 failed)
MS8 the mount compares the branch                | KILLED 67 passed, 5 errors
MR7 the shell passes no repository               | KILLED …test_web_boundary.py::test_every_web_file_is_classified_exactly_once (2 failed)
MR8 the shell passes the ref as the repository   | KILLED …test_the_submit_route_is_addressed_by_the_branch_actions_view_alone (1 failed)
DONE 10 / 10

1 over the admitted account-menu word, run on an archive of 88b26816:

MA1 the menu omits submit | KILLED …test_the_account_menu_names_submit_where_it_is_granted (1 failed)

11 over the redaction rule and the report checks (e7ee97b8), run on an archive of e7ee97b8 against tests/test_cli_branch_actions.py and tests/test_submit_route.py:

BASELINE rc=0 | 102 passed in 34.01s
MG1 refusal_text shows the raw message                     | KILLED …test_a_contributed_refusal_is_redacted_at_the_boundary[fragment] (9 failed)
MG2 no per-URL redaction pass                              | KILLED …test_a_contributed_report_is_redacted_at_the_boundary (11 failed)
MG3 the free-text pass made stricter (lane 3's MF6 shape)  | KILLED …test_a_credential_in_the_remote_url_reaches_neither_report_nor_refusal (6 failed)
MG4 the branch check dropped                               | KILLED …test_a_report_that_is_not_the_submissions_is_refused[branch-sess-2] (1 failed)
MG5 the ref check dropped                                  | KILLED …test_a_report_that_is_not_the_submissions_is_refused[ref-refs/heads/sess-2] (2 failed)
MG6 the ref check loosened to a suffix                     | KILLED …test_a_report_that_is_not_the_submissions_is_refused[ref-refs/tags/sess-1] (1 failed)
MG7 the commit check dropped                               | KILLED …test_a_report_that_is_not_the_submissions_is_refused[commit-ccc…] (3 failed)
MG8 the commit check ignores case                          | KILLED …test_a_report_that_is_not_the_submissions_is_refused[commit-CCC…] (1 failed)
MG9 the remote is not redacted                             | KILLED …test_a_contributed_report_is_redacted_at_the_boundary (2 failed)
MG10 the url is not redacted                               | KILLED …test_a_contributed_report_is_redacted_at_the_boundary (2 failed)
MG11 the URL pattern stops at the query                    | KILLED …test_a_contributed_refusal_is_redacted_at_the_boundary[fragment] (6 failed)
DONE 11 / 11

(Two replaced guards are not counted here. e149dc56's servesTheActiveRepository had its 8 mutants killed at 88b26816, and 7dc8214b replaced it. 2d64f42e's first redaction had its 7 (MX1–MX7) killed at 2d64f42e, and e7ee97b8 replaced it.)

The whole suite, as validate runs it

  • At e7ee97b8, this head, run locally as validate runs it (full11). The run used CI=1, OPENDOX_TEST_SANDBOX_REQUIRED=1 and LANG=C.UTF-8, every GIT_* and XF_* variable unset, a postgres:16 service reached through host.docker.internal, and the venv built with CI's install command. It reported 5899 passed, 11 skipped, 2 warnings in 3912.08s (1:05:12), exit 0.
  • full10 at e7ee97b8, the same way, at a load average of about 85: 1 failed, 5898 passed, 11 skipped in 2397 s, exit 1.
    • The one failure is a timing ratio this PR does not touch: tests_runtime/test_migrations_apply.py::test_the_draft_page_budget_does_not_read_the_bodies_it_sizes. It needs PostgreSQL's reading to take more than 4 × its sizing, and it measured 9.67 ms sizing against 29.50 ms reading. This PR changes neither that test nor anything under src/opendox/runtime/.
    • Re-run serially at a load average of about 125–132. At this head the node passed 3 times out of 3. On unmodified main 6827cafc it FAILED 3 times out of 3.
    • The same measurement, printed, gave sizing/reading here of 4.27/25.24, 6.23/23.23 and 5.54/30.66 ms, and on main of 9.36/30.56, 11.57/42.08 and 5.25/23.18 ms. It crosses the 4× bar on both sides.
    • So it is a load-induced timing flake outside this PR.
  • SKIPPED stays 11.
  • At 2d64f42e: 1 failed, 5885 passed, 11 skipped at a load average of about 90, exit 1.
    • The one failure was tests_runtime/test_oidc_verifier.py::test_one_ttl_boundary_causes_one_jwks_refresh_and_not_one_per_waiter, a wall-clock JWKS-refresh count (assert 3 == 2) in code this PR does not touch.
    • Run alone at that head it passed 5 times out of 5, and its whole file gave 29 passed.
    • CI's validate at 2d64f42e (run 37874675109) printed triple: selected=5897 passed=5886 skipped=11 failures=0 errors=0, with the sandbox's write outside its tmpfs refused.
  • At 7dc8214b: 5881 passed, 11 skipped, exit 0.
  • At d466f2b9, after the merge of main at 6827cafc: 5880 passed, 11 skipped, exit 0. 7dc8214b adds one case.
  • At a9616ee4, the same way: 5730 passed, 11 skipped, exit 0.
  • At 19b5aba5, before lane 3's R1 fixes: 5725 passed, 11 skipped, exit 0. R1's tests add the five cases.

Files

T015's Files line:

  • new src/opendox/cli_branch_actions.py
  • new src/opendox/serve_branch_actions.py
  • src/opendox/default_profile.py (the first phase-4 edit)
  • src/opendox/serve.py
  • new src/opendox/web/views/branch-actions.js
  • src/opendox/web/app.js
  • src/opendox/web/index.html
  • tests/fixtures/web_boundary_census.yaml: the views/branch-actions.js row, the app.js and index.html lines, and class A totals of 27 files and 18,912 lines. T104's rows are kept; class C has 14 files and 12,792 lines.
  • tests/test_web_boundary.py
  • new tests/test_submit_route.py
  • new tests/test_cli_branch_actions.py

Collateral, each admitted by the holder on opensoft/openXfactory#656

  • tests/test_default_profile.py (6023619783; docstring 6026622117 item 2). The default's verbs are now ["runtime", "submit"], and it declares HANDLER_CONTRIBUTIONS == (BranchActionRoutes,). The facet test's docstring now says so.
  • tests/test_capability_honesty.py (6027633398; the helper 6028383410).
    • GOVERNED gains "submit": ("POST", "/actions/session/submit").
    • _assert_every_true_flag_answers is a PROFILE-AWARE EQUALITY with a required default_profile keyword: the default profile's map equals GOVERNED, and a composed host's map equals GOVERNED less submit.
  • tests/test_lens_seed_actions.py (6027633398). A standalone serve's contributed routes are exactly openDox's submit route, and no seed route.
  • tests_runtime/test_served_bundle.py (6035791735; prose 6064770458).
  • src/opendox/web/views/account-menu.js (6069024568 item 2). One word: "submit" joins WRITE_ACTIONS, so the access line names the verb actions.submit grants. The census line count is unchanged at 181.
  • pyproject.toml:312 (6069024568 item 2). One line's present-tense count: "the bundle is 43 files".

Review rounds on this PR

  • SonarCloud at a9616ee4: the quality gate FAILED on a C reliability rating on new code, with 16 open issues, all in T015's own files. All 16 were fixed in 39a73a33, with no behaviour changed:
    • 1 bug, javascript:S9383: the click handler left submit()'s promise unhandled. submit() settles every outcome itself, so the handler marks it handled with void.
    • 2 python:S7632: the reason after # noqa: BLE001 moved to the line above.
    • 8 python:S9073: composite asserts split.
    • 3 python:S5778: one throwing call per pytest.raises.
    • 2 python:S9083: @pytest.fixture() lost its empty parentheses.
    • At 39a73a33 the quality gate PASSED with 0 open issues.
  • Copilot at 39a73a33, HIGH, app.js:1696 (thread 4223527699, "Changes recommended"). FIX NOW under 5988818366, fixed in e149dc56.
    • The defect was a misdirected push from one click. With another repository active, the control offered that repository's branch name, while the route pushes from the served checkout (it takes no repository from the request, 12.4a).
    • The fix, as corrected by 7dc8214b: the view withholds the control while an active key names a repository other than /capabilities.repository, which is the authority a session verb already refuses a foreign repository against. app.js hands the view the active repository.
    • Tests: node-harness cases for served, foreign, none-active and undeclared repositories, and a boundary check of the shell. Mutants MS1–MS8, MR7 and MR8 are killed.
  • Codex at a9616ee4, P2, serve.py:664 (thread 4223387950): the account menu's access line omitted submit. FIX NOW, admitted by 6069024568 item 2 and fixed in 63a12ad4. Test test_the_account_menu_names_submit_where_it_is_granted; mutant MA1 is killed.
  • The merge of main at 6827cafc (T012 + T013: the landing seam, governance, confirmation and the neutral lander; feature 007's guard admits the landing's fast-forward (plan 038) #90) made opendox.session_pr re-export the landing seam, whose modules load yaml. So importing openDox's default profile loaded yaml, through this PR's module-level import in cli_branch_actions.py.
    • test_importing_the_default_registers_nothing_and_needs_no_sibling was red at the merge commit 88b26816.
    • d466f2b9 imports session_pr where it is used.
  • Copilot at 7dc8214b, HIGH, cli_branch_actions.py:124 (thread 4225670374, "Changes recommended"). FIX NOW under 5988818366, fixed in 2d64f42e.
    • The defect: a host's contributed port that answered a credential-bearing url had it printed by the CLI and answered by the route, bypassing 12.1a.
    • The same was true of a host port's refusal text, which is closed too.
    • The fix: submission_object re-runs redact_destination over url and remote, and refusal_text runs redact_credentials over every refusal both doors show.
    • The proof: five tests were red at 7dc8214b and are green at 2d64f42e. Mutants MX1–MX7 are killed.
  • Copilot at 2d64f42e, HIGH, cli_branch_actions.py:152 (thread 4226076943, "Changes recommended"), together with lane 3's MAJOR at the same head. FIX NOW, fixed in e7ee97b8.
    • The defect: the refusal redactor spared a bare username for every scheme, so a host port's refusal naming a token as https userinfo kept it. A secret under a query name no pattern knows, or in a fragment, was kept too.
    • The fix: redacted_text passes every scheme:// URL through redact_destination before the free-text pass. The refusal, url and remote all go through it.
    • Tests: three shapes on the CLI and on both route arms, each asserting the secret gone and the host kept. 18 tests were red at 2d64f42e. Mutants MG1–MG3 and MG11 are killed.
  • Codex at the later heads: the Codex trigger comment (WRITER-RULES gate 3) was posted after each push. From about 19:49Z to about 23:23Z the bot answered with its usage limit (6069024568 item 4). At 7dc8214b (comment 6072104180) and at 2d64f42e (comment 6073019937) it answered with its usage limit again.
  • At e7ee97b8, this head:
    • Codex, re-triggered at 13:32Z, reviewed it: "Didn't find any major issues", with Reviewed commit e7ee97b860 (comment 6082012656).
    • Copilot reviewed it with 0 open findings (review 5470807021).

Lane 3's review R1, answered

The review is opensoft/openXfactory#656 6064547745, partial at c0fb1dd3, completed by 6066338657 at 19b5aba5 as GO (PARTIAL). Then:

  • GO at a9616ee4: this PR's comment 6068113766, with two NITs, both fixed. pyproject.toml:312 is admitted and moved to 43 (6069024568 item 2), and T104 is now on the After line.
  • GO (PARTIAL) at 39a73a33: the delta is behaviour-neutral (lane 3's coordination log, 2026-10-08 21:07Z).
  • NO-GO (EARLY) at 63a12ad4 (lane 3's coordination log, 22:01:46Z): 1 MAJOR and 3 NITs, all fixed.
    • MAJOR, branch-actions.js:37: the control was offered on no plane. FIX NOW, fixed in 7dc8214b.
      • The defect: since e149dc56 the control was offered only where an active key named the served repository. A standalone plane, the one plane that carries actions.submit, has no snapshot index (/snapshot-index.json answers 404), so no key is ever active there.
      • The fix: anotherRepositoryIsActive withholds the control only while an active key names another repository, so Copilot's HIGH still holds.
      • The test: test_a_standalone_plane_offers_the_control_as_the_page_derives_it serves a real standalone plane, and the bundle's own probeCapabilities (the token from the URL's fragment), fetchIndex, resolveStoredKey, resolveActive, isComposed and safeKey derive the mount's arguments as app.js's render() does. It was red against d466f2b9's guard: {'offered': False} != {'offered': True}. Mutants MS2 and MS7 (the e149dc56 shape) are killed by it.
    • NIT, the census app.js row's note lacked its 1760 → 1764 move. Fixed in 7dc8214b.
    • NIT, the After line omitted T104. Fixed in this body.
    • NIT, the body's class A total. It now reads 18,912, this head's census figure.
  • GO (EARLY) at 7dc8214b (lane 3's coordination log).
  • NO-GO (EARLY) at 2d64f42e (lane 3's coordination log, 02:33:37Z): 1 MAJOR, 1 MINOR and 1 NIT, all fixed in e7ee97b8.
    • MAJOR, cli_branch_actions.py:152: refusal redaction weaker than the report's. Fixed as Copilot's thread at the same head, above.
    • MINOR, cli_branch_actions.py:136: ref, branch and commit passed through raw, and remote was redacted only as a whole URL. Fixed in the holder's stronger form.
      • submission_object(report, branch) refuses a report whose branch is not the submitted one, whose ref is not refs/heads/<branch>, or whose commit is not a full object name (40 hex digits, or 64 in a sha256 repository). The refusal is a fixed sentence that repeats none of the report.
      • remote gets the text-level redaction.
      • Tests cover six malformed reports on the CLI and one on the route. Mutants MG4–MG10 are killed.
    • NIT: the tests spelled credential-shaped URLs whole. Both test files now assemble them with test_submission_default.with_userinfo.
  • GO (EARLY) at e7ee97b8 (lane 3's coordination log, 2026-10-09 18:01:21Z): 0 BLOCKER, 0 MAJOR, 0 MINOR, 0 NIT. Lane 3 drove 63 hostile-port checks at every print boundary, with 0 leaks. Its two limits are recorded below, as the holder accepted them.

Each finding is classified under the convergence rule (5988818366).

  • MINOR, cli_branch_actions.py: a port exception could leak a credential. FIX NOW, fixed in 45c83c7b.
    • The binding and the act now sit in one try. Any exception other than a SubmissionError is refused with UNNAMED_FAILURE, a fixed sentence naming type(exc).__name__ alone, with exit 1, as the route answers it.
    • New test test_a_port_failure_it_did_not_name_is_refused_without_its_text[binding|port]. It was red at 19b5aba5, where the RuntimeError carrying https://user:S3CRET@… escaped cli.main.
  • NIT, serve_branch_actions.py:42: the docstring over-promised. FIX NOW (the docstring), fixed in 45c83c7b.
    • It now says that the act's own refusal may name the requested branch back to the console that sent it, as JSON the view renders as text, and that nothing else a request carried is echoed.
    • No limit is accepted. The echo is the caller's own input, behind the three clauses and the console token, rendered with textContent. A ref-format pre-check in the route would run git from a module that runs none, and it would still echo every well-formed name.
  • NIT, cli_branch_actions.py:131: a malformed install mode was refused. FIX NOW (narrowed), fixed in 45c83c7b.
    • The contract refuses --local "only where it DISAGREES with OPENDOX_INSTALL_MODE=hosted". The verb now reads that one value, stripped and case included, as runtime.config.install_mode reads it.
    • Any other value is accepted (Hosted, Local, single-user), since the verb does not depend on the mode. The old fail-closed test is replaced by test_local_beside_any_other_value_is_accepted.
  • NIT, tests_runtime/test_served_bundle.py:9: the bundle-count prose still read 42. FIX NOW, fixed in a9616ee4, with two lines kept on purpose.
  • Lane 3's "NOT REACHED" items, now run:
    • the BUNDLE_FILES bump;
    • F12.2 in a fresh venv (above);
    • the clause 2/3 swap mutant (killed, above);
    • the full suite to its end (above).

Stated limits

Both are ACCEPTED LIMITS under the convergence rule (5988818366), ruled by opensoft/openXfactory#656 6086098003 item 2. They are recorded here, with no push.

  • (a) ssh://token@host and the scp-like token@host:path keep the token. That slot is the ssh login name, which redact_destination spares by design, as the neutral port does. Redacting it would erase the routine git@host display, and a token there is the host port's own misconfiguration (operator-only).
  • (b) A raw token in a host port's prose, with no URL, passes. This is the inherent limit of pattern redaction. This PR's guarantee is that a refusal is redacted as strictly as the report, and neither covers a bare secret in prose. Known-prefix redaction is a possible later hardening, outside release 2.

Not done here

  • opendox land and its route (T016), which stacks on this PR.
  • Lane 3's FORMAL R1-T015 at e7ee97b8 (its EARLY GO at that head is above).
  • The live sandbox is proved by this PR's own validate run, not locally: bubblewrap cannot create user namespaces in the local container.
  • Postgres container r2-t015-pg is removed when T015 closes.

🤖 Generated with Claude Code

brettheap and others added 27 commits October 6, 2026 10:58
…rget (plan 038)

The neutral submit act, #1144 boxes 12.1, 12.1a, 12.2 and 12.3 (refs
opensoft/openXfactory#1144; plan 038 T011; ruled #656 6003486656 R2Q1, R2Q2,
R2Q5 and 6013547504, CF-7).

session_pr.py gains NEW names only, in one delimited block after the
existing classes: SubmissionPort (one operation, submit), Submission (remote,
ref, url redacted, branch, commit), SubmissionError with NoSubmissionTarget
and SubmissionRefused, and LocalGitSubmissions(checkout_root). PullRequestPort,
GhPullRequests and FakePullRequests are untouched.

submission_push.py is the submission's git half. It chooses origin, else the
sole remote (no remote, or several and none named origin, is
NoSubmissionTarget), refuses main, checks the branch as a ref name, requires
one push URL, and hands the push to the runtime's push core. The remote URL is
redacted everywhere: userinfo and every query and fragment value replaced,
scheme, host, port and path kept; foreign text is scrubbed of the URL's held
secrets.

repository_act.py: the push core is factored so it takes a plan. The
runtime's own checks become _mapped_push_plan (unchanged lines), the send
stays in _push_to_remote_with (two runtime tests read its source), now driven
by a PushPlan, and push_to_remote names a failed push exactly as before. The
repository-local command-config refusal is kept and applies to both callers.
_bound_local_destination gains contained=True; only the submission passes
False, because a checkout has no service root.

Tests: tests/test_submission_default.py holds F12.2's credential node, which
pushes for real to a loopback smart-HTTP remote whose URL carries a userinfo
secret and two query tokens; tests/test_submission_port.py covers every
refusal. Every remote is local or loopback, never the network.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot, both fix-now:
- r4194480639: a linked worktree's git and common directories are now held
  by descriptor for the whole submission (local_git_adapter's
  metadata_held_open), after the root check, which moved ahead of it because
  a bound GIT_DIR makes git read the working directory as the top level.
- r4194480699: the push URL is read exactly, git's terminating newline
  aside, and one with surrounding whitespace is refused rather than trimmed
  (a local path with a trailing space names another directory).

SonarCloud: the moved runtime comment no longer spells a credential-shaped
URL (secrets:S8136); the nested conditional in the query redaction is a
helper (python:S3358); the tests build the port outside pytest.raises
(python:S5778) and assert one thing per line (python:S9073).

Tests: two new cases, the whitespace refusal and the linked worktree; 27
mutants, all killed.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… 038)

Copilot r4194631880, fix-now: the push URL's get-url lines are no longer
filtered. A URL holding a newline prints as two lines (measured on git
2.43.0), so it now counts as two destinations and is refused, instead of
being pushed to the pathname without the newline. An empty URL, or one
holding a control character, is refused with the whitespace-bearing one.

Copilot r4194631803, an accepted limit, answered on the thread: a network
destination is pushed by remote name, so git re-reads the checkout's own
config at push time, as the runtime's push already does. Changing the URL in
that window needs a concurrent writer to the user's own .git/config, who
already decides what every other git command the user runs will execute.

SonarCloud python:S3358: the held-secrets selection is an if/elif.

Tests: the newline URL, trailing and leading; 28 mutants, all killed.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Both fix-now:
- r4195368599: no refusal raised after the remote URL is read chains its
  cause any more (from None). The cause's message is git's stderr, redacted
  by pattern only, so a query value under a name no pattern knows survived
  in it and a logged traceback printed it. The credential node now asserts
  the formatted traceback of each refusal, not only its message.
- r4195368695: an ssh userinfo is kept as a login name only when it is
  plainly one ([A-Za-z0-9._-]+). A percent-encoded colon (git%3As3cret), or
  any other character, makes it a credential, in the report and in the
  held-secrets scrub alike.

Tests: the encoded and twice-encoded ssh password; 30 mutants, all killed.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…(plan 038)

Copilot r4195504431, fix-now: a push URL whose scheme git does not carry
itself (evil://...) is refused before the push. Measured on git 2.43.0, git
resolves and runs git-remote-<scheme> from PATH for it, the <name>:: hazard
under a second spelling. The test plants a marker-leaving git-remote-evil on
PATH and asserts the refusal and that it never ran. The guard is the
submission's own; the runtime's shared guard is unchanged.

Found in the same pass: a remote named like a git option ([remote
"--force"], listed by git remote) is refused by name, because a network push
names the remote on the command line.

Tests: both; 32 mutants, all killed.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…92)

Copilot's review at 3ccf77b raised, as previously missed, that the
explicit refspec does not isolate the push from the checkout's own push
settings. MEASURED on git 2.43.0, exit 0 both times:

- push.followTags=true also sent an annotated tag the refspec never named;
- push.recurseSubmodules=only sent nothing at all, so submit() returned a
  Submission for a branch that never left.

The shared core now passes --no-follow-tags and --no-recurse-submodules,
which outrank both keys and submodule.recurse. The runtime's
push_to_remote goes through the same core and gains the same guard.

The new test runs both settings against a local bare origin and asserts the
origin holds exactly the branch at the reported commit; red first at
3ccf77b, and mutants M33 and M34 (each option dropped) are killed.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…26596 on #92)

Copilot's review at 5e3ca9c found that the push core binds a file://
destination through urlsplit, which drops ?... and #..., while git reads
both as part of the path. MEASURED on git 2.43.0, with both remote.git and
remote.git?x present:

- plain git push to file://.../remote.git?x landed in remote.git?x;
- submit() landed in remote.git and reported file://.../remote.git?<redacted>.

The same held for #x. The submission now refuses such a URL before any
push, names the remedy (the path without file://), and does not echo it.

The new test runs both suffixes with both repositories present and
asserts that neither moves, then pushes the same path without file:// and
asserts it lands in the literal repository. It was red first at 5e3ca9c
(DID NOT RAISE). Mutants M35 (the refusal dropped) and M36 (# not checked)
are killed.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…Submissions (plan 038)

serve.py: `submission_factory`, beside `pull_request_factory` and never
it, as a class attribute, a `build_server` keyword and its compose entry,
with the accessor `_session_submissions`. It is declared under the
`session` capability as `_session_pull_requests` is, since the push uses
the invoking user's own git credentials. Unset, it builds
`LocalGitSubmissions` for the served checkout.

cli.py: `_submission_port`, beside `_pull_request_port`, the same default.

`pull_request_factory` and `_pull_request_port` keep `GhPullRequests`,
serving `gate open-pr` unchanged (R2Q2 (a)).

tests/test_submission_default.py: F12.2's server node,
`test_server_unset_submission_factory_binds_the_neutral_default`, and
two nodes beside it, so each new branch has a case that fails without
it: an injected factory is the server's binding and an unbuildable one
is absence; the CLI's unset port is the neutral class.

Realizes 12.4 of opensoft/openXfactory#1144. Ruled R2Q2 (a).

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…mission-factory

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… into r2/t014-submission-factory

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tal/error lines; three tests)

Lane 3's read-only review R1 (opensoft/openXfactory#656 comment
6022010349) was a GO with 0 BLOCKER and 0 MAJOR. Two of its items change
code or tests, and they are folded here.

MINOR: a failed push's refusal embedded git's whole stderr. Under the
user's own GIT_TRACE_CURL=1 or GIT_CURL_VERBOSE=1, curl's trace of every
request header is part of that stderr, and a checkout's http.extraheader
secret rode the SubmissionRefused (git redacts Authorization: alone). R1
measured it against a loopback 403. The refusal now keeps only git's
fatal: and error: lines and the adapter's timeout line, then scrubs as
before. The new test reproduces R1's measurement: http.extraheader =
X-Api-Key: <secret>, GIT_TRACE_CURL=1, and a loopback server answering
403. It asserts the secret is absent from the message and from the
formatted traceback. It was red first (the secret was in the message).
Mutants M37 (the whole stderr) and M38 (every line kept) are killed.

NIT: three tests that kill R1's surviving mutants:
- X5: the except CorpusRefused around metadata_held_open, reached with
  the no-follow open's ELOOP. MEASURED on git 2.43.0: git hands back a
  worktree's canonical git and common directories even through a
  symlinked .git file or commondir, so a real link never reaches the
  open. Mutant M39 is killed.
- X4: a URL past MAX_REMOTE_URL_CHARS is shown as <redacted-url>, and one
  at the cap as it is. Mutant M40 is killed.
- X6: HTTPS:// is refused, and a planted git-remote-HTTPS does not run.
  MEASURED: plain git push to HTTPS://... ran it. Mutant M41 is killed.

Mutants M17 and M29 are re-targeted at the new refusal line. All 41
mutants are killed, 0 survive, and the falsifier reads 60 passed.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… on #93)

`_assert_the_neutral_port` asserted the report's ref and URL in one
`assert ... and ...`. Two asserts now, so a failure names which half
failed. No behaviour changes.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…mission-factory

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…all per pytest.raises (#92)

CI's validate failed at d186f6b (run 37507020596) on
tests/test_provider_boundary.py::test_the_generic_http_client_has_exactly_its_named_holders,
with ['submission_push.py: Authorization']. The comment above
_KEPT_PUSH_STDERR spelled the HTTP client's auth header by name, and that
test holds the name to its declared holders, which submission_push is not.
The comment is reworded, and the code is unchanged. The test was red
locally at d186f6b and is green now. Mutant M42 restores the word and is
killed.

SonarCloud python:S5778 at d186f6b, tests/test_submission_port.py:314
and :401: each LocalGitSubmissions is now constructed before its
pytest.raises block, so one call can throw inside it.

All 42 mutants are killed, 0 survive, and the falsifier reads 60 passed.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…mission-factory

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-submit-verb

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
openDox's own submit act (#1144 12.4a), contributed by its default profile
(decision N-2, refined by ADV-14):

- `opendox submit --repo-root PATH --branch BRANCH [--local] [--json]`
  (cli_branch_actions.py) through SUBCOMMAND_EXTENSIONS. It goes through the
  `_submission_port` binding, refuses `main` before any port is asked, and
  prints the Submission report. There is no actor gate (OQ-12-9). It does not
  read the install mode: `--local` is refused only where the selector refuses
  it, beside OPENDOX_INSTALL_MODE=hosted, naming both (N-17; R2Q9 (a) item 7).
- `POST /actions/session/submit` (serve_branch_actions.py) through
  ROUTE_EXTENSIONS and HANDLER_CONTRIBUTIONS, behind 12.4a's three-clause
  gate in order, before any body byte is read. It takes no repository from
  the request; the hosted plane's refusal is the route's (ADV-04).
- `actions.submit` (serve.py): present only where a binding answers the route,
  so under openDox's own profile alone; its value is the local human's
  verdict. Core _DEFAULT_CAPABILITIES gains nothing (OQ-12-14).
- The submit control (web/views/branch-actions.js), keyed on `actions.submit`,
  mounted by app.js into index.html's #branchactions; census rows added.
- tests/test_default_profile.py: its two assertions updated to the facets
  T015 contributes, admitted by the holder's ruling on #656 (6023619783).

Falsifier: F12.2's five tests/test_submit_route.py nodes, the CLI tests in
tests/test_cli_branch_actions.py, and a host profile that replaces the
default sees no actions.submit key.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The docstring of test_the_default_declares_the_two_facets_the_composition_points_read
still said the default declares none of the three read-with-a-default facets.
Since T015 it declares HANDLER_CONTRIBUTIONS, whose one mixin holds the submit
route's method. Docstring only; no assertion changes (holder ruling, #656
6026622117 item 2).

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The census conflict is the class-C total alone: T104's styles.css rows and
T015's index.html rows are both kept, so C is 12769 + 19 (T104) + 4 (T015) =
12792, which test_the_declared_totals_are_re_derived_from_the_rows re-derives.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…bmit route

Admitted to T015's Files by the holder's rulings on #656 (6027633398, with
6028383410 for the helper), each amended the minimal way:

- tests/test_capability_honesty.py: GOVERNED gains
  "submit": ("POST", "/actions/session/submit"), and
  _assert_every_true_flag_answers is a PROFILE-AWARE EQUALITY. A required
  keyword, default_profile, names the plane at every call site. The default
  profile's map equals GOVERNED, and a composed host's map equals GOVERNED
  less "submit", the default profile's own key.
- tests/test_lens_seed_actions.py: a standalone serve's contributed routes
  are exactly openDox's own submit route, and no seed route appears.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Admitted to T015's Files by the holder's ruling on #656 (6035791735). One
amendment only: tests_runtime/test_served_bundle.py's BUNDLE_FILES goes
42 -> 43, with a line naming views/branch-actions.js, the file T015 adds to
the web bundle. Nothing else in that file changes.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…to hosted)

Lane 3's review R1 of T015 (#656 6064547745), each finding classified under
the convergence rule (#656 5988818366):

- MINOR, fix now: cmd_submit caught only SubmissionError, so a host's binding
  or port raising anything else escaped cli.main as a traceback carrying its
  text, a remote URL's credential included. Both now sit in one try, and any
  other exception is refused with UNNAMED_FAILURE, a fixed sentence naming
  its type alone, exit 1, as the route answers it. New test
  test_a_port_failure_it_did_not_name_is_refused_without_its_text, for the
  binding and for the port.
- NIT, fix now: serve_branch_actions' docstring said nothing a request
  carried is echoed, but the act's own refusal may name the requested
  branch. The docstring now says so: the branch goes back to the console
  that sent it, as JSON the view renders as text.
- NIT, fix now: --local beside an install mode the selector cannot read was
  refused. The contract refuses --local ONLY where it disagrees with
  OPENDOX_INSTALL_MODE=hosted, so the verb now reads that one value, stripped
  and case included, as the selector reads it, and accepts any other.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… count

Admitted by the holder's ruling on #656 (6064770458, amending 6035791735):
the bundle count's prose mentions in tests_runtime/test_served_bundle.py may
move from 42 to 43 beside the constant. Moved where they state the bundle as
it is now: lines 9, 38, 50, 417 and 437. Kept: line 15, a measurement dated
at openDox-code#69's head (the tree's 42 beside the wheel's 41), and line 24,
#1144 10.2's own count. No assertion and no tree-to-wheel comparison changes.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@brettheap
brettheap requested a balanced review from Copilot October 8, 2026 19:38
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@sourcery-ai

sourcery-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR implements plan 038's submit capability across the CLI, HTTP route, capability model, and web UI, wiring all behavior through the default profile and injected submission ports while enforcing branch, origin, actor, checkout, and credential-safety rules; the accompanying tests cover falsifiers, mutants, profile isolation, and full-bundle integration.

Sequence diagram for CLI branch submission

sequenceDiagram
    actor User
    participant CLI as opendox submit
    participant Port as SubmissionPort
    participant Git as LocalGitSubmissions

    User->>CLI: submit --repo-root PATH --branch BRANCH
    alt branch is main
        CLI-->>User: refusal on stderr, exit 1
    else branch is allowed
        CLI->>Port: submit(branch)
        Port->>Git: git push
        Git-->>Port: Submission report
        Port-->>CLI: Submission
        CLI-->>User: report or JSON
    end
Loading

Sequence diagram for HTTP submit route gating

sequenceDiagram
    participant Client
    participant Route as POST /actions/session/submit
    participant Port as SubmissionPort

    Client->>Route: POST with branch body
    alt not loopback
        Route-->>Client: 403 loopback_only
    else no session capability or actor
        Route-->>Client: 403 action_unavailable
    else not human console
        Route-->>Client: 403 agent_invocation
    else valid console request
        Route->>Route: read JSON body
        alt body is not branch-only
            Route-->>Client: 400 invalid_body
        else no submission port
            Route-->>Client: 403 action_unavailable
        else submission attempt
            Route->>Port: submit_branch(branch)
            alt no target
                Route-->>Client: 409 no_submission_target
            else submission refused
                Route-->>Client: 409 submission_refused
            else unexpected failure
                Route-->>Client: 500 submission_failed
            else success
                Port-->>Route: Submission
                Route-->>Client: 200 Submission
            end
        end
    end
Loading

Flow diagram for submit control availability

flowchart TD
    Start[Render branch actions] --> Composed{Composed render?}
    Composed -->|Yes| Hidden[Do not offer control]
    Composed -->|No| Capability{actions.submit === true and console token?}
    Capability -->|No| Hidden
    Capability -->|Yes| Control[Show branch input and submit button]
    Control --> Branch{Branch is non-empty and not main?}
    Branch -->|No| Refuse[Show refusal]
    Branch -->|Yes| Post[POST /actions/session/submit]
    Post --> Result{Server response}
    Result -->|Success| Report[Show submission report]
    Result -->|Refusal or error| Refuse
Loading

File-Level Changes

Change Details Files
Add the default-profile opendox submit command backed by the shared submission port.
  • Register submit with repository, branch, local-mode, and JSON options.
  • Reject main, invalid or incomplete submission reports, conflicting hosted/local selections, and unnamed port failures without leaking exception text.
  • Use the injected submission port, defaulting to plain local git, and render redacted submission reports.
src/opendox/cli_branch_actions.py
src/opendox/default_profile.py
tests/test_cli_branch_actions.py
tests/test_default_profile.py
Add the profile-contributed HTTP submit route with layered authorization and request validation.
  • Contribute the route and handler mixin through the default profile rather than core capabilities.
  • Apply loopback, session/actor, and human-console gates before reading the request body.
  • Accept only a branch field and submit the server checkout through its bound port.
  • Map target, submission, and unexpected failures to distinct safe HTTP responses.
src/opendox/serve_branch_actions.py
src/opendox/default_profile.py
src/opendox/serve.py
tests/test_submit_route.py
tests/test_lens_seed_actions.py
tests/test_capability_honesty.py
Expose actions.submit only when the contributed route is bound and add the corresponding browser control.
  • Derive capability presence from route bindings and its value from local-human eligibility.
  • Mount a token-authenticated submit UI only for actions.submit === true and non-composed renders.
  • Prevent offering or sending main, and display server refusals using safe text content.
src/opendox/serve.py
src/opendox/web/views/branch-actions.js
src/opendox/web/app.js
src/opendox/web/index.html
tests/test_web_boundary.py
tests/fixtures/web_boundary_census.yaml
Update bundle accounting and runtime coverage for the new web asset and end-to-end submission behavior.
  • Increase the served web bundle census from 42 to 43 files.
  • Add route, CLI, capability, profile-isolation, security, and browser-control tests.
  • Preserve host-profile behavior by asserting no submit verb, route, handler, or capability key outside the default profile.
tests_runtime/test_served_bundle.py
tests/fixtures/web_boundary_census.yaml
tests/test_cli_branch_actions.py
tests/test_submit_route.py
tests/test_default_profile.py
tests/test_capability_honesty.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

brettheap and others added 2 commits October 8, 2026 21:42
…am is not stdlib-only)

After merging main at 6827caf (#90), opendox.session_pr re-exports the
landing seam (plan 038 T012), whose modules load yaml. cli_branch_actions
imported session_pr at module level, and openDox's default profile imports
cli_branch_actions, so importing the default profile loaded yaml:
tests/test_default_profile.py::test_importing_the_default_registers_nothing_and_needs_no_sibling
failed at the merge commit 88b26818 ("importing the default loaded [...
'yaml', ...]"). The three uses now import SubmissionError and
SubmissionRefused where they run, and the module docstring's IMPORT WEIGHT
paragraph says so.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… (lane 3's MAJOR at 63a12ad)

Lane 3's R1-T015 NO-GO (EARLY) at 63a12ad, MAJOR, branch-actions.js:37:
since e149dc5 the control was offered only where an active key named the
served repository. A standalone plane, the one plane that carries
actions.submit, has no snapshot index (/snapshot-index.json answers 404), so
no key is ever active there, and the control was offered on no plane. The
test that pinned it (noActive False) pinned the wrong outcome.

- branch-actions.js: anotherRepositoryIsActive(caps, repository) replaces
  servesTheActiveRepository. It is true only when an active key names a
  repository other than /capabilities' `repository` (a plane that declares
  none, with a key active, included). The mount withholds on it, so
  Copilot's HIGH on #96 still holds: another repository active, no control.
- test_submit_route.py: the predicate's cases (none active is not another
  repository) and three mounts (foreign: withheld; undeclared with a key:
  withheld; none active: offered); and
  test_a_standalone_plane_offers_the_control_as_the_page_derives_it, which
  serves a real standalone plane and derives the mount's arguments with the
  bundle's own probeCapabilities (the token from the URL's fragment),
  fetchIndex (404, so null), resolveStoredKey, resolveActive, isComposed and
  safeKey, as app.js's render() does. Red against d466f2b's guard:
  {'offered': False} != {'offered': True}.
- app.js: the mount's comment says the same (line count unchanged).
- census: views/branch-actions.js 134 -> 141, class A 18905 -> 18912; the
  app.js row's note gains its 1760 -> 1764 move (lane 3's NIT).

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@brettheap
brettheap requested a balanced review from Copilot October 9, 2026 01:01
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@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.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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.

🟡 Changes recommended

The shared report boundary can expose credentials returned by a contributed submission port.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Comment thread src/opendox/cli_branch_actions.py Resolved
… on #96 at 7dc8214)

Copilot's HIGH on #96 at 7dc8214 (thread r4225670374): submission_object
forwarded a contributed port's `url` verbatim to the CLI's report and the
route's answer, so a host port returning a credential-bearing URL bypassed
the redaction LocalGitSubmissions performs (12.1a). Classified fix-now under
the convergence rule (a simple payload). The same holds for a host port's
refusal text, which both doors printed verbatim, so it is closed too.

- cli_branch_actions.submission_object runs submission_push's
  redact_destination over `url` and `remote`, whoever answered. It changes
  nothing the neutral port reports, which is already redacted.
- cli_branch_actions.refusal_text(exc) runs the package's redact_credentials
  over a SubmissionError's message. The CLI prints it, and the route answers
  it on both 409 arms (no_submission_target, submission_refused).
- Tests: test_a_contributed_report_is_redacted_at_the_boundary,
  test_a_contributed_refusal_is_redacted_at_the_boundary (CLI);
  test_a_contributed_report_is_answered_redacted,
  test_a_contributed_refusal_is_answered_redacted[both arms] (route).

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@brettheap
brettheap requested a balanced review from Copilot October 9, 2026 02:27
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@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.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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.

🟡 Changes recommended

Shared refusal redaction can expose HTTPS tokens supplied as bare URL userinfo by contributed ports.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Comment thread src/opendox/cli_branch_actions.py Resolved
…f and commit checked (lane 3 at 2d64f42)

Lane 3's R1-T015 NO-GO (EARLY) at 2d64f42, and Copilot's thread there:

- MAJOR, fix now: refusal_text ran the free-text redactor sparing bare
  usernames, so a host port's refusal naming a token spelled as https
  userinfo, a secret under a query name no pattern knows, or a fragment,
  reached the CLI's stderr and the route's 409. redacted_text now passes
  every scheme:// URL in the text through redact_destination (any non-ssh
  userinfo, every query and fragment value) before the free-text pass, so
  the host is kept and the secret is not. refusal_text, url and remote all
  go through it.
- MINOR, fix now (the holder's stronger form): submission_object(report,
  branch) checks branch == the submitted branch, ref == refs/heads/<branch>,
  and commit is a full object name (40 hex, or 64 in a sha256 repository),
  and refuses any other report by a fixed sentence that repeats none of it.
- NIT: credential-shaped URLs in both test files are assembled with
  test_submission_default.with_userinfo, never spelled whole.

Tests: each refusal shape on the CLI and on both route arms (host kept),
six malformed reports on the CLI and one on the route, the embedded-URL
remote; 18 were red at 2d64f42.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@brettheap
brettheap requested a balanced review from Copilot October 9, 2026 13:32
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: e7ee97b860

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

🔵 Needs a closer look

Contributed-port text can retain terminal control characters and spoof CLI output.

0 open findings

1 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Sanitize control characters in contributed report and refusal text

src/​opendox/​cli_branch_actions.py:133

redacted_text still returns control characters supplied by a contributed port. _URL_IN_TEXT stops at whitespace, so a report URL such as https://forge.example/repo\nsubmitted ... preserves the newline and suffix; non-URL ANSI/control sequences in a refusal also survive. The CLI prints both values verbatim, allowing a port response to spoof report lines or emit terminal controls. Reject or replace control-bearing text at this shared boundary, and cover contributed report/refusal cases with newline and escape characters.

🧠 Review effort: Balanced

@brettheap
brettheap marked this pull request as ready for review October 9, 2026 20:14
@sourcery-ai

sourcery-ai Bot commented Oct 9, 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 1 day and 2 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap

Copy link
Copy Markdown
Contributor Author

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

READY at e7ee97b — holder, on Brett's word "land #96 when green" (2026-10-09 about 02:40Z).

  • At the head e7ee97b8: validate, acceptance and SonarCloud SUCCESS. Copilot review 5470807021 is at the head, "Needs a closer look" with 0 open findings, not "Changes recommended". Codex reviewed e7ee97b860 with no major issues (6082012656). 4 threads, 0 unresolved.
  • The full suite at e7ee97b8 (full11): 5899 passed, 11 skipped, EXIT 0. 74 mutants killed. F12.2's submission half EXIT 0.
  • Lane 3's R1-T015 review at e7ee97b8: GO, 0 BLOCKER, 0 MAJOR, 0 MINOR, 0 NIT (lane3-to-lane4.log 18:01:21Z). It is FORMAL with the READY-CANDIDATE line at this head (20:14:41Z) and lane 3's re-read of the live body's Stated limits.
  • Stated limits: the two ACCEPTED LIMITS of #656 6086098003 item 2 are in the body.
  • Lands through the holder's openDox-code lander (land-plain.sh --admin), the same path as T012 + T013: the landing seam, governance, confirmation and the neutral lander; feature 007's guard admits the landing's fast-forward (plan 038) #90.
  • Authority: plan 038 RULED 6013547504 (lane openxfactory-4 lands every PR); Brett's "land T015: the submit verb, route and control (plan 038) #96 when green".

@brettheap
brettheap merged commit c94878b into main Oct 9, 2026
5 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

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

LANDED — lane openxfactory-4, 2026-10-09T20:20:15Z, PR #96 → c94878b (opensoft/openDox-code main; plain gate)

Brett: plan 038 RULED incl. lane openxfactory-4 lands every PR (#656 6013547504); Start release 2 (#656 6001702967)

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