Skip to content

DRAFT: T016: the land verb, routes and confirm control (plan 038) - #100

Draft
brettheap wants to merge 11 commits into
mainfrom
r2/t016-land-verb
Draft

brettheap wants to merge 11 commits into
mainfrom
r2/t016-land-verb

Conversation

@brettheap

@brettheap brettheap commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

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

T016 [US2] [oDc]: the land verb, routes and confirm control (plan 038)

openxFactory specs/038-opendox-document-tool-self-maintenance/tasks.md, T016, on main. Claim: #656 6070993070. Stacked on T015 until #96 landed (20:20:15Z, c94878be); this branch was re-created from that main, so it carries no T015 commit.

  • Realizes: 12.6a (part: the bindings and the surface), 12.6.
  • Falsifier: F12.2's guardrail nodes that drive the surface; T012's suite re-run green; a test that a host profile sees no actions.land key; a capability test that actions.land is true for standalone with a lander and for governed with an instrument, and false otherwise.
  • Ruled: R2Q1, R2Q3, R2Q4, R2Q5, R2Q6, R2Q7, R2Q9 (item 7); the holder's 6023619783 (item 1), 6027633398 (the collateral Files), 6069024568 (item 2, the chains), 6103915259 (item 10: each confirmation issuer states the operation it confirms; FIX) and 6110997237 (item 11: two accepted limits). Decisions: CF-1, N-2, N-11, OQ-12-13, OQ-12-14, OQ-12-17.

