Skip to content

T007 batch N: record #1144's 12.4a addendum on the console token via the opened URL; plan 034's AT-R1 reads the private copy (RULED 5963851934) - #1222

Merged
brettheap merged 16 commits into
mainfrom
bookkeeping/034-t007-batch-n
Oct 3, 2026
Merged

brettheap merged 16 commits into
mainfrom
bookkeeping/034-t007-batch-n

Conversation

@brettheap

@brettheap brettheap commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

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

This PR is bookkeeping only (T007 batch N). It records Brett Heap's multi-choice word of 2026-10-03 on #656 comment 5963851934 in #1144 (add-neutral-product-standalone-operability), and it carries the plan-034 lines that follow from it. Plan 034 was read at main dca40ca3, which is #1221 (the phase-3 ticks), after #1220 (T099 and T101–T104).

RULED — Brett 2026-10-03 (multi-choice): "Token via the opened URL (Recommended)". Adversarial review 2 (M5) found that a standalone openDox serves its console token from /capabilities to any loopback caller, including other OS users on the same machine (pre-existing). […] plus the #1144 amendment for every falsifier or AT-R1 step that reads /capabilities' console_token (batch N), and T095's harness reading the private copy.

The design is the holder-approved one, which T104 (#1220) already plans. It covers the standalone default profile only, and it includes the holder's ruling on #1220's Copilot thread r4171166321: the copy refuses an OPENDOX_STATE_DIR that is the served root or lies under it.

The #1144 amendment (12.4a)

Where it goes. An AMENDED — T007 Batch N (5963851934) addendum at box 12.4a, after its prose and before 12.5. In all of #1144, 12.4a's human-console test (tasks.md:2123, "the per-serve token, a trusted loopback Host, …") is the one line that names the token.

Why it is a task-line addendum and not a spec-delta note. No ratified requirement or scenario text names how the token is delivered. In the spec delta (specs/neutral-product-standalone-operability/spec.md), console_token, console token and capabilities each occur 0 times (grep -c -i). No #1144 falsifier reads the token from /capabilities either:

  • F10.1 fetches only /;
  • F13.1 reads only the payload's install block (json.load(...).get("install"));
  • F12's named test, tests/test_submit_route.py::test_submit_route_is_refused_without_the_console_token, sends a request without the token, so it is unchanged.

So this has the form of batches A–J and L, not of batches K and M, which add dated notes to the spec delta.

What it records, measured at openDox-code main 1130e996. A serve that grants session mints the token (mint_console_token, serve.py:617, called at :1977) and publishes it on /capabilities (:1980). The web bundle reads it from there (web/app.js:1459-1471, web/views/edit.js:10-26). On a standalone plane, the one built from openDox's own default profile:

  • /capabilities carries no console_token;
  • the entry point writes a private copy at <state_dir>/console/<port>.html under OPENDOX_STATE_DIR:
    • the file is mode 0600, in a directory of mode 0700;
    • each missing directory is made by descriptor, and the file is created without following a link;
    • the whole path is checked as openDox-code#69's bundle checks its own tree;
  • a file already at the copy's path is replaced only when it is this user's own regular 0600 file with one link (an earlier copy for that port); anything else there refuses the start by name, and such a copy is refused when read;
  • the state directory and every served root may not overlap in either direction. A state directory that is, or lies inside, a served root is refused by name (the holder's ruling on Plan 034: add T099, T101, T102, T103, T104 (RULED 5962754358, 5963162921, 5963618568, 5963851934) #1220's review, r4171166321). So is a served root that is, or lies inside, the state directory, <state_dir>/console itself included: the holder's ruling on this PR's review (r4174345203), a hardening of the approved design. /source already refuses a path that leaves its root through a symbolic link (default_registry.resolve_within, openDox-code main e49b17c3). The static bundle's route, which follows links inside --web-dir, answers 404 for GET and HEAD to anything whose resolved target is the copy's directory or inside it (doxBench R-8 (V2 family): lens subtabs + docs subpane wheel split with distilled abstracts #84's send_head guard);
  • the copy forwards to …/index.html#console_token=<token>, using the fragment and never the query;
  • the start writes the copy and prints its location as a file:// URL, with or without --no-open, and never prints the token or a URL that carries it, so standard output and CI logs stay clean. openDox-code#84's head cb899546 prints console {console.file_url} (this user's private copy, …);
  • the copy is removed when the server stops, and the start is refused when no safe copy can be written;
  • a composed host keeps its delivery on /capabilities;
  • a tab that kept an earlier serve's token is refused by the next serve until the page is opened again through the new copy. That is the accepted stale-tab limit.

The addendum is carried out by T104.

Plan 034

  • AT-R1, which is this feature's text and not File add-neutral-product-standalone-operability: open the BUILD arc, recording ten rulings #1144's:

    • spec.md step 4: whether or not --no-open is given, the command writes the private copy and prints its file:// location. Without --no-open the command hands the copy to the browser; with it, as AT-R1 runs, the page is opened by loading that URL. /capabilities carries no console token.
    • quickstart.md § 3 reads the token from $OPENDOX_STATE_DIR/console/$PORT.html. It checks that the directory is 0700 and the file 0600, both this user's own. It requires every console_token= in the copy to open a fragment. It also parses the meta refresh's target URL, which must be exactly this server's http://127.0.0.1:$PORT/index.html with an empty query, and it reads the token from the fragment. It also asserts that caps.json has no console_token. The catalog request reads its header from stdin (printf … | curl -H @-), so the token never sits on a command line. The raw /capabilities payload must carry the token neither by name, at any depth, nor by value.
    • quickstart.md § 4 step 1 loads the copy's file:// URL instead of the bare page.

    I ran § 3's extraction against T104's own write_private_copy (on T104's openDox-code branch, read only). The token it read matched the one written. Seven altered copies stopped the run:

    • the token after a first query parameter;
    • the token in the target's query;
    • the token's value in a next query parameter;
    • another host, another path or another port;
    • the file loosened to 0644.
  • T007:

  • T104 (the analyze pass's H1): its task text gains "The private copy, exactly". That covers:

    • the path <state_dir>/console/<port>.html, a 0600 file in a 0700 directory;
    • the HTML page's JSON record in <script type="application/json" id="opendox-console">, with schema_version 1, kind opendox-console-access, page_url, opened_url, port, pid and console_token. These are the seven keys console_access.py writes at doxBench R-8 (V2 family): lens subtabs + docs subpane wheel split with distilled abstracts #84's cb899546;
    • the meta-refresh to the fragment, never the query;
    • written, and its location printed, with or without --no-open;
    • a refused copy or state directory refuses the start by name, before anything is written. That includes a state directory that overlaps any served root in either direction;
    • the copy removed on Ctrl-C or a plain kill.

    Its falsifier lists what T104's PR must prove for every point of the addendum, the stale-tab limit aside:

    • the START cases, through the writer and each entry point: a link, a directory, another user's file, a hard-linked file, or this user's own file at a mode other than 0600 at the copy's path; a state directory that fails the tree checks or overlaps a served root in either direction (r4171166321, r4174345203);
    • the READ cases, a FIFO with no writer refused at once;
    • /source answers 404 through an outward link;
    • the static route answers 404, for GET and HEAD, for the copy, its directory's listing, another port's copy, and a directory whose index.html or index.htm links to the copy.

    It is a requirement on T104, not a claim about doxBench R-8 (V2 family): lens subtabs + docs subpane wheel split with distilled abstracts #84. At c979747a, doxBench R-8 (V2 family): lens subtabs + docs subpane wheel split with distilled abstracts #84 has the static guard and the served-root cases. It still needs the writer's mode check (its write_private_copy replaces any of this user's own single-link files whatever the mode), the writer and entry-point regressions, a non-blocking reader, and the guard on automatic index files.

  • The analyze pass's stale token sites, each covered:

    openDox-code#75's body is T095's writer's.

  • T095: its After: keeps Plan 034: add T099, T101, T102, T103, T104 (RULED 5962754358, 5963162921, 5963618568, 5963851934) #1220's T104 and adds T007 (batch N). T104's "Batch N, pending." bullet becomes "Batch N.", which names what this batch records and moves.

  • The rest of tasks.md:

    • § Format ("fourteen batches") and "What can start";
    • the dependency order (phase 0 and Acceptance);
    • the phase-3 slice intro and the acceptance row;
    • § "Ruled amendments": its heading, intro, an N row and a closing sentence on AT-R1.
  • plan.md:

    • batches A–N in the graph;
    • the PHASE 3 and ACCEPTANCE graph lines name batch N;
    • the amendments list;
    • Principle V's "A to N".

Gates

Each was run at 7746a50d and at main de2ab703 (--change, doc-health and the catalog again at a4bb8d8f), in two full clones of the same kind. Each clone sits in a directory named openxFactory, with remote.origin.url set to opensoft/openxFactory.

gate main de2ab703 this branch 7746a50d
python3 scripts/validate-openspec-cli-pin.py --all --strict (pinned 1.12.0) rc 0, 110 passed, 1 failed (111 items), 0 UNDISPOSITIONED failures, with 1 accepted exception (add-chain-attestation) the same, identical apart from the clone path
… --change add-neutral-product-standalone-operability — rc 0, 1 passed, 0 failed, validated --strict clean
python3 scripts/doc-health.py --single-repo . --as-of 2026-10-03 31 critical, 22 error, 64 warning, 20 info byte-identical report, 0 new regressions
box_census.py over #1144's tasks.md total 125: 105 [ ], 11 [x], 9 [~] the same. No box is added

Also passing on both:

  • proposal-support.py . verify add-neutral-product-standalone-operability;
  • validate-sequenced-after.py . --ledger-diff (229 rows);
  • validate-code-surface.py, validate-target-release.py, validate-document-catalog.py (0 errors, 0 warnings) and validate-pin-registrations.py.

Earlier heads, 2ce6c8f3 against main ec9308c8 and then cce8c96b and 93e83501, read the same. At c954da69, which merges main f261fefa (#1223), --all and --change read the same, the document catalog has 0 errors and 0 warnings, and the plan tools read 96 tasks, 110 nodes and 269 edges, with 0 chain gaps and 0 arrow mismatches. The plan checks there read the same numbers as below.

At 7746a50d, as at 49aab763, pytest -q tests/doc-health/test_modified_block_currency_self_gate.py tests/sequenced_after reports 306 passed.

The plan's consistency checks. The persisted parser in opensoft/brett-wip (handoffs/xFactory/attachments/lane-opendox/r1plan/tools/) is widened to batch N in brett-wip e5302284, in the form of batch M's 712aedad: BATCHES = "ABCDEFGHIJKLMN", every [A-M] made [A-N], plus its docstring and the README line. Batch N adds no single-writer file, so the chain tools are unchanged.

  • The A–M parser reads main at 96 tasks, 109 nodes and 267 edges.
  • The widened tools read this branch at 96 tasks, 110 nodes and 269 edges. The two new edges are T095 → T007.N and T007 → T007.N. They also find:
    • no cycles, as written or with the Lands-with groups merged;
    • 0 chain gaps, and 47 chaindirect pairs;
    • 0 of 83 arrow mismatches;
    • no phase gaps (T099 follows T089 by design);
    • in sharedfiles, 81 shared pairs, with only the 4 known phase-1 pairs NOT ORDERED;
    • qcheck 27 of 27.
  • The widened parser refuses main until this PR lands ("names no line for ['N']"), as batches K, L and M did.

Review

Copilot at verdict threads answered in
2ce6c8f3 Changes recommended the realization test's promise was wider than T104's falsifier (medium); the quickstart missed a token after a first query parameter (medium); Principle V still cited batch M's gate (low) cce8c96b: T104's falsifier lists every point and the addendum sets the stale-tab limit aside; § 3 parses the opener's target; the row cites batch N's run. All three are answered and resolved
cce8c96b Needs a closer look, no findings and no threads one previously-missed note: cite the holder's served-root ruling r4171166321, which is not part of 5963851934 93e83501: cited in the addendum, which now names its details as the holder's approved design, and in batch N's bullet, T007's Ruled: line and the N row; answered in comment 5970872244
93e83501 Needs a closer look, no findings and no threads one previously-missed note: quickstart § 4 step 1 said "the file:// URL the command printed" while the addendum said the path is printed 919cf14e: one wording everywhere (the location as a file:// URL, never the token), matching #84's cb899546; answered in comment 5972080941
919cf14e Changes recommended the quickstart proved only that no query parameter was named console_token, not that the token's value stayed out of the request target (medium); AT-R1 step 4 said the page is opened "with or without --no-open" (low) 9b019b35: the target must be this server's /index.html with an empty query (four altered copies refused); step 4 separates writing the copy from opening it. Both answered and resolved
9b019b35 Changes recommended the served-root boundary did not cover a served root at or under the state directory, such as <state_dir>/console, or an outward symlink (medium) d115b41a/defe1adf: the holder ruled to keep the widening. The state directory and every served root may not overlap in either direction; /source refuses symlink escapes; T104's falsifier gains both cases. Answered and resolved
c954da69 Changes recommended the static bundle's route was not covered (medium); the falsifier named no static case (medium); the falsifier claimed writer cases #84 does not have, since #84's writer replaces a loosened own file (low) 3ce22a5f: the static route's 404 invariant is recorded; the static case is added; the START and READ cases are separated, with only this user's own 0600 earlier copy replaced; the body no longer claims #84 has every case. All three answered and resolved
7746a50d Changes recommended the quickstart put the token on curl's command line (medium); plan.md said every batch lands before a checkpoint that runs an amended falsifier, which N does not fit (low) a4bb8d8f: the header goes over stdin; plan.md says each batch lands before the task that needs it, and N before T095. Both answered and resolved
a4bb8d8f Needs a closer look, no findings and no threads one previously-missed note: the fragment check could wrap at index 0, and /capabilities was checked only for a top-level key efbc29da: a preceding # is required; the raw payload must carry the token neither by name nor by value. Answered on the PR
efbc29da Changes recommended the static case missed automatic index files (medium); a previously-missed note: the READ cases omitted a FIFO, which can block a reader 6c62a776: GET and HEAD cases for a directory whose index.html or index.htm links to the copy, with the guard judging the final served file; a FIFO is refused at the start and at once on read, since the reader never blocks. Answered and resolved
6c62a776 Needs a closer look, no findings and no threads two previously-missed notes: T095 lacked the raw-payload token assertion; the reverse overlap had no symlink-alias case 02ec4f92: T095 asserts the raw payload carries the token neither by name nor by value; T104 refuses a served root that is a symbolic link into the state directory. Answered on the PR

For the holder

  1. Landing order. phase 3 ticks: T070, T071, T072, T073, T075, T078, T079, T080, T081, T085 and T088 (plan 034) #1221 has landed and is merged in (8c43ce02). The evidence PRs T077: run F10.1 as batch H amends it, at openDox-code 8e377823 (plan 034) #1223 and T074: run F13.1 as batch H amends it, at openDox-code 90ac7033 (plan 034) #1224 and the analyze-fix PR also edit plan files. Whichever is clean first lands first, and I merge main again right before READY-CANDIDATE.
  2. The chain tools lag Plan 034: add T099, T101, T102, T103, T104 (RULED 5962754358, 5963162921, 5963618568, 5963851934) #1220. chaincheck.py and chaindirect.py in brett-wip do not yet carry Plan 034: add T099, T101, T102, T103, T104 (RULED 5962754358, 5963162921, 5963618568, 5963851934) #1220's chains: serve.py → T103 → T104, cli.py → T104, and openDox-code pyproject.toml → T075 → T101. I tested those chains in a scratch copy that I did not commit. They read 0 gaps and 52 pairs on this branch, and T084 → T104 on cli.py is transitive through T102. Persisting them is your call, and it is outside this batch.
  3. T095's harness (openDox-code#75) belongs to T095, not to this PR. T095's task text now asks it to assert, as quickstart § 3 does, that the raw /capabilities payload carries the token neither by name nor by value. To match § 3 it should also check that the copy's modes are 0700 and 0600, and send the header without putting the token on a command line.
  4. The holder's served-root ruling (r4174345203) is recorded in the addendum, in T104 and in the N row. doxBench R-8 (V2 family): lens subtabs + docs subpane wheel split with distilled abstracts #84 at c979747a has the reverse check and the static guard. It still needs the writer's mode check (a loosened own file at the copy's path must refuse the start, not be replaced) and the writer and entry-point regressions before T104 lands.
  5. The stale-tab limit's wording is my reading of "accepted": a tab keeps the token in sessionStorage (T104's web/views/notebook.js), so after a restart its guarded requests are refused until the page is reopened through the new copy. Strike or correct it if that is not the limit you accepted.

Landing

It touches openspec/changes/, so it lands under a Rule 6 LANDING/LANDED window. It is bookkeeping, so it carries no Arc: trailer (R1Q20 (a)) and no closing keyword. The holder posts READY and lands it.

🤖 Generated with Claude Code

Loading
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