What it does

  • The bindings (12.6a). serve.py gains landing_factory (a build_server keyword, a handler attribute, and _session_lander(), declared only where session is true), with served_lander() as its default: the neutral lander where the checkout is standalone, and nothing otherwise. cli.py gains _landing_port(repo_root, *, local), which binds the same way. generate-and-open declares the server's landing_factory with the install it resolved (_served_landing_factory), so --local lands without OPENDOX_INSTALL_MODE being set (quickstart § 3).

  • The verb. opendox land --repo-root PATH --branch BRANCH [--local] [--json] lives in cli_branch_actions.py and is contributed through default_profile.py's SUBCOMMAND_EXTENSIONS (N-2).

    • It refuses main, a branch that does not exist, and a repository where nothing can land, each by name and before it asks.
    • Then it asks at the controlling terminal (landing_confirm.confirm_at_terminal), showing the branch, its head and the operation this landing performs: a merge commit onto main where a lander is bound, or a submission to the host's instrument where the repository is governed (item 10, below).
    • It lands, and prints the merge commit and the git revert -m 1 <merge> that undoes it. --json prints the Landed object.
    • No bypass flag (N-11): the verb takes exactly the four options, and a test holds them to that.
  • The act shared by both doors.

    • landing_refusal: land can act where a lander is bound, or where the repository is governed with a contributed instrument. Otherwise the refusal is the governance reading's own: governed-without-an-instrument, or why the governance is unknown (naming .opendox/governance.yaml and its content).
    • landing_operation: the operation land performs, merge or submit, decided from the reading landing_refusal makes. Both issuers state it BEFORE they ask (item 10).
    • land_branch: the Landed object through the lander, every field CHECKED by landed_object against data-model.md § Landed (lane 3's MAJOR, below). Under governed it submits through the instrument (landing.request_landing) and answers its Submission, checked and redacted by T015's submission_object (R2Q4 (a)). It performs exactly the operation its confirmation's question named, and otherwise refuses with operation-changed.
    • Every refusal passes through redacted_text. A failure nobody named is reported by its type alone.
  • The routes (OQ-12-13). POST /actions/session/land-nonce answers {"nonce", "branch", "head", "operation"} from this server's LandingNonces. operation is merge or submit, recorded with the nonce, and the land route performs exactly that operation (item 10). POST /actions/session/land takes {"branch", "nonce"} and answers Landed, the instrument's Submission, or a named refusal:

    • 409 landing_refused with a code, which is always one the route lists (LANDING_CODES, the codes the seam, the governance reading, the confirmation and the verb name), or else unlisted (lane 3's MAJOR);
    • 409 merge_conflict with paths and remedy;
    • the instrument's submission_refused or no_submission_target;
    • 500 landing_failed, with the type alone in the log.

    Both routes sit behind 12.4a's three clauses. The gate is factored into one helper that the submit route shares, with submit's answers unchanged. Both take no repository from the request, and both are contributed through the default profile's ROUTE_EXTENSIONS and HANDLER_CONTRIBUTIONS. The nonce store is one per server, kept on that server's bound handler class.

  • actions.land (OQ-12-14 refined by ADV-14).

    • Presence: only where bindings answer BOTH land routes (lands_here), so a host's map is unchanged, key for key (R2Q3 (a)).
    • Value: the local human's verdict AND landing_can_act. It is false under unknown, under governed with no instrument, and on the hosted plane.
    • The repository can change while the server runs, so the /capabilities arm reads that half again on each request, on a copy of the map. Core _DEFAULT_CAPABILITIES gains nothing.
  • The confirm control. mountLandConfirm in web/views/branch-actions.js is a separate mount beside T015's submit control, mounted by app.js into a new #landconfirm in index.html.

    • It is keyed on actions.land and never on session.
    • It fetches a nonce, shows the branch, the full head it is bound to and the operation the server states, and posts it once (the nonce is let go before the post). It does not offer a nonce whose operation it cannot name.
    • It never offers main, and it refuses a nonce bound to another branch.
  • R2Q5 (a). merge_state already recognises the lander's --no-ff merge commit, so branch_session.py changes in its FR-033 comment only. A node proves that a live session whose branch lands is reconciled: its branch is deleted and its worktree removed.

Falsifier, quoted (local, at the head 0bec6f5b)

F12.2's thirteen nodes by name (each binding node now also asserts T016's two bindings bind no lander, and test_land_requires_an_explicit_human_act also drives the verb):

(the thirteen pass inside the whole-file run below; at 99c4e079 alone: 13 passed in 13.43s)

T012's suite re-run, whole, with T016's surface nodes:

python -m pytest -q tests/test_landing_guardrails.py
207 passed in 172.97s (0:02:52)

The named T016 nodes include:

  • test_a_host_profile_sees_no_land_key (the host profile's map equals core _DEFAULT_CAPABILITIES' keys; both routes 404 unknown_action);
  • test_the_land_key_is_true_where_land_can_act_and_false_otherwise: TRUE for standalone with a lander, and for a test host with an instrument. FALSE for a host without an instrument, a host that fails to load, the hosted install, no actor, a 0.0.0.0 bind, no declaration, a governed declaration, and a factory that binds nothing;
  • test_land_with_a_piped_stdin_and_no_terminal_is_refused (the installed verb in a child with no controlling terminal);
  • test_the_land_verb_has_no_bypass_flag;
  • test_the_routes_land_a_branch_once_with_the_views_nonce;
  • test_a_live_session_whose_branch_lands_ends_by_the_merge_observation.

Red first. Against the product before T016 (c94878be with these tests): 58 failed and 3 passed. The three that pass are guards that hold before the surface exists: a host profile has no land key and no land verb, and the existing merge observation recognises the lander's commit. The JS control's four nodes and the menu probe were written after the control, and are red against c94878be's branch-actions.js and account-menu.js: 4 errors (m.landCapable is not a function) and 1 failed.

Mutants: 61, all KILLED at 0bec6f5b. Each is run against the nodes that must kill it, in a separate worktree that is clean afterwards. M1 is the /dev/tty bypass through the view's issuer, and M2 is a --yes bypass flag. M1, M6, M13, M15 and M34 were re-targeted to round 4's code. The first 34:

M1-tty-bypass-via-nonce: KILLED  test_land_with_a_piped_stdin_and_no_terminal_is_refused
M2-tty-bypass-flag: KILLED  test_the_land_verb_has_no_bypass_flag
M3-refusal-never: KILLED  test_land_with_no_declaration_names_the_file_and_content_before_it_asks
M4-governed-without-instrument-acts: KILLED  test_the_land_key_is_true_where_land_can_act_and_false_otherwise
M5-instrument-refused: KILLED  test_land_under_a_governed_host_submits_through_the_instrument
M6-act-ignores-lander: KILLED  test_a_reading_that_fails_unnamed_is_contained_by_both_routes
M7-act-takes-main: KILLED  test_the_land_route_refuses_main_before_any_nonce_is_asked
M8-verb-unredacted: KILLED  test_an_instruments_words_are_redacted_by_the_verb
M9-revision-as-branch: KILLED  test_the_nonce_route_refuses_what_cannot_land[sess-1~1-no-such-branch]
M10-gate-no-actor-clause: KILLED  test_each_land_route_is_gated_like_submit[no-actor-nonce]
M11-gate-no-console-clause: KILLED  test_each_land_route_is_gated_like_submit[no-token-nonce]
M12-body-extra-keys: KILLED  test_the_land_routes_take_no_repository_from_the_request[payload1]
M13-nonce-without-refusal: KILLED  test_the_nonce_route_refuses_where_nothing_can_land
M14-store-per-request: KILLED  test_the_routes_land_a_branch_once_with_the_views_nonce
M15-code-unprefixed: KILLED  test_the_routes_land_a_branch_once_with_the_views_nonce
M16-route-echoes-unnamed: KILLED  test_a_reading_that_fails_unnamed_is_contained_by_both_routes
M17-key-ignores-acts: KILLED  test_compute_capabilities_derives_the_land_key_from_the_bindings
M18-no-per-request: KILLED  test_the_land_key_follows_main_while_the_server_runs
M19-one-route-enough: KILLED  test_compute_capabilities_derives_the_land_key_from_the_bindings
M20-lander-without-session: KILLED  test_the_server_binding_is_the_neutral_lander_only_under_standalone
M21-factory-ignored: KILLED  test_the_server_binding_is_the_neutral_lander_only_under_standalone
M22-entry-point-local-lost: KILLED  test_generate_and_open_local_binds_the_lander_without_the_setting
M23-cli-local-lost: KILLED  test_the_cli_binding_is_the_neutral_lander_only_under_standalone
M28-conflict-paths-raw: KILLED  test_a_conflict_answer_redacts_every_field_it_carries
M29-conflict-remedy-raw: KILLED  test_a_conflict_answer_redacts_every_field_it_carries
M30-nonce-shape-message: KILLED  test_each_land_route_names_its_own_body_shape[payload0-/actions/session/land-nonce-a
M31-unusable-lander-accepted: KILLED  test_a_binding_that_answers_no_lander_is_no_lander
M32-report-branch-raw: KILLED  test_the_landed_report_shows_a_branch_name_escaped
M33-js-shown-name-raw: KILLED  test_the_confirm_control_shows_a_branch_name_escaped
M34-js-question-raw: KILLED  test_the_confirm_control_shows_a_branch_name_escaped
M24-js-keys-on-session: KILLED  test_the_confirm_control_is_keyed_on_land_and_the_token
M25-js-posts-twice: KILLED  test_the_confirm_control_shows_the_branch_and_head_and_posts_once
M26-js-foreign-nonce: KILLED  test_the_confirm_control_never_offers_main_or_a_foreign_nonce
M27-js-asks-for-main: KILLED  test_the_confirm_control_never_offers_main_or_a_foreign_nonce

Round 4's 27 (lane 3's MAJOR; item 10):

M35-landed-branch-unchecked: KILLED  test_a_landed_answer_is_checked_field_by_field_at_every_door[branch]
M36-landed-merge-unchecked: KILLED  test_a_landed_answer_is_checked_field_by_field_at_every_door[merge_commit]
M37-landed-previous-unchecked: KILLED  test_a_landed_answer_is_checked_field_by_field_at_every_door[previous_main]
M38-landed-served-unchecked: KILLED  test_a_landed_answer_is_checked_field_by_field_at_every_door[served_checkout]
M39-landed-pushed-unchecked: KILLED  test_a_landed_answer_is_checked_field_by_field_at_every_door[pushed]
M40-landed-any-type: KILLED  test_a_landed_answer_is_checked_field_by_field_at_every_door[merge_commit]
M41-landed-absent-raises: KILLED  test_a_landed_answer_is_checked_field_by_field_at_every_door[branch]
M42-code-unmapped: KILLED  test_a_landers_refusal_reaches_no_door_with_its_credential[fragment]
M43-code-all-unlisted: KILLED  test_a_listed_code_is_answered_as_it_is
M44-conflict-code-raw: KILLED  test_a_landers_refusal_reaches_no_door_with_its_credential[fragment]
M45-code-not-a-string-unguarded: KILLED  test_a_listed_code_is_answered_as_it_is
M46-code-list-short: KILLED  test_the_codes_the_route_answers_are_the_codes_the_seam_names
M47-cli-operation-swapped: KILLED  test_the_terminal_prompt_states_the_operation_land_performs[standalone]
M48-cli-operation-dropped: KILLED  test_the_terminal_prompt_states_the_operation_land_performs[standalone]
M49-prompt-ignores-operation: KILLED  test_the_terminal_prompt_states_the_operation_land_performs[governed]
M50-prompt-table-swapped: KILLED  test_the_terminal_prompt_states_the_operation_land_performs[standalone]
M51-issuer-takes-any-operation: KILLED  test_the_terminal_issuer_states_the_operation_it_is_given_and_no_other
M52-decision-always-merge: KILLED  test_the_terminal_prompt_states_the_operation_land_performs[governed]
M53-nonce-operation-swapped: KILLED  test_the_nonce_states_the_operation_the_land_route_performs[standalone]
M54-nonce-operation-dropped: KILLED  test_the_routes_land_a_branch_once_with_the_views_nonce
M55-operation-not-recorded: KILLED  test_the_routes_land_a_branch_once_with_the_views_nonce
M56-route-passes-current-operation: KILLED  test_a_landing_whose_operation_changed_after_the_question_lands_nothing
M57-act-skips-operation-check: KILLED  test_a_landing_whose_operation_changed_after_the_question_lands_nothing
M58-js-question-always-merge: KILLED  test_the_confirm_control_states_the_operation_the_server_will_perform
M59-js-questions-swapped: KILLED  test_the_confirm_control_states_the_operation_the_server_will_perform   (re-run as a true swap)
M60-js-nonce-operation-unchecked: KILLED  test_the_confirm_control_states_the_operation_the_server_will_perform
M61-js-issued-drops-operation: KILLED  test_the_confirm_control_states_the_operation_the_server_will_perform
tree clean after: True

M59 first died at fixture setup: the one-key edit left merge with no question, so the harness threw. It was re-written as a true two-key swap and re-run alone, and it now dies on the test's assertion (1 failed).

The full suite, as validate runs it (CI=1, OPENDOX_TEST_SANDBOX_REQUIRED=1, LANG=C.UTF-8, every GIT_* and XF_* unset, postgres:16 reached as the service, the venv from CI's install command):

at 99f0eb22: 5963 passed, 11 skipped, 2 warnings in 2124.34s (0:35:24)   EXIT 0
at 1bba2b1c: 5970 passed, 11 skipped, 2 warnings in 1689.58s (0:28:09)   EXIT 0
at 99c4e079: 5972 passed, 11 skipped, 1 failed   (the failure: test_the_draft_page_budget_does_not_read_the_bodies_it_sizes, the load-sensitive timing test; CI's validate at 99c4e079: SUCCESS)
at 0bec6f5b: 5994 passed, 11 skipped, 1 failed, 2 warnings in 3717.09s (1:01:57)   (the failure: the same timing test,
             which passes alone: 1 passed in 1.78s, EXIT 0)

Review round 1 (Copilot at b933d980, "Changes recommended", two findings, both FIXED in 1bba2b1c)

  • r4234726885 (medium), FIXED. The conflict answer redacted message alone, but paths and remedy carry the same repository text (a path, a branch name). Each is now redacted by the same rule. New node: test_a_conflict_answer_redacts_every_field_it_carries, with a branch sess&access_token=<secret> conflicting on notes?token=<secret>.md. It was red before the fix; M28 and M29 are killed by it.
  • r4234726939 (low), FIXED. A land-nonce body that is not an object was told the land route's shape, which names nonce. It is now told its own shape, LAND_NONCE_NOT_AN_OBJECT. New node: test_each_land_route_names_its_own_body_shape. Its two nonce cases were red before the fix; M30 is killed by it.

Both threads are answered and resolved.

Review round 2 (Copilot at 1bba2b1c, "Needs a closer look", 0 open findings, two "previously missed" points, both FIXED in 99c4e079)

  • A binding whose answer has no land operation (cli_branch_actions.py 374 and 419). An injected landing_factory returning such an object advertised actions.land: true and issued a nonce, and then the land route answered 500. Now _usable treats such an answer as no lander: the key reads false, and the nonce route and the verb refuse by name (no-lander-bound). New node: test_a_binding_that_answers_no_lander_is_no_lander, red before the fix; M31 is killed by it.
  • A bidi override in a branch name (branch-actions.js 198). The browser's question showed the name verbatim, while the terminal's prompt escapes it (session_git.shown). shownName now shows it the same way in the question and in both answers, and the verb's landed report does too. New nodes: test_the_confirm_control_shows_a_branch_name_escaped and test_the_landed_report_shows_a_branch_name_escaped, both red before the fix; M32, M33 and M34 are killed by them.

Codex answered the triggers at b933d980 and 1bba2b1c with its usage-limit message, so it has not reviewed this PR.

Review round 3 (Copilot at 99c4e079, "Needs a closer look", 0 open findings, no thread): FIXED under holder ruling item 10 (6103915259)

Copilot raised two previously missed points with one cause. On the governed path, which submits through the host's instrument and merges nothing, both confirmation surfaces asked about a merge commit onto main. I first proposed it as an accepted limit; the holder ruled it a FIX in this round. The confirmation is the human act the landing seam is built around, so it must name the operation that will actually happen.

  • The terminal issuer. landing_confirm.confirm_at_terminal(branch, head, *, operation) takes operation as a REQUIRED keyword (OPERATION_MERGE or OPERATION_SUBMIT), so no caller can leave the wording to a default. An unknown value is refused before the terminal is opened. Its questions:

    • Land branch <b> at <head> onto main with a merge commit?
    • Submit branch <b> at <head> to the host's instrument? Nothing merges here: the merge stays the governance's act.

    landing_confirm.py is admitted into T016's Files for this wording and parameter only. The capability's branch-and-head binding, its single use and the static two-issuer check are unchanged.

  • The decision. cli_branch_actions.landing_operation reads the binding once and decides from the reading landing_refusal uses. The verb decides before it prompts. The land-nonce route decides before it issues, records the operation with the nonce (under one lock), and the land route passes it on. land_branch performs exactly that operation, or refuses with operation-changed when the binding changed after the question, asking neither the lander nor the instrument.

  • The browser issuer. issuedNonce accepts only operation merge or submit, and confirmQuestion asks:

    • land <b> at <head> onto main with a merge commit?
    • submit <b> at <head> to the host's instrument? nothing merges here: the merge stays its governance's act
  • Tests, red first (99c4e079 with the new tests: 21 failed, 7 passed). One row per path per issuer:

    • test_the_terminal_prompt_states_the_operation_land_performs[standalone|governed], which asserts the exact prompt;
    • test_the_terminal_issuer_states_the_operation_it_is_given_and_no_other;
    • test_the_nonce_states_the_operation_the_land_route_performs[standalone|governed];
    • test_a_landing_whose_operation_changed_after_the_question_lands_nothing;
    • test_the_confirm_control_states_the_operation_the_server_will_perform, in the JS lane.

    Mutants M47 to M61 swap or drop the operation kind at each step; all are KILLED.

  • Contract shape, for T002e: the land-nonce answer gains operation, and the land route gains the refusal code operation-changed. T002e records the wording in plan 038's text.

Review round 4 (lane 3's EARLY review at 99c4e079, NO-GO, 1 MAJOR, FIX-NOW): FIXED in 743bb8b3 and 0bec6f5b

The MAJOR: a secret leaking at the print boundary from an injected lander. landed_object printed the five Landed fields unchecked: in the route's 200, the verb's --json, and served_checkout in plain output. Separately, a lander's LandingRefused code went out unredacted in the 409.

  • landed_object(landed, branch) checks each field against data-model.md § Landed, as submission_object checks a report. It refuses anything that is not the landing's, with a fixed sentence that names only the field (code answer-not-the-landing). The rules:

    • branch must be the branch landed;
    • merge_commit and previous_main must be full object names;
    • served_checkout must be fast-forwarded or left;
    • pushed must be exactly False;
    • a field the answer lacks is not the landing's either.
  • serve_branch_actions.answered_code answers a code only from LANDING_CODES, and unlisted for any other, including a code that is not a string. This covers the landing_refused, merge_conflict and confirmation: arms. test_the_codes_the_route_answers_are_the_codes_the_seam_names holds the list equal, in both directions, to the codes landing.py, landing_confirm.py and cli_branch_actions.py spell.

  • One trust model, the fixed credential corpus. HostileLander is driven through every print path: the route's 200, its 409 and the server log, and the verb's text, its --json and its refusal. The corpus covers:

    • user:pw@;
    • a token as the bare username;
    • an x-access-token: URL;
    • ?ticket=;
    • a fragment;
    • scp-like user:pw@host:path;
    • a URL in prose.

    The nodes: test_a_landed_answer_is_checked_field_by_field_at_every_door[<each field>], test_a_landers_refusal_reaches_no_door_with_its_credential[<each shape>], test_a_listed_code_is_answered_as_it_is and test_a_well_formed_landed_answer_is_answered_as_it_is. They were red at 99c4e079, with the secret in the route's body and code; M35 to M46 are killed by them.

Holder ruling item 11 (6110997237): two ACCEPTED LIMITS, in T015's code

  • (a) The shared redactor leaves a bare token in prose that is not part of a URL, such as x-access-token:VALUE written alone. This is the limit 6086098003 item 2 (b) already accepts: "A raw token in a host port's prose, with no URL, passes."
  • (b) T015's submission_object accepts str subclasses. Only in-process code can build one, since JSON and git output give exact str. The lander's trust model is hostile DATA from trusted CODE (5988818366). T016 does not edit T015's code for it, and landed_object and answered_code use the same isinstance test.

Codex answered the triggers at b933d980, 1bba2b1c and 99c4e079 with its usage-limit message (CODEX-LIMIT). The trigger at 0bec6f5b is comment 6111587379 (2026-10-11 17:15Z).

Files changed

T016's Files line: src/opendox/serve.py, src/opendox/cli.py, src/opendox/landing_confirm.py (admitted by item 10 for the prompt's wording and the operation parameter only), src/opendox/default_profile.py (prose only: its BranchActionSubcommands and BranchActionRouteExtension carry land from the two branch-action modules, and its docstring and tuple comments now name land), src/opendox/cli_branch_actions.py, src/opendox/serve_branch_actions.py, src/opendox/branch_session.py (its FR-033 comment only), src/opendox/web/views/branch-actions.js, src/opendox/web/app.js, src/opendox/web/index.html, tests/fixtures/web_boundary_census.yaml (three rows and the A and C totals; views/branch-actions.js 327 -> 353 and A 19104 -> 19130 for item 10), tests/test_web_boundary.py (two pins: the land routes are addressed by branch-actions.js alone, and the control keys on land, never on session), and tests/test_landing_guardrails.py (the surface nodes).

Admitted collateral, minimal (for the holder's confirmation at READY):

  • tests/test_default_profile.py (6023619783 item 1): test_the_default_contributes_the_runtime_command_opendox_runtime_builds expects ["runtime", "submit", "land"], with its message updated. Nothing else in the file changes.
  • tests/test_capability_honesty.py (6027633398): GOVERNED gains "land": ("POST", "/actions/session/land"). _assert_every_true_flag_answers expects a composed host's map to lack submit and land.
  • tests/test_lens_seed_actions.py (6027633398): in test_the_lens_of_a_real_standalone_serve_offers_neither_seed_action, the contributed-route manifest is now submit, then /actions/session/land-nonce, then /actions/session/land. There is still no seed route.
  • src/opendox/web/views/account-menu.js (6069024568 item 2, the chain T015 → T016): WRITE_ACTIONS gains "land". The census line count is unchanged.

Same-kind enumeration collateral (pre-authorized, 6027633398):

  • tests/test_submit_route.py::test_the_default_profile_contributes_the_route_and_its_mixin. Its assertion bindings == (_SUBMIT,) enumerated the default profile's contributed routes. It now asserts submit first, then the two land routes. No other assertion in the file changes.

pyproject.toml's :312 is not touched: the control lives in the existing views/branch-actions.js, so the bundle stays at 43 files.

Not done here

  • T017 re-pins the CI floors at phase 4's tip. T018 documents land in the openDox root README. T019 proves openxFactory's host unchanged.
  • No production host declares an instrument in release 2 (R2Q2 (a) with R2Q3 (a)). The governed path runs against registered TEST hosts. The verb's governed path needs a test host that also carries openDox's verb, because a host profile replaces the default's command tree.
  • An instrument's refusal is redacted by T015's rule, which over-redacts the words after a token= value. That errs on the safe side, and it is T015's rule, not changed here.

Arc: neutral-product-standalone-operability

🤖 Generated with Claude Code

brettheap and others added 7 commits October 9, 2026 20:23
The surface section of tests/test_landing_guardrails.py: the verb, the two
routes, the actions.land key, the server's and CLI's bindings, and R2Q5 (a)'s
merge observation; and F12.2's binding nodes now assert T016's bindings bind
no lander. Against the product before T016: 58 failed, 3 passed (the three
guards that hold before the surface exists).

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

cli_branch_actions.py: the land act both doors share (landing_refusal,
land_branch, branch_head) and `opendox land`, confirmed at /dev/tty with no
bypass flag. cli.py: _landing_port, and generate-and-open declaring the
server's landing_factory with the install it resolved. serve.py:
landing_factory, served_lander, landing_can_act, actions.land present only
where both land routes are bound, read again per /capabilities request.
serve_branch_actions.py: land-nonce and land behind the three clauses.
tests/test_landing_guardrails.py: 169 passed. Not yet: the confirm control,
census, collateral tests, account menu, branch_session comment, mutants.

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

views/branch-actions.js gains mountLandConfirm beside the submit control:
keyed on actions.land and the console token, it fetches a nonce, shows the
branch and head it is bound to, and posts it once. app.js mounts it into the
new #landconfirm in index.html. The census rows and totals follow the three
files. account-menu.js names land among WRITE_ACTIONS (the chain T015 ->
T016, #656 6069024568 item 2). Node harness tests for the control and the
menu, and web-boundary pins for the land routes and key.

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

branch_session.py: the FR-033 comment says a standalone landing is observed
by the same merge observation, unchanged (comment only). The admitted and
same-kind enumeration collateral, each minimal: test_default_profile.py (the
contributed verbs gain land, 6023619783), test_capability_honesty.py
(GOVERNED gains land; a host's map lacks submit and land, 6027633398),
test_lens_seed_actions.py (the contributed-route manifest gains the two land
routes, 6027633398), and test_submit_route.py's
test_the_default_profile_contributes_the_route_and_its_mixin (the bindings
are submit, then the two land routes; same-kind, listed in the PR body).

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

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

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Its docstring and its three tuples' comments named the submit route alone;
they now name the land verb and its two routes too. Prose only.

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 21:29
@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.

@sourcery-ai

sourcery-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implements the full T016 landing surface: a human-confirmed CLI verb, nonce-protected HTTP routes, binding- and governance-aware capabilities, and a browser confirmation control, with standalone merges and governed instrument submissions sharing one redacted landing act and extensive guardrail coverage.

Sequence diagram for human-confirmed branch landing

sequenceDiagram
    actor Human
    participant CLI as opendox land
    participant Landing as landing_refusal
    participant Confirm as landing_confirm.confirm_at_terminal
    participant Lander as LandingPort
    participant Git as Git checkout

    Human->>CLI: cmd_land(repo_root, branch)
    CLI->>Landing: landing_refusal(lander, checkout_root)
    alt landing is unavailable
        Landing-->>CLI: LandingRefused
        CLI-->>Human: redacted refusal
    else landing can act
        CLI->>CLI: branch_head(checkout_root, branch)
        CLI->>Confirm: confirm_at_terminal(branch, head)
        Human-->>Confirm: branch confirmation
        Confirm-->>CLI: confirmation
        CLI->>Lander: land_branch(lander, checkout_root, branch, confirmation)
        Lander->>Git: --no-ff merge branch into main
        Git-->>Lander: Landed(merge_commit)
        Lander-->>CLI: landed_object
        CLI-->>Human: merge commit and git revert -m 1 command
    end
Loading

Sequence diagram for nonce-protected HTTP landing

sequenceDiagram
    actor Browser
    participant Routes as BranchActionRoutes
    participant Gate as _branch_action_refused_at_the_gate
    participant Nonces as LandingNonces
    participant Act as land_branch
    participant Lander as LandingPort

    Browser->>Routes: POST /actions/session/land-nonce {branch}
    Routes->>Gate: validate loopback, session, actor, console
    Routes->>Routes: branch_head(checkout_root, branch)
    Routes->>Nonces: issue_nonce(branch, head)
    Nonces-->>Browser: nonce, branch, head
    Browser->>Routes: POST /actions/session/land {branch, nonce}
    Routes->>Gate: validate loopback, session, actor, console
    Routes->>Nonces: confirm_nonce(branch, nonce)
    Nonces-->>Routes: confirmation
    Routes->>Act: land_branch(lander, checkout_root, branch, confirmation)
    Act->>Lander: land(branch, confirmation)
    Lander-->>Routes: Landed
    Routes-->>Browser: 200 landing result
Loading

State diagram for browser landing confirmation

stateDiagram-v2
    [*] --> Ready
    Ready --> Ready: ask invalid branch
    Ready --> NonceIssued: POST /actions/session/land-nonce
    NonceIssued --> Ready: nonce refusal or request error
    NonceIssued --> Confirmed: confirm button
    Confirmed --> Landed: POST /actions/session/land succeeds
    Confirmed --> Refused: landing_refused or merge_conflict
    Confirmed --> Failed: landing_failed
    Landed --> [*]
    Refused --> Ready
    Failed --> Ready
Loading

File-Level Changes

Change Details Files
Adds the land command and shared landing semantics for standalone merges and governed submissions.
  • Registers land with the four supported options and enforces pre-confirmation refusals for invalid branches, unsupported governance, and install-mode conflicts.
  • Requires an explicit controlling-terminal confirmation, redacts named failures, and reports landed merge metadata plus its revert command.
  • Shares the landing act between CLI and HTTP paths, selecting a neutral lander for standalone repositories or a host instrument for governed repositories.
src/opendox/cli_branch_actions.py
src/opendox/cli.py
src/opendox/default_profile.py
Introduces nonce-protected HTTP routes for confirming and performing a landing.
  • Adds land-nonce and land routes with strict request schemas, per-server nonce storage, branch/head binding, single-use redemption, and the existing session security gate.
  • Maps merge conflicts, governance refusals, submission failures, and unnamed failures to constrained, redacted responses.
  • Contributes the routes only through the default profile and reuses the shared landing implementation.
src/opendox/serve_branch_actions.py
src/opendox/serve.py
src/opendox/default_profile.py
Exposes an honest, binding-aware actions.land capability and wires the server lander.
  • Adds landing_factory to server construction and propagates the resolved install mode from generate-and-open, including --local.
  • Publishes actions.land only when both land routes are bound, combining local-human eligibility with a per-request landing feasibility check.
  • Keeps host profiles and the core default capability map free of the contributed land key.
src/opendox/serve.py
src/opendox/cli.py
src/opendox/default_profile.py
tests/test_capability_honesty.py
Adds the browser confirmation control for the two-step landing flow.
  • Mounts a separate control beside branch actions and keys it exclusively on actions.land plus a console token.
  • Fetches and displays a branch-bound full commit nonce, rejects main and foreign/invalid nonce responses, and consumes the pending nonce before posting once.
  • Displays standalone landing, governed submission, conflict, and refusal outcomes.
src/opendox/web/views/branch-actions.js
src/opendox/web/app.js
src/opendox/web/index.html
src/opendox/web/views/account-menu.js
Extends regression and guardrail coverage across the landing surface.
  • Adds CLI, route, capability, nonce replay, governance, redaction, security-gate, live-session reconciliation, and JavaScript control tests.
  • Updates route/profile enumerations, web-boundary census data, and collateral assertions for the new contributed action.
tests/test_landing_guardrails.py
tests/test_web_boundary.py
tests/test_capability_honesty.py
tests/test_default_profile.py
tests/test_submit_route.py
tests/test_lens_seed_actions.py
tests/fixtures/web_boundary_census.yaml
Documents that live sessions continue to terminate through existing merge observation.
  • Updates the FR-033 commentary to explain that a --no-ff standalone landing is observed by the existing merge-state reconciliation path without teaching sessions to command landing.
src/opendox/branch_session.py

Tips and commands

Interacting with Sourcery

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

Customizing Your Experience

Access your dashboard to:

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

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Conflict responses can expose unredacted repository-controlled text, and one nonce-route validation message describes the wrong schema.

2 open findings
What changed in this PR

Adds a human-confirmed branch-landing workflow across openDox’s default CLI, HTTP, capability, and browser surfaces.

Changes:

  • Adds opendox land, landing bindings, and dynamic actions.land.
  • Adds nonce-backed landing routes and web confirmation controls.
  • Expands guardrail, capability, profile, and boundary coverage.
File Description
src/​opendox/​cli.py Binds the lander for local serves.
src/​opendox/​cli_branch_actions.py Implements the land command and shared action.
src/​opendox/​serve.py Adds landing capability and server binding.
src/​opendox/​serve_branch_actions.py Adds nonce and landing routes.
src/​opendox/​default_profile.py Registers landing surfaces.
src/​opendox/​branch_session.py Documents landing reconciliation.
src/​opendox/​web/​app.js Mounts the confirmation control.
src/​opendox/​web/​index.html Adds the control mount point.
src/​opendox/​web/​views/​branch-actions.js Implements browser confirmation.
src/​opendox/​web/​views/​account-menu.js Reports landing access.
tests/​test_landing_guardrails.py Covers landing behavior and safeguards.
tests/​test_web_boundary.py Pins web ownership and capability usage.
tests/​test_submit_route.py Updates contributed-route expectations.
tests/​test_lens_seed_actions.py Updates route-manifest expectations.
tests/​test_default_profile.py Verifies command registration.
tests/​test_capability_honesty.py Verifies landing capability honesty.
tests/​fixtures/​web_boundary_census.yaml Updates web census measurements.

🧠 Review effort: Balanced


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

Comment thread src/opendox/serve_branch_actions.py Resolved
Comment thread src/opendox/serve_branch_actions.py Resolved
… names its own body shape (Copilot on #100)

Copilot r4234726885 (medium): the conflict answer redacted `message` alone,
while `paths` and `remedy` carry the same repository text; each is redacted
by the same rule now. Copilot r4234726939 (low): a land-nonce body that is
not an object was told the land route's shape, naming `nonce`; it is told
its own (LAND_NONCE_NOT_AN_OBJECT).

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 22:43
@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.

🔵 Needs a closer look

Branch names are rendered unsafely in confirmation/output surfaces, and malformed landing factories can advertise an unusable action.

0 open findings

2 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Medium severity Validate injected lander exposes a callable land operation

src/​opendox/​cli_branch_actions.py:374

This treats every non-None factory result as a usable lander. For example, the documented injection seam can return object(): /capabilities then advertises actions.land: true, the nonce route succeeds, and the land route is guaranteed to fail with AttributeError and a 500. Validate that the result exposes a callable land operation and return the named no-lander refusal otherwise.

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

Medium severity Escape bidi-format characters in browser branch confirmations

src/​opendox/​web/​views/​branch-actions.js:198

Git accepts Unicode bidi-format characters in branch names (the existing test_the_prompt_shows_a_branch_name_escaped covers this), but this confirmation sentence renders the branch verbatim. A name such as sess\u202e1 can therefore be visually reordered in the browser, undermining the human confirmation this control is meant to obtain. Escape non-printable/format characters before display, mirroring the TTY prompt's session_git.shown behavior, and cover the browser control with the same bidi branch case.

🧠 Review effort: Balanced

… shown escaped (Copilot at 1bba2b1 on #100)

Copilot's review at 1bba2b1 ("Needs a closer look", 0 open findings) named
two previously missed points, both fixed:
- cli_branch_actions.py: a binding's answer with no callable `land` is no
  lander (`_usable`), so actions.land reads false, the nonce route and the
  verb refuse by name (no-lander-bound), and nothing answers 500;
- branch-actions.js: `shownName` shows a branch name as the terminal's prompt
  does (session_git.shown), escaped where it holds a bidi override or another
  character a display acts on, in the question and both answers; the verb's
  landed report does the same.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@brettheap
brettheap requested a balanced review from Copilot October 10, 2026 23:26
@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.

🔵 Needs a closer look

Governed landings submit rather than merge, but both confirmation surfaces currently tell users they are confirming a merge commit.

0 open findings

Previously missed (2)

In code that hasn't changed since last review

Medium severity Terminal confirmation describes merge instead of instrument submission

src/​opendox/​cli_branch_actions.py:474

For a governed repository with an instrument, landing_refusal() permits execution and land_branch() submits through that instrument, yet this issuer asks the user to confirm a merge commit onto main. The terminal confirmation must use governance-neutral wording or be told whether this invocation will merge or submit, otherwise the explicit human act confirms the wrong operation.

Medium severity Confirmation inaccurately describes governed landing operation

src/​opendox/​web/​views/​branch-actions.js:220

This confirmation is inaccurate on the governed path: actions.land is also true when a host instrument exists, but confirming there calls request_landing() and only submits the branch; it does not merge onto main. Use governance-neutral wording (or expose the action kind) so the human confirms the operation that will actually occur.

🧠 Review effort: Balanced

brettheap and others added 2 commits October 11, 2026 01:10
…the operation it confirms (plan 038)

Lane 3's MAJOR on #100 at 99c4e07 (FIX-NOW): landed_object checks the
five Landed fields against data-model.md § Landed (branch, two full
object names, served_checkout in {fast-forwarded, left}, pushed is
False), refusing with a fixed sentence (answer-not-the-landing); the
land routes answer a refusal code only from LANDING_CODES, else
`unlisted`. A hostile lander carrying the fixed credential corpus is
driven through the route's 200 and 409 and its log, and the verb's
text, --json and refusal.

Holder ruling item 10 (openxFactory#656 6103915259): confirm_at_terminal
takes a required keyword `operation` (merge | submit) and words the
question for it; landing_operation decides it before the prompt from the
reading landing_refusal uses; the nonce answer states it, the view's
question names it, and land_branch refuses `operation-changed` when the
act would differ.

WIP: mutants, the full suite and the PR body are not yet run for this
round.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…odel; rows for an absent field and a non-string code (plan 038)

Holder ruling item 11 (b): the lander trust model is hostile data from
trusted code, as submission_object's is, so landed_object and
answered_code test isinstance(..., str). New rows: a Landed answer that
lacks a field is refused naming it, and a refusal whose code is not a
string is answered `unlisted`.

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

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T17:18:32.901097Z 0bec6f5 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sonarqubecloud

Copy link
Copy Markdown

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 0bec6f5be8

ℹ️ 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.

🟡 Changes recommended

The confirmation UI permits overlapping nonce and landing requests that can consume or obscure a newer confirmation.

1 open finding

🧠 Review effort: Balanced

Comment on lines +335 to +348
async function confirm() {
const issued = pending;
pending = null;
confirmButton.disabled = true;
if (!issued) return show(false, "ask to land a branch first");
try {
const answer = await postLanding(
ACTIONS_SESSION_LAND_ROUTE,
{ branch: issued.branch, nonce: issued.nonce }, caps, fetcher);
return show(answer.ok, describeLanding(answer));
} catch (err) {
return show(false, "not landed: " + (err?.message || "error"));
}
}

@brettheap brettheap left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Codex expert-panel review of 0bec6f5be8dbf1529c1582d1ac7f366342495960 against this PR's main base.

No additional actionable finding beyond the existing unresolved confirmation-button race. Confirmed that ask() disables the ask button, while confirm() leaves it enabled during the landing POST. Issuing another nonce while confirmation is in flight can invalidate or replace the nonce/question associated with the pending operation. Keep the ask control disabled until confirmation settles, with a deferred-response regression case.

The earlier conflict-field redaction and nonce-body-shape comments are fixed in the current code. Reviewed CLI/HTTP operation agreement, branch/head-bound single-use confirmation, refusal gates, capability composition, and response validation; no other evidence-backed defect found.

Validation: static source/diff/test and review-thread inspection. Existing validate, acceptance, and SonarCloud checks report SUCCESS; no project test suite was rerun. Readiness: resolve the open race and follow the documented draft/landing controls before merge.

This branch has not been deployed

No deployments
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