Compare commits
38
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94128f73f7 | ||
|
|
5079012771 | ||
|
|
77172ce3b4 | ||
|
|
1afcfc766d | ||
|
|
4732821f7a | ||
|
|
8d37d21cb8 | ||
|
|
9a131e9567 | ||
|
|
66f7becf21 | ||
|
|
45dca69f6e | ||
|
|
293b42fee9 | ||
|
|
369607e92d | ||
|
|
59f013247c | ||
|
|
e8bb13df84 | ||
|
|
dba2ebdb85 | ||
|
|
45ea3fa0d2 | ||
|
|
f69c962009 | ||
|
|
5b6c878143 | ||
|
|
8c2c5303cf | ||
|
|
23e3d09fa9 | ||
|
|
795a645e65 | ||
|
|
076ca8d6e4 | ||
|
|
68be863248 | ||
|
|
264fad2e26 | ||
|
|
24672fd9d6 | ||
|
|
30e6bb6803 | ||
|
|
7defb58e97 | ||
|
|
9c8877bdf3 | ||
|
|
2d0318a44a | ||
|
|
bd3fa2a484 | ||
|
|
ab575ee553 | ||
|
|
1676ad0de8 | ||
|
|
4874d1e83a | ||
|
|
e909ef51a2 | ||
|
|
4607e15b83 | ||
|
|
8b42010551 | ||
|
|
4863e2caf4 | ||
|
|
7b25a60633 | ||
|
|
e86df37d76 |
No files matched your search
@@ -5403,3 +5403,17 @@ Row 299 (573, #1806, Gander, Filbert): before, the P10 band test timed a fault r
|
||||
2026-10-23 | Huey | Row 272 round 2 on row 219 landing 5fdfd7275, after 295. Replayed round 1 and B1/N1/N2; seven conflicts resolved retaining both log histories, both test sets, 219 instance chooser and 295 owner-settings-only transport. Static comparison confirms old tests differ only by mos-1388 approved hunks. Sage3357/Mos1442 authorize bounded granted-user legacy fallback: only session.list access-refused and omitted-session route; no new session grants or owner routing. RED first under3358 on new file only: 1 expected legacy assertion failure, 3 guards pass, 3.504s, TMPDIR mktemp/no underscore, no compose network; slot returned as huey0035. Then implemented fallback and added timeout/bus/malformed guards plus isolated-copy mutant runner, all unrun afterward. Candidate commit/push precedes Sage's full gate by3354; no green claim.
|
||||
|
||||
2026-10-23 | Huey | Row 272 round 3 per mos-1455 / sage-3435. Gate run 1 on b44332a93 RED: bus 891/0, business 231/0, CLI 940/1, plugins 110/1, webui 372/20; no mutants. Fixed only new CLI fixture role authority and three null-old render guards. Catching browser tests unchanged. manifest.r3 freezes the same 17 paths. Authorized pre-gate follow-up commit/push; no local tests, Node or queue writes; separate compactions dependency and Sage gate remain pending.
|
||||
|
||||
2026-10-23 | Sage (1ef1e4f8) | Row 272 landing (#1777, 264e) | Gate r4 on bea0c8e1c over 1e629c892: bus 891/0, cli 941/0, webui 392/0, business 231/0; plugins 110/1, the single red being row 65 harness.test.mjs:192 naming compactions.mjs, which row 307 owned and fixed. M1-M6 and F1-F4 killed, restore clean. Landed d33989230, queue commit 8dc132bec.
|
||||
|
||||
2026-10-23 | Sage (1ef1e4f8) | Row 307 landing (#1814, Vikunja 598) | Six first-parent commits replayed onto 8dc132bec with matching patch-ids, 16 paths equal to 6fdfe3790, manifest digest 17c9f8d9 rebuilt from git. Gate green 14:37:21Z: bus 891/0, cli 941/0, plugins 119/0, webui 392/0, business 231/0, every other package 0 failed 0 skipped, every scripts/test-*.sh passed (skips: test-queue canonical root, test-task live provider x2). M1-M4 killed, restore clean. Landed d243f6b25, DEFERRED 307 N1 0621c439e, queue commit fe4ee8c7b. Correction: my first note said Vikunja 598 done when I had only commented (951); Mos closed it (952).
|
||||
|
||||
2026-10-23T17:29:46Z | Gyro Vikunja571 sage-3542 Connections amendment | Branch gyro/editor-connections-design cut exactly from landed PRD1.17 30e6bb680; read REQ-LIB-5 in that PRD. Replaced stale J-b waits in parent and W4. Proposed W8 owns current authorized Markdown/DOCX links/backlinks list, labels, versioned refresh, leakage refusals and fixture tests. Build order under mos-1470/comment961 is W7 closed routing candidate, W8 landing, then W7 human first-real-import opening. No REQ-LIB-8 condition or acceptance change. Q234/mos-1363/S0 M1-M14 and post-10-27/MVP priority fixed. Static diff, twelve brief sections and append-only checks pass. No repo Node, tests, build, browser, queue mutation or live action. Fenton reviews after authorized docs branch push; Sage lands on approval.
|
||||
|
||||
2026-10-23T17:32:37Z | Gyro sage-3544 fenton-0016 N1/N2 delta | Before: W7 Gate/final real-conversion list omit the W8 build-order cross-reference and W8 human-view filtering cites agent settings. After: both locations explicitly put W8 landing before human opening as mos-1470 build order, not acceptance; comment/tracked-deletion links are not current story links and never appear in the human Connections view regardless of agent settings. New commit atop approved 5af060fb5, no amend. Static diff and append-only checks pass. Docs only, no repo Node/tests/live action. Fenton checks only this delta.
|
||||
|
||||
2026-10-23 | Fethry | Row 225 C2-10b (#1726), handoff recovery. Before: Morgana's untested candidate 9a131e956 replaces renderItems with renderReply and adds Console citation/notice/status rendering and status/revert routes. Continuing that exact history on fethry/row225; preserving A1-A5 and the accepted file deviations. Remaining: confirm limits contract, review/test candidate under Sage CLEAR, obtain Mos OK through Sage for inherited old-test changes, manifest and Dewey review. No Node/tests run in this session and no green claim.
|
||||
|
||||
2026-10-23 | Fethry | Row 225 T1 lane A (sage-3641/3647). Before: nested replyLimits fallback/problem omitted, wrong-project revert receipt accepted, invalid library mapping hidden. After RED: these three local behaviors corrected; three assertions in the new handoff test files corrected against existing route/mapping/Boolean behavior, each explained in BUILD.md. Whole-file GREEN: renderer 9/0, routes 13/0, browser 9/0; full library 81/0, channel-proof 2/0. Approved old-test numstats remain 80/66 and 3/1. Full webui/build and full integration gate have not run. Isolated mutants next within the authorized 19:38Z hard stop; no completion claim.
|
||||
|
||||
2026-10-23 | Fethry | Row 225 T1 expanded evidence complete (sage-3647). Full library81/0 and channel-proof2/0; final targeted renderer9/0, routes13/0, browser9/0. Isolated kit14/14 assertion kills on507901277, every target restored/hash-checked, candidate hashes unchanged. First attempt stopped at a wait-based failure, recorded as not killed; corrected the new test's repaint wait, baseline9/0, and reran the whole kit. No processes left; lane A returned around19:29Z. Source manifest for Dewey prepared; full webui/build and Sage's integration/scripts gate still pending. Raw logs preserved in scratch, normalized display copies and raw SHA256 provenance in agent evidence.
|
||||
@@ -47,6 +47,14 @@ its launch configuration remains fixed, including on resume. Use Filbert's
|
||||
wrapper to select that configuration; a direct shared-helper invocation uses
|
||||
its own supplied flags or the system defaults.
|
||||
|
||||
Any run that includes the webui suite, whether a seat's slot run or a landing
|
||||
gate, sets `MOSAIC_REQUIRE_EDITOR_BUILD=1`, so a missing editor toolchain fails
|
||||
the run instead of skipping the rebuild test. A worktree that links the
|
||||
canonical `node_modules` also runs `npm ci --ignore-scripts --no-audit --no-fund`
|
||||
in its own `packages/webui` first. The root install carries esbuild 0.28.1
|
||||
through pi-coding-agent, and the rebuild needs the 0.28.2 that
|
||||
`packages/webui/package-lock.json` pins (Vikunja 597, mos-1453).
|
||||
|
||||
All agents follow repository governance and current user direction. Team
|
||||
leadership does not add deployment or push authority. Coordinate overlapping
|
||||
work with Sage and preserve other sessions' changes.
|
||||
|
||||
@@ -0,0 +1,376 @@
|
||||
# Row 225 (C2-10b) Console chat: replies, citations, write notices, status line
|
||||
|
||||
Owner: Morgana, from sage-3582 (18:53Z 10-23). Base: origin/refactor 45dca69f6. Branch: morgana/row225.
|
||||
Brief: docs/plans/2026-10-20_case2-rows.md, C2-10b. Design: agents/gosalyn/work/case2/DESIGN.md 7.4,
|
||||
5.2 (the reply schema and the check result) and the write notice and `library.revert` (about line 286).
|
||||
|
||||
## Ruling on the dependency gap (sage-3591)
|
||||
|
||||
225 builds against the design contracts. `renderReply` stays pure, and the caller supplies the answers
|
||||
it can't know. The revert route proxies to the bus verb and shows the refusal code until the verb
|
||||
exists. Landing order: 225 lands after 217 (C2-06), not after 288 (C2-02). Sage adds `after 217` to
|
||||
row 225. Before 288 lands, the Revert button gets the bus's refusal and shows its code, as the brief
|
||||
allows.
|
||||
|
||||
## A1. The check result I assume (to 217, Launchpad)
|
||||
|
||||
The broker stores one check result with each agent-to-human message the guard passes. The Console reads
|
||||
it on the message row that `/api/chat/threads/<id>/messages` returns, under the key `check`:
|
||||
|
||||
```json
|
||||
{
|
||||
"check": {
|
||||
"citations": [
|
||||
{ "scope": "canon", "agent": null },
|
||||
{ "scope": "supporting", "agent": "acme/scribe" },
|
||||
{ "scope": "web", "agent": null }
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- `check` is `null` or absent on a message the guard didn't check: a human's message, a free-text reply,
|
||||
a notice, or a message from before 217.
|
||||
- `check.citations` has one entry per entry of the body's `citations`, in the same order.
|
||||
- `scope` is one of `canon`, `playground`, `supporting` and `web`. A url cite is `web`.
|
||||
- `agent` is the `Mosaic-Agent` trailer value, `<business>/<instance>`, from
|
||||
`git log -1 --format=%(trailers:key=Mosaic-Agent,valueonly) <commit> -- <path>`, or `null` when the
|
||||
file's last commit at `commit` carries none. A url cite has `agent: null`. The Console shows the
|
||||
agent-written label when `agent` is a nonempty string, and names the agent.
|
||||
|
||||
The Console trusts nothing in the body for scope or label. A cite with no matching check entry renders
|
||||
with no badge and no label. It doesn't fall back to a scope it worked out itself.
|
||||
|
||||
If 217 uses other names, I change mine to theirs before either of us pushes (sage-3591 item 1).
|
||||
|
||||
## A2. The revert verb I assume (to 288, Honker)
|
||||
|
||||
- Verb: `library.revert`. A human verb (design M4): from an agent session it refuses `human-required`,
|
||||
like `library.status` (`broker.mjs:5133`).
|
||||
- Args: `{ "project": <business project name>, "commit": <40 lowercase hex> }`. The design writes
|
||||
`library.revert {commit}`. `project` is added to match the other library verbs, and like theirs it is the
|
||||
key of `business.projects` (`mirror.mjs:31`), which is the chat project's `repo` link, not its UUID. Both are required, and no other key
|
||||
is allowed (`invalid-request`), as the other library verbs check with `keys(args, ...)`.
|
||||
- Result: `{ "project", "path", "reverted": <the commit given>, "commit": <the new commit> }`.
|
||||
- Refusal codes the Console shows by name:
|
||||
- `library-revert-not-agent`: `commit` has no `Mosaic-Agent` trailer for this business, or isn't
|
||||
reachable from the served commit.
|
||||
- `stale-base`: a later commit changed that path.
|
||||
- `human-required`, `invalid-request`, `project-not-configured`.
|
||||
- Before 288 lands, the bus refuses the verb (expected `unknown-verb`, `broker.mjs:6578`), and the Console
|
||||
shows that code.
|
||||
- HTTP status in the Console (`packages/webui/src/bus.mjs` `busStatus`): `stale-base` and
|
||||
`library-revert-not-agent` map to 409. Every other code keeps the existing mapping.
|
||||
|
||||
## A3. The status line
|
||||
|
||||
`GET /api/library/status?project=<id>` proxies `library.status {project}` through the existing
|
||||
`libraryStatus` option. `cli.mjs:110` already passes that option, but `startServer` doesn't read it.
|
||||
The status line shows:
|
||||
|
||||
- the served commit (7 characters) and its age;
|
||||
- `library-diverged` when the sync state names it;
|
||||
- the fetch error code;
|
||||
- the reply limits in force, and the keys that fell back;
|
||||
- the count of R-problems, linking to the list.
|
||||
|
||||
It reads the fields `readSyncState` returns at the base (`packages/library/src/mirror.mjs:232`). It shows
|
||||
any field 217 adds (the limits) only when present.
|
||||
|
||||
## A4. "Changed since" (ruled sage-3596)
|
||||
|
||||
Sage ruled that 217 supplies `last`. On a `thread.messages` row that carries `check`, each path cite's
|
||||
entry gets `last`, the file's last commit at the served tip, read when the message is read. When `last`
|
||||
is absent the Console marks nothing changed, and a test pins that.
|
||||
|
||||
One more field is needed, raised in morgana-0200. The cited `commit` is a library commit, not the
|
||||
file's own last commit, so a cite made at a commit that didn't touch the file would differ from `last`
|
||||
while the file is unchanged. I asked 217 to also store `file`, the file's last commit at the cited
|
||||
commit. That's `%H` from the same `git log -1 <commit> -- <path>` call that reads the trailer, so it
|
||||
costs no extra git call. The Console marks a cite changed when both `file` and `last` are 40-hex and
|
||||
differ. The cited commit is reachable from the served one (5.2), so `file` is an ancestor of `last`,
|
||||
and differing means newer. A missing or malformed `file` or `last` marks nothing.
|
||||
|
||||
The entry the Console reads, in full: `{ scope, agent, file?, last? }`.
|
||||
|
||||
## A5. `no-cited-answer` retires
|
||||
|
||||
`renderItems` and its `NOTICES` (`no-cited-answer`, `no-answer`, `turn-failed`) go. 217 sends the
|
||||
runner's fixed texts as plain bodies (design 5.2, "Runner texts"), and renderReply shows those as free
|
||||
text. Design 7.4 names no other notice than `library-write`, so nothing is lost (sage-3596 item 3).
|
||||
|
||||
## Files
|
||||
|
||||
Both deviations below were accepted in sage-3596 and are named in the manifest for Dewey. The brief owns these:
|
||||
|
||||
- `packages/library/src/render.mjs`: `renderReply` replaces `renderItems`.
|
||||
- `packages/library/src/index.mjs`: the export.
|
||||
- `packages/library/README.md`: the section.
|
||||
- `packages/library/tests/render.test.mjs`.
|
||||
|
||||
It also owns `bus.js`, its stylesheet, `serve.mjs` (only the two routes) and new webui tests. Two
|
||||
deviations, both recorded here:
|
||||
|
||||
- The chat view's message list is `packages/webui/src/public/chat.js:85` (`window.MosaicChat`), not
|
||||
`bus.js`. The reply, notice and Revert rendering goes in `chat.js` and `chat.css`. The status line
|
||||
goes in the chat thread view, so it is also in `chat.js`.
|
||||
- `packages/webui/src/console-bus.mjs` and `cli.mjs` each get one `libraryRevert` line, beside the
|
||||
existing `libraryStatus` wiring.
|
||||
|
||||
## Overlap with row 220 (C2-10a, Researcher, 3ef6da90d)
|
||||
|
||||
220 changes one line each in the webui tests discord.test.mjs, fixture.mjs, history-fixture.mjs,
|
||||
relaunch.test.mjs and return-flow.test.mjs. Its other paths are in control-board, conversation, discord
|
||||
and business. 225 doesn't touch those five files or those packages. Its webui tests are new files.
|
||||
|
||||
## Handoff to Fethry (mos-1501, Q245)
|
||||
|
||||
The row moved to Fethry (Codex, fethry/row225). Everything below is **untested**: no suite or single file
|
||||
has run on it, since a run needs Sage's CLEAR. Each changed file passes `node --check`.
|
||||
|
||||
Done in the handoff commit:
|
||||
|
||||
- `render.mjs` `renderReply(body, {check, changed, name})`; index export; README section;
|
||||
`render.test.mjs` rewritten. `renderItems` is gone from every package.
|
||||
- `serve.mjs`: `/render.mjs` static entry (owner and user file maps), `GET /api/library/status`
|
||||
(one `project` query, answer must name that project), `POST /api/library/revert` (save's boundary,
|
||||
strict `{project, commit}`, refusal shows the code, lost or unusable answer is `outcome-unknown`,
|
||||
never retried). Both are nulled for a granted user, and `userRoute` keeps them owner-only. The tester
|
||||
listener refuses `libraryRevert`.
|
||||
- `bus.mjs`: `library-revert-not-agent: 409`. That re-pins `packages/webui/src/bus.mjs` in
|
||||
`packages/bus/tests/channel-proof.test.mjs`, with a comment line, as row 254 did. It's a third deviation,
|
||||
in another package's test.
|
||||
- `console-bus.mjs` and `cli.mjs`: `libraryRevert`, beside `libraryStatus`.
|
||||
- `chat.js`: dynamic `import('/render.mjs')` (CSP is `script-src 'self'`); body text until it loads.
|
||||
Cites with a scope badge, the agent-written label, "changed since" from `file`/`last`, links only for
|
||||
https with `rel="noopener noreferrer"`. A notice gets a Revert button behind `confirm()`. The library
|
||||
status line goes under the thread heading.
|
||||
- `chat.css`: cite, badge, notice and status styles.
|
||||
- New tests: `packages/webui/tests/library-routes.test.mjs` and
|
||||
`packages/webui/tests/chat-replies-browser.test.mjs`. 220's five files are untouched.
|
||||
|
||||
Decisions made in the build:
|
||||
|
||||
- The library name is the chat project's `repo`. A project with no repo reads no status and its
|
||||
Revert does nothing.
|
||||
- These codes hide the status line: `project-not-declared`, `library-mapping-invalid`,
|
||||
`project-not-configured`, `not-configured` and `owner-only`.
|
||||
- Otherwise every code-repo thread, and every granted user, would show "unavailable".
|
||||
- Cost: a broken library mapping also hides the line. `library.status` from the CLI still shows it.
|
||||
- "Age" is the time since `lastFetch` ("fetched 5 min ago"), not the served commit's age, which the
|
||||
status doesn't carry.
|
||||
- The limits fields are assumed to be `replyLimits {requireCitation, citationsPerReply}` and
|
||||
`replyLimitsFallback [keys]`, and are shown only when present. **Not agreed with 217.** Confirm with
|
||||
Beakley and rename.
|
||||
- A notice body's shape is all the renderer checks. An agent in a business without a library could
|
||||
send a body that looks like a notice. The page would show it, but `library.revert` still refuses it.
|
||||
|
||||
Left:
|
||||
|
||||
1. Get CLEAR and run the webui and library suites, `channel-proof.test.mjs`, and the two new files whole.
|
||||
The browser test's selectors and waits have never run.
|
||||
2. Agree the limits field names with 217 (Beakley).
|
||||
3. Granted-user R6 G5 (`granted-user.test.mjs:252`) lists owner verbs by hand. Add `library.revert`
|
||||
once 288 lands.
|
||||
4. BUILD.md: the mutant list and the mos-1275 timeout plan.
|
||||
5. The manifest names the three deviations: chat.js and chat.css in place of bus.js, the console-bus and
|
||||
cli lines, and the channel-proof re-pin.
|
||||
|
||||
## Fethry continuation (2026-10-23, Q245)
|
||||
|
||||
Owner: Fethry, thread 14f80e3c-ace7-4793-a577-e1275ca09b0b. Branch fethry/row225.
|
||||
This file carries Morgana's complete BUILD.md above unchanged, recovered from 9a131e956
|
||||
(base 45dca69f6). Morgana stopped editing 225 at that handoff. Issue #1726; Dewey reviews.
|
||||
Sage owns queue moves, test slots, gate and landing. No Node/tests until Sage CLEAR
|
||||
(sage-3611); commits/pushes before the gate are explicitly Untested. No credential files read.
|
||||
|
||||
### Confirmed interfaces and rulings
|
||||
|
||||
- Beakley beakley-0004 confirms ordered check.citations {scope, agent, file, last}; a missing
|
||||
or malformed file/last means no changed marker. Fetched age accurately describes lastFetch.
|
||||
- Beakley's concrete library.status shape is replyLimits:
|
||||
{requireCitation, citationsPerReply, fallback: [keys], problem: 'reply-limits-unreadable' | null}.
|
||||
The inherited top-level replyLimitsFallback assumption is superseded. Show nested fallback and
|
||||
problem, with a browser regression test for each. No broker or policy change in this row.
|
||||
- Bubba bubba-0002 confirms A2 and the exact broker notice shape. fethry-0005 forwards the
|
||||
project-key correction: project is chat project.repo, not the chat UUID.
|
||||
- Keep the inherited ordinary-code-repo/granted-user status hiding behavior for now, but a
|
||||
library-mapping-invalid error should stay visible: hiding an invalid mapping hides diagnosis.
|
||||
Confirm this local UI choice through regression coverage and tell Sage/Dewey.
|
||||
|
||||
### Continuation plan and acceptance evidence
|
||||
|
||||
Spec: docs/plans/2026-10-20_case2-rows.md C2-10b; design 5.2 and 7.4;
|
||||
standing rulings sage-3591, sage-3596 and sage-3611. Implement inline in this existing isolated
|
||||
T3 worktree; use the existing candidate and tests, never restart the implementation.
|
||||
|
||||
1. Static audit the handoff against the contracts and inherited tests. Add failing coverage for
|
||||
nested limits fallback/problem, wrong-project revert receipts, missing file/last and invalid
|
||||
mapping visibility. Existing tests require Mos approval through Sage before further edits.
|
||||
2. On Sage CLEAR, run the new files whole and library renderer tests with per-test deadlines;
|
||||
record RED before changing uncovered behavior. Fix only demonstrated local defects. Run
|
||||
targeted GREEN, then the full relevant suites only within the authorized slot.
|
||||
3. Record exact commands, timings and output paths. Prepare mutant kill list below; run only on
|
||||
CLEAR, using isolated copies so the candidate is never temporarily changed for mutation.
|
||||
4. Freeze a manifest containing all source/test/doc changes and all three handoff deviations.
|
||||
Push only fethry/*, as additional commits. Send exact head/results to Dewey and Sage; cc Mos
|
||||
on pushes/blockers. Sage performs queue moves, gate and landing. No merge/release/live changes.
|
||||
|
||||
### Existing test changes requiring Mos OK through Sage (mos-1272)
|
||||
|
||||
Diff against 45dca69f6, inherited from Morgana 9a131e956:
|
||||
|
||||
| File | Added | Removed | Reason |
|
||||
| --- | ---: | ---: | --- |
|
||||
| packages/library/tests/render.test.mjs | 80 | 66 | Brief requires retiring renderItems and replacing its tests with renderReply coverage |
|
||||
| packages/bus/tests/channel-proof.test.mjs | 3 | 1 | bus.mjs gains library-revert-not-agent:409; refresh that source hash and document why |
|
||||
|
||||
No further edits to these files pending approval. No edits to row220's five tests.
|
||||
The new webui test files are additions against the row base.
|
||||
|
||||
### Timeout plan (mos-1275)
|
||||
|
||||
Every Node test run uses --test-concurrency=1 and --test-timeout=30000, under an outer timeout.
|
||||
New library/route files: outer 120s each; new browser file: outer 240s. Full library and channel-proof:
|
||||
outer 180s; full webui: outer 900s, MOSAIC_REQUIRE_EDITOR_BUILD=1. Full webui requires its own
|
||||
packages/webui npm ci per agents/README.md and Sage CLEAR. Output redirects to an evidence log;
|
||||
inspect tail, failure names and summary, never claim green from an exit alone. A timeout is a
|
||||
failed run: stop, report the exact command/phase/last output, and diagnose before retrying.
|
||||
Sage's gate owns every scripts/test-*.sh; no implicit slot or test authority from this plan.
|
||||
|
||||
### Mutant plan (pending CLEAR)
|
||||
|
||||
- M1: drop a path badge or the supporting label; cite browser assertions must fail.
|
||||
- M2: allow http/javascript links; renderer and browser safe-link assertions must fail.
|
||||
- M3: compare cited library commit to last instead of file to last, or treat a missing file/last as
|
||||
changed; changed-since assertions must fail, including same-file/different-library-commit.
|
||||
- M4: ignore nested fallback/problem; status browser tests must fail.
|
||||
- M5: remove a revert fence (send, identity, exact Origin or Fetch Metadata), strict key/commit
|
||||
validation or wrong-project receipt validation; route tests must fail with zero unexpected calls.
|
||||
- M6: retry a refused/unknown revert; single-call route/browser assertions must fail.
|
||||
- M7: remove granted-user library-route fence; owner-only route coverage must fail.
|
||||
|
||||
Progress: handoff and interfaces recovered; candidate untested. No completion claim.
|
||||
|
||||
Static evidence correction: the first pushed patch artifact used ordinary context lines, whose
|
||||
single-space blank context lines make git diff --check report whitespace in the artifact. Regenerated
|
||||
inherited-old-tests.patch with --unified=0; it is the same exact two-file change, applicable with
|
||||
git apply --unidiff-zero. No source or existing test changed for this correction.
|
||||
|
||||
Mutation kit authored at mutants.py (11 concrete mutations across M1-M7), Python AST parse only.
|
||||
It archives the committed packages plus their tracked fixture dependencies into disposable snapshots,
|
||||
links the existing dependency install read-only in practice (tests do not install), enforces exactly
|
||||
one mutation anchor and requires an assertion failure for a kill. It records source hashes before
|
||||
and after. It has not run; anchors for the planned fixes intentionally require those fixes first.
|
||||
No Node/tests/build/browser work has run in Fethry's session pending Sage CLEAR.
|
||||
|
||||
### Old-test approval and preservation condition (mos-1510, sage-3623)
|
||||
|
||||
Mos approves render.test.mjs +80/-66 and channel-proof.test.mjs +3/-1 exactly. No additional edits
|
||||
are permitted to either file without a new Mos OK through Sage. The condition on the renderer:
|
||||
|
||||
- The old malformed-body fixed-line behavior no longer applies. Design 5.2 now says any body
|
||||
outside the cited-object schema is free text whose text is the whole body. Rejecting it into a
|
||||
fixed line would hide human/free-text/older messages and the four fixed runner texts. The new
|
||||
render.test.mjs tests “free text renders as itself with no citations” and “a body without the
|
||||
reply or notice shape is free text: the whole body, no citations” explicitly cover this new rule.
|
||||
- The old no-options path-badge behavior still applies. The new render.test.mjs test “without a
|
||||
check result a path cite has no badge, no label and is never changed” covers it, and the browser
|
||||
test checks an unchecked path cite has no badge/label. No path inference fallback was added.
|
||||
|
||||
Dewey checks both against the frozen old-test delta. The two numstats remain 80/66 and 3/1.
|
||||
|
||||
### Test slot and shared protocol (sage-3623, beakley-0006)
|
||||
|
||||
Targeted lane A slot is planned around 19:47Z, after Gosalyn's 226 run and Sage's queue gap.
|
||||
Wait for explicit CLEAR; the scheduled time alone grants nothing. Hard stop 20:00Z for Sage's
|
||||
226 gate. Boyd's lane B bus/cli/business work is disjoint and does not count as a busy lane A.
|
||||
The three requested files are the library renderer test and the two new webui files, whole/serial.
|
||||
|
||||
Beakley confirms reply-protocol.mjs exports only GUARD_CODES (the seven guard refusal codes) and
|
||||
FIXED_TEXTS {empty, failed, uncited, tooLong}. It has no scope/notice constants or validator.
|
||||
renderReply defines none of those codes or runner texts: it already renders the fixed bodies as free
|
||||
text. It therefore needs no protocol import and no extra browser module route (beakley-0006).
|
||||
Do not add unused imports or redefine those shared codes/texts later.
|
||||
|
||||
2026-10-23T19:21:07Z dependency update (bubba-0006): Bubba's first static row288 push is
|
||||
origin/bubba/row288 c867cada9, explicitly Untested with no Node run. A2 library.revert uses the
|
||||
business.projects key; broker notice retains the exact agreed body. Bubba adds librarySave only
|
||||
in console-bus.mjs/cli.mjs and leaves libraryRevert wiring owned by 225. Preserve both callback
|
||||
changes when Sage integrates. No dependency merge or test run performed here; 225 still lands
|
||||
after 217 and may show unknown-verb until 288 lands.
|
||||
|
||||
## T1 targeted RED to GREEN (sage-3641, 2026-10-23T19:23Z)
|
||||
|
||||
All three files ran whole and serial, with TMPDIR=/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2,
|
||||
--test-concurrency=1 --test-timeout=30000 and outer timeout -k 10 (120s renderer, 120s routes,
|
||||
240s browser). Initial renderer 9/0 (0.105s), routes 9/3 (0.226s), browser 5/3 (5.630s).
|
||||
Final renderer 9/0 (0.105s), routes 12/0 (0.212s), browser 8/0 (5.284s). Logs in evidence/.
|
||||
|
||||
Production fixes after RED:
|
||||
- Reject a library.revert receipt with the wrong project as outcome-unknown; no retry.
|
||||
- Read replyLimits.fallback and display replyLimits.problem per beakley-0004/0006.
|
||||
- Show library-mapping-invalid in the status line; its hidden-status branch is covered by the
|
||||
browser refusal matrix once the nested-limits assertion passes. This diagnosis was made statically;
|
||||
the first RED exits that matrix at the preceding fallback assertion, so visibility itself has only
|
||||
a GREEN run, unlike the fallback/problem and wrong-project fixes.
|
||||
|
||||
Three assertion corrections in NEW handoff files (not pre-existing tests, per sage-3647):
|
||||
1. library-routes.test.mjs: POST /api/library/status in preview mode expects 403, because the existing
|
||||
global preview write fence runs before the GET-only route and returns read-only. The route remains
|
||||
GET-only and no callback fires on that POST. Do not weaken or bypass the fence to get 405.
|
||||
2. library-routes.test.mjs: project-not-declared expects 400, which busStatus already maps at the
|
||||
row base. The inherited 502 expectation contradicted that existing map. No production map change.
|
||||
3. chat-replies-browser.test.mjs: coerce the whole “img element OR window.injected” expression to a
|
||||
Boolean. With no injected node/code the old expression returns undefined, not false. Assertions
|
||||
still require neither DOM injection nor executed handler. All preceding cite/link assertions pass.
|
||||
|
||||
Frozen pre-existing test deltas still render.test.mjs 80/66 and channel-proof.test.mjs 3/1.
|
||||
No Node/Chromium process with this slot TMPDIR remained after targeted tests (checked /proc).
|
||||
|
||||
Expanded CLEAR sage-3647: full library, then channel-proof whole, then isolated mutants that fit;
|
||||
still hard stop 19:38Z. No full webui suite, npm ci or editor build authorized in this window.
|
||||
|
||||
Expanded-slot evidence: full library 81/0 (9.179s), channel-proof 2/0 (0.573s), whole/serial,
|
||||
--test-timeout=30000, outer timeout -k 10 180, same TMPDIR. Logs copied to evidence/.
|
||||
To exercise invalid-mapping visibility independently, added its own browser case and temporarily
|
||||
restored only the hidden-mapping branch. Whole browser RED: 7/2 (8.810s); the direct assertion sees
|
||||
null instead of the diagnostic, and the refusal-matrix wait also fails. Finally restored the exact
|
||||
corrected source before the next run. This supersedes the earlier visibility “GREEN only” note.
|
||||
|
||||
Final targeted coverage before mutation: browser 9/0 (6014.970ms runner duration), routes 13/0.
|
||||
Added an independent send-off test with a configured libraryRevert callback: absence of --send
|
||||
still refuses with zero callback calls. This makes the send fence independently mutation-testable.
|
||||
The kit now has 14 concrete mutations, including agent-label, unreadable-limits problem and send.
|
||||
Each isolated target is restored to its candidate SHA256, and worktree hashes are checked before
|
||||
continuing to the next mutant (sage-3647). Runner uses TAP so assertion failures can be distinguished
|
||||
from timeouts/import/process failures. Full webui/build and the integration gate remain pending.
|
||||
|
||||
Dependency update beakley-0008: row217 first push origin/beakley/row217 c25f5b8da is UNTESTED,
|
||||
continued from Launchpad e25ef0373. No dependency merge here; its protocol/module mount belongs to
|
||||
217 and renderReply needs none of those codes/texts. Integration acceptance remains Sage's gate.
|
||||
|
||||
First isolated-mutant attempt stopped honestly at M3-wrong-commit: M1 badge, M1 agent label and M2
|
||||
https-only link mutants were killed by assertions; M3 failed via the browser's expected-state wait,
|
||||
so the strict runner did NOT count it as a kill. Every target restored/hash-checked and candidate
|
||||
hashes unchanged. Logs retained in evidence/mutants-attempt1/. Corrected the new browser test to wait
|
||||
for a completed repaint (independent of desired output), then assert changed-marker count. Whole
|
||||
browser baseline remains 9/0. No production change. Re-run the whole isolated kit against this test.
|
||||
|
||||
## T1 complete: isolated mutants and source-review handoff
|
||||
|
||||
sage-3647 final kit on source candidate 507901277: 14/14 assertion kills, no timeout/import/process
|
||||
failure counted. Each mutant matched one anchor, restored the target SHA256 and checked the three
|
||||
candidate source hashes before the next. evidence/mutants-final/summary.json records every result;
|
||||
final worktreeUnchanged=true. Logs name the failing tests, including M3's direct assertion after the
|
||||
refresh wait correction. /proc inspection found no remaining Node/Chromium process with the slot
|
||||
TMPDIR. Returned lane A to Sage as fethry-0016 at about19:29Z, before the19:38Z hard stop.
|
||||
|
||||
Checked-in TAP display copies remove trailing whitespace so the diff is clean. Their raw SHA256
|
||||
values are recorded in evidence/raw-log-provenance.json; original byte-for-byte logs remain under
|
||||
/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2. This changes evidence presentation only, never tests.
|
||||
|
||||
MANIFEST.md and manifest.r1.sha256 freeze the13 changed package files for Dewey. All three handoff
|
||||
deviations and Mos1510's two preservation conditions are explicit. Old-test numstats remain80/66 and3/1.
|
||||
No full webui/npm ci/build was run; Sage explicitly reserved it for a later window. Full package/script
|
||||
and dependency integration gate remains required before landing. No queue move, merge or live action.
|
||||
@@ -0,0 +1,67 @@
|
||||
# Row 225 review packet — C2-10b (#1726)
|
||||
|
||||
Owner Fethry (14f80e3c), reviewer Dewey (84fb346c). Base 45dca69f6.
|
||||
Source candidate 507901277 continues Morgana 66f7becf2 and 9a131e956; no rewritten history.
|
||||
Status: targeted tests and full library green; full webui/build and Sage's full gate still pending.
|
||||
This packet requests source/manifest review, not landing or a full-green claim.
|
||||
|
||||
## Behavior and contracts
|
||||
|
||||
The Console shows reply text and citations with path/line/quote, scope and agent-written labels,
|
||||
marks a changed file only with valid differing check.file/check.last, links only https URLs, shows
|
||||
write/delete notices and explicit Revert results, and displays library status, fetch age, divergence,
|
||||
fetch errors, nested replyLimits metadata and R-problems. Invalid library mappings remain visible.
|
||||
Revert validates {project,commit}, preserves refusal codes and reports uncertain/wrong-project
|
||||
receipts as outcome-unknown without retry. The project is chat project.repo (business.projects key).
|
||||
|
||||
A1-A5 are in BUILD.md. Dependency contracts: row217 ordered check.citations and nested replyLimits;
|
||||
row288 A2 revert result/notice. No dependency merge in this candidate. Landing order is 217 then225;
|
||||
unknown-verb is expected until288 lands. Beakley's GUARD_CODES/FIXED_TEXTS need no renderer import:
|
||||
renderReply defines neither and renders those fixed bodies as free text.
|
||||
|
||||
## Frozen implementation and tests
|
||||
|
||||
manifest.r1.sha256 freezes the 13 changed package paths, including the two approved existing-test
|
||||
changes. Check from repository root with `sha256sum -c agents/fethry/work/queue-225/manifest.r1.sha256`.
|
||||
All other changed files are BUILD/session records, handoff/approval evidence and this review packet.
|
||||
No role, policy, schema, secret, live instance, deployment or queue change is included.
|
||||
|
||||
Three departures from the brief, carried from Morgana's handoff:
|
||||
|
||||
1. Chat rendering/status live in public/chat.js and chat.css, where the message list is, instead of
|
||||
bus.js and its stylesheet (sage-3596). serve.mjs serves the same pure render.mjs module to owner
|
||||
and granted-user pages; no duplicated browser renderer and no generated asset.
|
||||
2. console-bus.mjs and cli.mjs wire libraryRevert beside libraryStatus (sage-3596). --send still
|
||||
independently gates Revert. Preserve row288's separate librarySave wiring at integration.
|
||||
3. webui/src/bus.mjs maps library-revert-not-agent to409; bus/tests/channel-proof.test.mjs re-pins
|
||||
only that source's hash and documents why. Mos read and approved this exact +3/-1 (mos-1510).
|
||||
|
||||
Existing-test authority: Mos1510 via Sage3623 approves render.test.mjs +80/-66 and channel-proof +3/-1.
|
||||
Both exact numstats are unchanged. The malformed-body fixed-line rule is superseded by design5.2's
|
||||
whole-body free text, covered by two replacement renderer tests. The old no-options path-badge rule
|
||||
is retained and covered by the replacement test plus unchecked-cite browser coverage. BUILD.md
|
||||
explains these two preservation conditions and the three new-file assertion corrections in detail.
|
||||
|
||||
## Verification and remaining gate
|
||||
|
||||
Evidence logs are under evidence/; commands, deadlines, failures and corrections are in BUILD.md.
|
||||
Targeted whole-file tests: renderer9/0, routes13/0, browser9/0. Full library81/0, channel-proof2/0.
|
||||
No skips/cancellations. Invalid-mapping visibility also has an independent RED then GREEN.
|
||||
All 14 isolated mutants were killed by assertions on source candidate507901277; each mutation
|
||||
matched one anchor, restored its source hash, and verified unchanged candidate hashes before the next
|
||||
mutation. Summary: evidence/mutants-final/summary.json. The first attempt stopped at an expected-state
|
||||
wait (not counted as a kill), then the new browser test was improved and the whole kit rerun.
|
||||
Raw logs remain under the scratch root; checked-in display copies trim trailing whitespace and record
|
||||
raw digests in evidence/raw-log-provenance.json.
|
||||
|
||||
Before landing, Sage still runs full webui with MOSAIC_REQUIRE_EDITOR_BUILD=1 after the worktree-local
|
||||
webui npm ci, every applicable package/script suite and integration against217. No full webui/build
|
||||
in T1 (sage-3647). Dewey approval and Sage's gate/landing remain required; queue moves belong to Sage.
|
||||
|
||||
Static audit: the channel-proof source pin matches webui bus.mjs; no hash pin of bus.js, serve.mjs
|
||||
or library render.mjs was found. packages' only remaining renderItems match is an explanatory comment
|
||||
in the frozen replacement test; no runtime export, import or call remains. No no-cited-answer match.
|
||||
|
||||
Review focus: stored check metadata versus untrusted body, missing/malformed file/last, https-only
|
||||
links and inert hostile text, Revert authority/receipt uncertainty, async route/sign-out isolation,
|
||||
and status diagnostics without owner transport leakage to a granted user.
|
||||
@@ -0,0 +1,64 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 704.129155
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 690.249337
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 595.036289
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 627.082447
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 787.799722
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 587.311743
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 618.209773
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 633.838649
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 619.313248
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 9
|
||||
# fail 0
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 6014.970062
|
||||
@@ -0,0 +1,64 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 636.096036
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 741.239029
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 568.879998
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 641.929005
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 870.041985
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 648.87451
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 566.725897
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 611.150846
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 618.488891
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 9
|
||||
# fail 0
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 6014.364529
|
||||
@@ -0,0 +1,16 @@
|
||||
✔ chat replies: free text, cites with badges, the agent label, changed since and safe links (583.234335ms)
|
||||
✔ chat replies: a write notice reads as its line with a Revert; a refused revert shows its code (634.71741ms)
|
||||
✔ chat replies: a read-only Console shows the notice with Revert disabled (574.836149ms)
|
||||
✔ chat status line: served commit and age, divergence, fetch error and the problems one click away (607.74749ms)
|
||||
✔ chat status line: limits when the status carries them, no problems, and refusals (861.034669ms)
|
||||
✔ chat status line: a project with no repository link reads no library status (611.433469ms)
|
||||
✔ chat status line: unreadable reply limits show their problem and both fallback keys (606.380675ms)
|
||||
✔ chat replies: unchanged file at a different library commit and incomplete checks stay unmarked (650.947719ms)
|
||||
ℹ tests 8
|
||||
ℹ suites 0
|
||||
ℹ pass 8
|
||||
ℹ fail 0
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 5251.735356
|
||||
@@ -0,0 +1,78 @@
|
||||
✖ chat replies: free text, cites with badges, the agent label, changed since and safe links (980.914799ms)
|
||||
✔ chat replies: a write notice reads as its line with a Revert; a refused revert shows its code (753.988771ms)
|
||||
✔ chat replies: a read-only Console shows the notice with Revert disabled (672.814814ms)
|
||||
✔ chat status line: served commit and age, divergence, fetch error and the problems one click away (622.859977ms)
|
||||
✖ chat status line: limits when the status carries them, no problems, and refusals (583.956229ms)
|
||||
✔ chat status line: a project with no repository link reads no library status (635.758222ms)
|
||||
✖ chat status line: unreadable reply limits show their problem and both fallback keys (581.636121ms)
|
||||
✔ chat replies: unchanged file at a different library commit and incomplete checks stay unmarked (653.788881ms)
|
||||
ℹ tests 8
|
||||
ℹ suites 0
|
||||
ℹ pass 5
|
||||
ℹ fail 3
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 5597.371605
|
||||
|
||||
✖ failing tests:
|
||||
|
||||
test at packages/webui/tests/chat-replies-browser.test.mjs:81:1
|
||||
✖ chat replies: free text, cites with badges, the agent label, changed since and safe links (980.914799ms)
|
||||
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
|
||||
+ actual - expected
|
||||
|
||||
+ undefined
|
||||
- false
|
||||
|
||||
at TestContext.<anonymous> (file:///home/jwoltje/.t3/worktrees/mosaic-stack/fethry-row225/packages/webui/tests/chat-replies-browser.test.mjs:102:10)
|
||||
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
at async Test.run (node:internal/test_runner/test:1409:7)
|
||||
at async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3) {
|
||||
generatedMessage: true,
|
||||
code: 'ERR_ASSERTION',
|
||||
actual: undefined,
|
||||
expected: false,
|
||||
operator: 'strictEqual',
|
||||
diff: 'simple'
|
||||
}
|
||||
|
||||
test at packages/webui/tests/chat-replies-browser.test.mjs:152:1
|
||||
✖ chat status line: limits when the status carries them, no problems, and refusals (583.956229ms)
|
||||
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
|
||||
+ actual - expected
|
||||
|
||||
+ 'Library at ccccccc · fetched 5 min ago · citations required, up to 4 per reply · no problems'
|
||||
- 'Library at ccccccc · fetched 5 min ago · citations required, up to 4 per reply · limits fell back: citationsPerReply · no problems'
|
||||
|
||||
at TestContext.<anonymous> (file:///home/jwoltje/.t3/worktrees/mosaic-stack/fethry-row225/packages/webui/tests/chat-replies-browser.test.mjs:156:10)
|
||||
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
at async Test.run (node:internal/test_runner/test:1409:7)
|
||||
at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
|
||||
generatedMessage: true,
|
||||
code: 'ERR_ASSERTION',
|
||||
actual: 'Library at ccccccc · fetched 5 min ago · citations required, up to 4 per reply · no problems',
|
||||
expected: 'Library at ccccccc · fetched 5 min ago · citations required, up to 4 per reply · limits fell back: citationsPerReply · no problems',
|
||||
operator: 'strictEqual',
|
||||
diff: 'simple'
|
||||
}
|
||||
|
||||
test at packages/webui/tests/chat-replies-browser.test.mjs:173:1
|
||||
✖ chat status line: unreadable reply limits show their problem and both fallback keys (581.636121ms)
|
||||
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
|
||||
+ actual - expected
|
||||
|
||||
+ 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · no problems'
|
||||
- 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · limits fell back: requireCitation, citationsPerReply · reply-limits-unreadable · no problems'
|
||||
|
||||
at TestContext.<anonymous> (file:///home/jwoltje/.t3/worktrees/mosaic-stack/fethry-row225/packages/webui/tests/chat-replies-browser.test.mjs:179:10)
|
||||
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
at async Test.run (node:internal/test_runner/test:1409:7)
|
||||
at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
|
||||
generatedMessage: true,
|
||||
code: 'ERR_ASSERTION',
|
||||
actual: 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · no problems',
|
||||
expected: 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · limits fell back: requireCitation, citationsPerReply · reply-limits-unreadable · no problems',
|
||||
operator: 'strictEqual',
|
||||
diff: 'simple'
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
TAP version 13
|
||||
# Subtest: channel conversion preserves the four proof/transport byte baselines and modules cannot import a proof caller
|
||||
ok 1 - channel conversion preserves the four proof/transport byte baselines and modules cannot import a proof caller
|
||||
---
|
||||
duration_ms: 4.280459
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: channel recovery still requires the same shim path and rejects an absent or forged proof
|
||||
ok 2 - channel recovery still requires the same shim path and rejects an absent or forged proof
|
||||
---
|
||||
duration_ms: 413.032186
|
||||
type: 'test'
|
||||
...
|
||||
1..2
|
||||
# tests 2
|
||||
# suites 0
|
||||
# pass 2
|
||||
# fail 0
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 539.602759
|
||||
@@ -0,0 +1,496 @@
|
||||
TAP version 13
|
||||
# Subtest: resolver step 1: a path from the repo root, with or without .md
|
||||
ok 1 - resolver step 1: a path from the repo root, with or without .md
|
||||
---
|
||||
duration_ms: 1.051208
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: resolver step 2: the same path with vaultPrefix/ stripped
|
||||
ok 2 - resolver step 2: the same path with vaultPrefix/ stripped
|
||||
---
|
||||
duration_ms: 0.164795
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: resolver step 3: a path relative to the linking file, never above the repo root
|
||||
ok 3 - resolver step 3: a path relative to the linking file, never above the repo root
|
||||
---
|
||||
duration_ms: 0.192765
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: resolver step 4: a base name that matches exactly one indexed file
|
||||
ok 4 - resolver step 4: a base name that matches exactly one indexed file
|
||||
---
|
||||
duration_ms: 0.201611
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a link into another of her repos resolves to nothing
|
||||
ok 5 - a link into another of her repos resolves to nothing
|
||||
---
|
||||
duration_ms: 0.130282
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: wikilink forms, embeds, and links skipped inside code
|
||||
ok 6 - wikilink forms, embeds, and links skipped inside code
|
||||
---
|
||||
duration_ms: 1.445011
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: only a body embed whose target has an extension other than .md, in any case, is an attachment
|
||||
ok 7 - only a body embed whose target has an extension other than .md, in any case, is an attachment
|
||||
---
|
||||
duration_ms: 0.25003
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the fixture mapping checks and comes back frozen
|
||||
ok 8 - the fixture mapping checks and comes back frozen
|
||||
---
|
||||
duration_ms: 1.772928
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-01c: a prefix inside or holding another entry's book refuses library-playground-other-universe
|
||||
ok 9 - C2-01c: a prefix inside or holding another entry's book refuses library-playground-other-universe
|
||||
---
|
||||
duration_ms: 0.735312
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-01c: a prefix equal to a book folder, or holding its own, refuses library-mapping-invalid
|
||||
ok 10 - C2-01c: a prefix equal to a book folder, or holding its own, refuses library-mapping-invalid
|
||||
---
|
||||
duration_ms: 0.532498
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-01c: universe-level prefixes lie outside every book, in a plain universe and in a hybrid with no books
|
||||
ok 11 - C2-01c: universe-level prefixes lie outside every book, in a plain universe and in a hybrid with no books
|
||||
---
|
||||
duration_ms: 0.668173
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-01c: a draft takes kind, name and playground only, and comes back frozen with books []
|
||||
ok 12 - C2-01c: a draft takes kind, name and playground only, and comes back frozen with books []
|
||||
---
|
||||
duration_ms: 1.032507
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: no playground prefix holds another, and no book folder holds another
|
||||
ok 13 - no playground prefix holds another, and no book folder holds another
|
||||
---
|
||||
duration_ms: 0.507943
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: shape refusals: kind, remote, branch, unknown keys, types, manuscript, folder names
|
||||
ok 14 - shape refusals: kind, remote, branch, unknown keys, types, manuscript, folder names
|
||||
---
|
||||
duration_ms: 0.740368
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a sage-2021: user is optional, kept when given, and must be a plain account name
|
||||
ok 15 - C2-03a sage-2021: user is optional, kept when given, and must be a plain account name
|
||||
---
|
||||
duration_ms: 0.659277
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a hybrid universe is a shape the query code can take (1.4), with sources that must exist
|
||||
ok 16 - a hybrid universe is a shape the query code can take (1.4), with sources that must exist
|
||||
---
|
||||
duration_ms: 0.695117
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a caller-supplied fail receives the code, as business file loading will pass it (C2-04)
|
||||
ok 17 - a caller-supplied fail receives the code, as business file loading will pass it (C2-04)
|
||||
---
|
||||
duration_ms: 0.392362
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: scope comes from the path alone (design 1.2)
|
||||
ok 18 - scope comes from the path alone (design 1.2)
|
||||
---
|
||||
duration_ms: 0.466406
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 mirror: exact default path, bare without checkout or remote, and idempotent initialization
|
||||
ok 19 - C2-04 mirror: exact default path, bare without checkout or remote, and idempotent initialization
|
||||
---
|
||||
duration_ms: 46.645994
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 mirror: simultaneous creators publish one intact mirror and leave no staging paths
|
||||
ok 20 - C2-04 mirror: simultaneous creators publish one intact mirror and leave no staging paths
|
||||
---
|
||||
duration_ms: 32.763959
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 mirror: skipped publication accepts both coreutils statuses without removing the winner
|
||||
ok 21 - C2-04 mirror: skipped publication accepts both coreutils statuses without removing the winner
|
||||
---
|
||||
duration_ms: 109.751094
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 mirror: preserve occupied directories and reject symlink ancestors and code overlaps
|
||||
ok 22 - C2-04 mirror: preserve occupied directories and reject symlink ancestors and code overlaps
|
||||
---
|
||||
duration_ms: 20.129293
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 mirror: existing metadata accepts only bare Git plus state and the precreated lock
|
||||
ok 23 - C2-04 mirror: existing metadata accepts only bare Git plus state and the precreated lock
|
||||
---
|
||||
duration_ms: 24.021555
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 state: missing state is empty only while the served ref is absent
|
||||
ok 24 - C2-04 state: missing state is empty only while the served ref is absent
|
||||
---
|
||||
duration_ms: 37.436349
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 state: valid problems and sync metadata return no content and change no state bytes
|
||||
ok 25 - C2-04 state: valid problems and sync metadata return no content and change no state bytes
|
||||
---
|
||||
duration_ms: 37.681315
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 state: strict keys, types, times, branch, commit and fixed R messages fail closed
|
||||
ok 26 - C2-04 state: strict keys, types, times, branch, commit and fixed R messages fail closed
|
||||
---
|
||||
duration_ms: 105.483341
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 state: symlink, hardlink, non-private state and missing lock refuse without replacement
|
||||
ok 27 - C2-04 state: symlink, hardlink, non-private state and missing lock refuse without replacement
|
||||
---
|
||||
duration_ms: 29.562786
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 file: served commit, not HEAD or a caller commit, owns the exact returned text
|
||||
ok 28 - C2-04 file: served commit, not HEAD or a caller commit, owns the exact returned text
|
||||
---
|
||||
duration_ms: 74.057232
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 file: R1, R2 and R7 exclusions and never-synced mirrors cannot return file bodies
|
||||
ok 29 - C2-04 file: R1, R2 and R7 exclusions and never-synced mirrors cannot return file bodies
|
||||
---
|
||||
duration_ms: 80.573844
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 lock: a first-sync and fast-forward reader wait for a consistent pair across processes
|
||||
ok 30 - C2-04 lock: a first-sync and fast-forward reader wait for a consistent pair across processes
|
||||
---
|
||||
duration_ms: 253.247948
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 lock: same-process waits, timeout code, callback expiry and throw release
|
||||
ok 31 - C2-04 lock: same-process waits, timeout code, callback expiry and throw release
|
||||
---
|
||||
duration_ms: 5031.462795
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 lock: owner death releases the kernel lock without replacing its file
|
||||
ok 32 - C2-04 lock: owner death releases the kernel lock without replacing its file
|
||||
---
|
||||
duration_ms: 61.533295
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 lock: a missing flock binary becomes a handled refusal
|
||||
ok 33 - C2-04 lock: a missing flock binary becomes a handled refusal
|
||||
---
|
||||
duration_ms: 57.176644
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-04 lock: an unawaited scoped read drains before the lock is released
|
||||
ok 34 - C2-04 lock: an unawaited scoped read drains before the lock is released
|
||||
---
|
||||
duration_ms: 22.766874
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the fixture reads clean: every resolver step, appears_in and relationships wikilinks indexed
|
||||
ok 35 - the fixture reads clean: every resolver step, appears_in and relationships wikilinks indexed
|
||||
---
|
||||
duration_ms: 33.888061
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: R1: executables, symlinks, gitlinks, blobs over 1 MiB and non-UTF-8 text are not indexed
|
||||
ok 36 - R1: executables, symlinks, gitlinks, blobs over 1 MiB and non-UTF-8 text are not indexed
|
||||
---
|
||||
duration_ms: 68.951498
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: R2: unmapped paths are reported and not indexed
|
||||
ok 37 - R2: unmapped paths are reported and not indexed
|
||||
---
|
||||
duration_ms: 25.70771
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: R3: front matter not fully parsed stays raw, with the line where parsing stopped
|
||||
ok 38 - R3: front matter not fully parsed stays raw, with the line where parsing stopped
|
||||
---
|
||||
duration_ms: 26.059427
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: front matter forms the reader accepts and refuses
|
||||
ok 39 - front matter forms the reader accepts and refuses
|
||||
---
|
||||
duration_ms: 0.448293
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: R4: a link to no file, to more than one, or into another repo is reported and not followed
|
||||
ok 40 - R4: a link to no file, to more than one, or into another repo is reported and not followed
|
||||
---
|
||||
duration_ms: 26.225692
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a block list link carries its item line, a scalar or flow link its key line, and problems follow
|
||||
ok 41 - a block list link carries its item line, a scalar or flow link its key line, and problems follow
|
||||
---
|
||||
duration_ms: 22.565103
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: an unresolved attachment embed gives no problem; a link or front matter value to one is R4; a note embed resolves
|
||||
ok 42 - an unresolved attachment embed gives no problem; a link or front matter value to one is R4; a note embed resolves
|
||||
---
|
||||
duration_ms: 20.903777
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: an indexed Dr.Quinn.md resolves as a body link, a block list link and an embed
|
||||
ok 43 - an indexed Dr.Quinn.md resolves as a body link, a block list link and an embed
|
||||
---
|
||||
duration_ms: 25.42747
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: R5: a canon file that refers into the playground is reported, and the link still goes by path
|
||||
ok 44 - R5: a canon file that refers into the playground is reported, and the link still goes by path
|
||||
---
|
||||
duration_ms: 27.37119
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: R6: a canon file that refers into another universe is reported; a hybrid may refer into its sources
|
||||
ok 45 - R6: a canon file that refers into another universe is reported; a hybrid may refer into its sources
|
||||
---
|
||||
duration_ms: 30.585458
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: R7: two paths that differ only in case are both left out
|
||||
ok 46 - R7: two paths that differ only in case are both left out
|
||||
---
|
||||
duration_ms: 40.709509
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the reader reads the commit, never the working tree, and refuses a bad commit id
|
||||
ok 47 - the reader reads the commit, never the working tree, and refuses a bad commit id
|
||||
---
|
||||
duration_ms: 33.579454
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a bare mirror reads the same as the clone
|
||||
ok 48 - a bare mirror reads the same as the clone
|
||||
---
|
||||
duration_ms: 38.368686
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: free text renders as itself with no citations
|
||||
ok 49 - free text renders as itself with no citations
|
||||
---
|
||||
duration_ms: 1.571777
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a cited reply renders its text, then each cite with the badge from the check result
|
||||
ok 50 - a cited reply renders its text, then each cite with the badge from the check result
|
||||
---
|
||||
duration_ms: 0.537429
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a parsed body renders as its string does
|
||||
ok 51 - a parsed body renders as its string does
|
||||
---
|
||||
duration_ms: 0.304068
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: without a check result a path cite has no badge, no label and is never changed
|
||||
ok 52 - without a check result a path cite has no badge, no label and is never changed
|
||||
---
|
||||
duration_ms: 0.184363
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the label and the badge come from the check result only, never from a bad entry
|
||||
ok 53 - the label and the badge come from the check result only, never from a bad entry
|
||||
---
|
||||
duration_ms: 0.180581
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a web cite is a link only for https
|
||||
ok 54 - a web cite is a link only for https
|
||||
---
|
||||
duration_ms: 0.293669
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a write notice renders its fixed line
|
||||
ok 55 - a write notice renders its fixed line
|
||||
---
|
||||
duration_ms: 0.277197
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a body without the reply or notice shape is free text: the whole body, no citations
|
||||
ok 56 - a body without the reply or notice shape is free text: the whole body, no citations
|
||||
---
|
||||
duration_ms: 0.345807
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: an empty citations list is a reply with no cites
|
||||
ok 57 - an empty citations list is a reply with no cites
|
||||
---
|
||||
duration_ms: 0.187354
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-01c: each level gives its universe, and its book or null
|
||||
ok 58 - C2-01c: each level gives its universe, and its book or null
|
||||
---
|
||||
duration_ms: 3.363132
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-01c: prefixes come first: in a book that holds a prefix, a file outside it is canon and one under it playground
|
||||
ok 59 - C2-01c: prefixes come first: in a book that holds a prefix, a file outside it is canon and one under it playground
|
||||
---
|
||||
duration_ms: 0.480483
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-01c: a canon file linking into a draft gives R6, and into its own universe-level prefix gives R5
|
||||
ok 60 - C2-01c: a canon file linking into a draft gives R6, and into its own universe-level prefix gives R5
|
||||
---
|
||||
duration_ms: 44.606565
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the survey prints folder names, counts, key sets and link-form counts, and never text
|
||||
ok 61 - the survey prints folder names, counts, key sets and link-form counts, and never text
|
||||
---
|
||||
duration_ms: 37.28555
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: folder names print DEL, C1 and bidi controls, U+061C among them, as escapes
|
||||
ok 62 - folder names print DEL, C1 and bidi controls, U+061C among them, as escapes
|
||||
---
|
||||
duration_ms: 26.222951
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: an embed of an attachment counts as an embed and as an attachment; a plain link to one does not
|
||||
ok 63 - an embed of an attachment counts as an embed and as an attachment; a plain link to one does not
|
||||
---
|
||||
duration_ms: 26.23793
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: with --mapping the survey adds scope, resolver step and problem counts
|
||||
ok 64 - with --mapping the survey adds scope, resolver step and problem counts
|
||||
---
|
||||
duration_ms: 41.437066
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: survey exit codes: usage 4, bad mapping 3, unreadable repo 2
|
||||
ok 65 - survey exit codes: usage 4, bad mapping 3, unreadable repo 2
|
||||
---
|
||||
duration_ms: 17.463059
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: scripts/mosaic library survey reaches the survey
|
||||
ok 66 - scripts/mosaic library survey reaches the survey
|
||||
---
|
||||
duration_ms: 77.634947
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a argv: the fixed sequence, one https allow, no other protocol key
|
||||
ok 67 - C2-03a argv: the fixed sequence, one https allow, no other protocol key
|
||||
---
|
||||
duration_ms: 1.605597
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a argv: only an https URL with a plain host, no userinfo, and a plain user
|
||||
ok 68 - C2-03a argv: only an https URL with a plain host, no userinfo, and a plain user
|
||||
---
|
||||
duration_ms: 0.713147
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a helper: answers only the exact prompts for the configured host and user (dewey-0765)
|
||||
ok 69 - C2-03a helper: answers only the exact prompts for the configured host and user (dewey-0765)
|
||||
---
|
||||
duration_ms: 31.590474
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a first sync: served is the fetched tip, HEAD is served, the survey reads it, and the token stays in the slot
|
||||
ok 70 - C2-03a first sync: served is the fetched tip, HEAD is served, the survey reads it, and the token stays in the slot
|
||||
---
|
||||
duration_ms: 135.075159
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a fast-forward: served moves, problems are rebuilt, and a repeat changes only lastFetch
|
||||
ok 71 - C2-03a fast-forward: served moves, problems are rebuilt, and a repeat changes only lastFetch
|
||||
---
|
||||
duration_ms: 225.707972
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a Filbert N2: a read that took served before a sync still finds its objects after served moves
|
||||
ok 72 - C2-03a Filbert N2: a read that took served before a sync still finds its objects after served moves
|
||||
---
|
||||
duration_ms: 205.10431
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a overlap: a reader during a sync sees the old pair or the new one, never a mix
|
||||
ok 73 - C2-03a overlap: a reader during a sync sees the old pair or the new one, never a mix
|
||||
---
|
||||
duration_ms: 175.907929
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a diverged: a non-fast-forward keeps serving and holds until a human accepts the tip
|
||||
ok 74 - C2-03a diverged: a non-fast-forward keeps serving and holds until a human accepts the tip
|
||||
---
|
||||
duration_ms: 431.553812
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a accept starts the record over, so a changed branch gets a fresh state
|
||||
ok 75 - C2-03a accept starts the record over, so a changed branch gets a fresh state
|
||||
---
|
||||
duration_ms: 195.011432
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a fetch failure: a wrong token keeps serving and records the error, lastFetch unchanged
|
||||
ok 76 - C2-03a fetch failure: a wrong token keeps serving and records the error, lastFetch unchanged
|
||||
---
|
||||
duration_ms: 192.898644
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a a failed first fetch records the error with nothing served
|
||||
ok 77 - C2-03a a failed first fetch records the error with nothing served
|
||||
---
|
||||
duration_ms: 61.594695
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a a 302 to another host fails the fetch and the other host sees nothing
|
||||
ok 78 - C2-03a a 302 to another host fails the fetch and the other host sees nothing
|
||||
---
|
||||
duration_ms: 64.82991
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a the slot: missing or unsafe refuses before git, and sync never opens it
|
||||
ok 79 - C2-03a the slot: missing or unsafe refuses before git, and sync never opens it
|
||||
---
|
||||
duration_ms: 59.167725
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a sage-2021: an entry with no user refuses library-remote-invalid and runs no git
|
||||
ok 80 - C2-03a sage-2021: an entry with no user refuses library-remote-invalid and runs no git
|
||||
---
|
||||
duration_ms: 35.37205
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: C2-03a one sync per mirror: an overlapping call refuses library-sync-busy
|
||||
ok 81 - C2-03a one sync per mirror: an overlapping call refuses library-sync-busy
|
||||
---
|
||||
duration_ms: 118.260687
|
||||
type: 'test'
|
||||
...
|
||||
1..81
|
||||
# tests 81
|
||||
# suites 0
|
||||
# pass 81
|
||||
# fail 0
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 9149.325891
|
||||
@@ -0,0 +1,48 @@
|
||||
✔ chat replies: free text, cites with badges, the agent label, changed since and safe links (633.807074ms)
|
||||
✔ chat replies: a write notice reads as its line with a Revert; a refused revert shows its code (621.95095ms)
|
||||
✔ chat replies: a read-only Console shows the notice with Revert disabled (577.638161ms)
|
||||
✔ chat status line: served commit and age, divergence, fetch error and the problems one click away (555.847899ms)
|
||||
✖ chat status line: limits when the status carries them, no problems, and refusals (3725.696272ms)
|
||||
✔ chat status line: a project with no repository link reads no library status (657.572856ms)
|
||||
✔ chat status line: unreadable reply limits show their problem and both fallback keys (663.163445ms)
|
||||
✔ chat replies: unchanged file at a different library commit and incomplete checks stay unmarked (616.184063ms)
|
||||
✖ chat status line: an invalid library mapping remains visible for diagnosis (597.976623ms)
|
||||
ℹ tests 9
|
||||
ℹ suites 0
|
||||
ℹ pass 7
|
||||
ℹ fail 2
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 8782.679569
|
||||
|
||||
✖ failing tests:
|
||||
|
||||
test at packages/webui/tests/chat-replies-browser.test.mjs:152:1
|
||||
✖ chat status line: limits when the status carries them, no problems, and refusals (3725.696272ms)
|
||||
Error: Uncaught (in promise) Error: window.__statusReads.length && document.querySelector(".chat-conversation") && document.querySelector(".chat-library")?.textContent==="Library status unavailable (library-mapping-invalid).": undefined
|
||||
at Object.evaluate (file:///home/jwoltje/.t3/worktrees/mosaic-stack/fethry-row225/packages/webui/tests/browser.mjs:49:35)
|
||||
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
at async TestContext.<anonymous> (file:///home/jwoltje/.t3/worktrees/mosaic-stack/fethry-row225/packages/webui/tests/chat-replies-browser.test.mjs:162:5)
|
||||
at async Test.run (node:internal/test_runner/test:1409:7)
|
||||
at async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
|
||||
test at packages/webui/tests/chat-replies-browser.test.mjs:200:1
|
||||
✖ chat status line: an invalid library mapping remains visible for diagnosis (597.976623ms)
|
||||
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
|
||||
+ actual - expected
|
||||
|
||||
+ null
|
||||
- 'Library status unavailable (library-mapping-invalid).'
|
||||
|
||||
at TestContext.<anonymous> (file:///home/jwoltje/.t3/worktrees/mosaic-stack/fethry-row225/packages/webui/tests/chat-replies-browser.test.mjs:203:10)
|
||||
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
at async Test.run (node:internal/test_runner/test:1409:7)
|
||||
at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
|
||||
generatedMessage: true,
|
||||
code: 'ERR_ASSERTION',
|
||||
actual: null,
|
||||
expected: 'Library status unavailable (library-mapping-invalid).',
|
||||
operator: 'strictEqual',
|
||||
diff: 'simple'
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{"mutant": "M1-badges", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants/M1-badges.tap"}
|
||||
{"mutant": "M1-agent-label", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants/M1-agent-label.tap"}
|
||||
{"mutant": "M2-http-links", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants/M2-http-links.tap"}
|
||||
{"mutant": "M3-wrong-commit", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": false, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants/M3-wrong-commit.tap"}
|
||||
@@ -0,0 +1,192 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
not ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 627.180675
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-9ui_vkk0/M1-agent-label/packages/webui/tests/chat-replies-browser.test.mjs:81:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly deep-equal:
|
||||
+ actual - expected
|
||||
... Skipped lines
|
||||
|
||||
[
|
||||
{
|
||||
agent: null,
|
||||
badge: 'canon',
|
||||
changed: false,
|
||||
...
|
||||
{
|
||||
+ agent: null,
|
||||
- agent: 'agent-written: acme/scribe',
|
||||
badge: 'supporting',
|
||||
changed: false,
|
||||
href: null,
|
||||
quote: 'green eyes',
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa',
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected:
|
||||
0:
|
||||
badge: 'canon'
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: 'playground'
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: 'supporting'
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: 'agent-written: acme/scribe'
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
actual:
|
||||
0:
|
||||
badge: 'canon'
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: 'playground'
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: 'supporting'
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
operator: 'deepStrictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-9ui_vkk0/M1-agent-label/packages/webui/tests/chat-replies-browser.test.mjs:90:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3)
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 778.572201
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 641.728604
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 629.327348
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 837.886073
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 613.037186
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 651.026507
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 735.546636
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 712.174542
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 8
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 6353.090574
|
||||
@@ -0,0 +1,206 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
not ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 638.589537
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-9ui_vkk0/M1-badges/packages/webui/tests/chat-replies-browser.test.mjs:81:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly deep-equal:
|
||||
+ actual - expected
|
||||
... Skipped lines
|
||||
|
||||
[
|
||||
{
|
||||
agent: null,
|
||||
+ badge: null,
|
||||
- badge: 'canon',
|
||||
changed: false,
|
||||
href: null,
|
||||
quote: 'her grey eyes',
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa',
|
||||
rel: null
|
||||
...
|
||||
agent: null,
|
||||
+ badge: null,
|
||||
- badge: 'playground',
|
||||
changed: true,
|
||||
href: null,
|
||||
quote: 'a storm',
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa',
|
||||
rel: null
|
||||
...
|
||||
agent: 'agent-written: acme/scribe',
|
||||
+ badge: null,
|
||||
- badge: 'supporting',
|
||||
changed: false,
|
||||
href: null,
|
||||
quote: 'green eyes',
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa',
|
||||
rel: null
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected:
|
||||
0:
|
||||
badge: 'canon'
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: 'playground'
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: 'supporting'
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: 'agent-written: acme/scribe'
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
actual:
|
||||
0:
|
||||
badge: ~
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: ~
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: ~
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: 'agent-written: acme/scribe'
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
operator: 'deepStrictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-9ui_vkk0/M1-badges/packages/webui/tests/chat-replies-browser.test.mjs:90:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3)
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 770.070531
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 519.328288
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 647.667301
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 999.237447
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 676.088845
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 634.472637
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 655.963182
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 578.819646
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 8
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 6239.022812
|
||||
@@ -0,0 +1,204 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
not ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 655.901619
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-9ui_vkk0/M2-http-links/packages/webui/tests/chat-replies-browser.test.mjs:81:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly deep-equal:
|
||||
+ actual - expected
|
||||
... Skipped lines
|
||||
|
||||
[
|
||||
{
|
||||
agent: null,
|
||||
badge: 'canon',
|
||||
changed: false,
|
||||
...
|
||||
changed: false,
|
||||
+ href: 'http://example.invalid/plain',
|
||||
- href: null,
|
||||
quote: 'plain http',
|
||||
ref: 'http://example.invalid/plain',
|
||||
+ rel: 'noopener noreferrer'
|
||||
- rel: null
|
||||
},
|
||||
{
|
||||
agent: null,
|
||||
badge: 'web',
|
||||
changed: false,
|
||||
+ href: 'javascript:window.injected=2',
|
||||
- href: null,
|
||||
quote: 'script',
|
||||
ref: 'javascript:window.injected=2',
|
||||
+ rel: 'noopener noreferrer'
|
||||
- rel: null
|
||||
}
|
||||
]
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected:
|
||||
0:
|
||||
badge: 'canon'
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: 'playground'
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: 'supporting'
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: 'agent-written: acme/scribe'
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
actual:
|
||||
0:
|
||||
badge: 'canon'
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: 'playground'
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: 'supporting'
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: 'agent-written: acme/scribe'
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: 'http://example.invalid/plain'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: 'javascript:window.injected=2'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
operator: 'deepStrictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-9ui_vkk0/M2-http-links/packages/webui/tests/chat-replies-browser.test.mjs:90:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3)
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 741.122544
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 616.728572
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 625.818493
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 867.033773
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 655.587703
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 615.997516
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 648.263681
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 624.323397
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 8
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 6168.633364
|
||||
@@ -0,0 +1,74 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 640.32042
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 694.233373
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 611.500508
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 606.581119
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 896.462474
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 666.798177
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 629.105559
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
not ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 3654.057789
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-9ui_vkk0/M3-wrong-commit/packages/webui/tests/chat-replies-browser.test.mjs:184:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: 'Uncaught (in promise) Error: document.querySelectorAll(".chat-changed").length===0: undefined'
|
||||
code: 'ERR_TEST_FAILURE'
|
||||
stack: |-
|
||||
Object.evaluate (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-9ui_vkk0/M3-wrong-commit/packages/webui/tests/browser.mjs:49:35)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-9ui_vkk0/M3-wrong-commit/packages/webui/tests/chat-replies-browser.test.mjs:195:3)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 656.44095
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 8
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 9179.328916
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"head": "77172ce3b46eb289409068518b7022fc7be47ebe",
|
||||
"clear": "sage-3647",
|
||||
"worktreeUnchanged": true,
|
||||
"results": [
|
||||
{
|
||||
"mutant": "M1-badges",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants/M1-badges.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M1-agent-label",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants/M1-agent-label.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M2-http-links",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants/M2-http-links.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M3-wrong-commit",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": false,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants/M3-wrong-commit.tap"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{"mutant": "M1-badges", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M1-badges.tap"}
|
||||
{"mutant": "M1-agent-label", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M1-agent-label.tap"}
|
||||
{"mutant": "M2-http-links", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M2-http-links.tap"}
|
||||
{"mutant": "M3-wrong-commit", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M3-wrong-commit.tap"}
|
||||
{"mutant": "M3-missing-file", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M3-missing-file.tap"}
|
||||
{"mutant": "M4-fallback", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M4-fallback.tap"}
|
||||
{"mutant": "M4-problem", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/chat-replies-browser.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M4-problem.tap"}
|
||||
{"mutant": "M5-send", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/library-routes.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M5-send.tap"}
|
||||
{"mutant": "M5-project-receipt", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/library-routes.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M5-project-receipt.tap"}
|
||||
{"mutant": "M5-commit-input", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/library-routes.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M5-commit-input.tap"}
|
||||
{"mutant": "M5-origin", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/library-routes.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M5-origin.tap"}
|
||||
{"mutant": "M5-fetch-metadata", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/library-routes.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M5-fetch-metadata.tap"}
|
||||
{"mutant": "M6-duplicate-call", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/library-routes.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M6-duplicate-call.tap"}
|
||||
{"mutant": "M7-user-fence", "anchorHits": 1, "restored": true, "worktreeUnchanged": true, "exit": 1, "killed": true, "test": "packages/webui/tests/library-routes.test.mjs", "log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M7-user-fence.tap"}
|
||||
@@ -0,0 +1,192 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
not ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 646.851404
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M1-agent-label/packages/webui/tests/chat-replies-browser.test.mjs:81:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly deep-equal:
|
||||
+ actual - expected
|
||||
... Skipped lines
|
||||
|
||||
[
|
||||
{
|
||||
agent: null,
|
||||
badge: 'canon',
|
||||
changed: false,
|
||||
...
|
||||
{
|
||||
+ agent: null,
|
||||
- agent: 'agent-written: acme/scribe',
|
||||
badge: 'supporting',
|
||||
changed: false,
|
||||
href: null,
|
||||
quote: 'green eyes',
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa',
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected:
|
||||
0:
|
||||
badge: 'canon'
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: 'playground'
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: 'supporting'
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: 'agent-written: acme/scribe'
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
actual:
|
||||
0:
|
||||
badge: 'canon'
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: 'playground'
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: 'supporting'
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
operator: 'deepStrictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M1-agent-label/packages/webui/tests/chat-replies-browser.test.mjs:90:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3)
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 667.90945
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 588.346681
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 485.882289
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 709.847041
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 544.885551
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 514.410016
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 542.746154
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 582.608663
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 8
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 5409.980177
|
||||
@@ -0,0 +1,206 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
not ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 621.562133
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M1-badges/packages/webui/tests/chat-replies-browser.test.mjs:81:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly deep-equal:
|
||||
+ actual - expected
|
||||
... Skipped lines
|
||||
|
||||
[
|
||||
{
|
||||
agent: null,
|
||||
+ badge: null,
|
||||
- badge: 'canon',
|
||||
changed: false,
|
||||
href: null,
|
||||
quote: 'her grey eyes',
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa',
|
||||
rel: null
|
||||
...
|
||||
agent: null,
|
||||
+ badge: null,
|
||||
- badge: 'playground',
|
||||
changed: true,
|
||||
href: null,
|
||||
quote: 'a storm',
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa',
|
||||
rel: null
|
||||
...
|
||||
agent: 'agent-written: acme/scribe',
|
||||
+ badge: null,
|
||||
- badge: 'supporting',
|
||||
changed: false,
|
||||
href: null,
|
||||
quote: 'green eyes',
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa',
|
||||
rel: null
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected:
|
||||
0:
|
||||
badge: 'canon'
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: 'playground'
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: 'supporting'
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: 'agent-written: acme/scribe'
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
actual:
|
||||
0:
|
||||
badge: ~
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: ~
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: ~
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: 'agent-written: acme/scribe'
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
operator: 'deepStrictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M1-badges/packages/webui/tests/chat-replies-browser.test.mjs:90:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3)
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 731.101767
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 633.163696
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 637.761161
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 847.929653
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 635.512979
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 645.427688
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 672.272209
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 629.043251
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 8
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 6169.954716
|
||||
@@ -0,0 +1,204 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
not ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 582.248796
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M2-http-links/packages/webui/tests/chat-replies-browser.test.mjs:81:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly deep-equal:
|
||||
+ actual - expected
|
||||
... Skipped lines
|
||||
|
||||
[
|
||||
{
|
||||
agent: null,
|
||||
badge: 'canon',
|
||||
changed: false,
|
||||
...
|
||||
changed: false,
|
||||
+ href: 'http://example.invalid/plain',
|
||||
- href: null,
|
||||
quote: 'plain http',
|
||||
ref: 'http://example.invalid/plain',
|
||||
+ rel: 'noopener noreferrer'
|
||||
- rel: null
|
||||
},
|
||||
{
|
||||
agent: null,
|
||||
badge: 'web',
|
||||
changed: false,
|
||||
+ href: 'javascript:window.injected=2',
|
||||
- href: null,
|
||||
quote: 'script',
|
||||
ref: 'javascript:window.injected=2',
|
||||
+ rel: 'noopener noreferrer'
|
||||
- rel: null
|
||||
}
|
||||
]
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected:
|
||||
0:
|
||||
badge: 'canon'
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: 'playground'
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: 'supporting'
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: 'agent-written: acme/scribe'
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
actual:
|
||||
0:
|
||||
badge: 'canon'
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'her grey eyes'
|
||||
agent: ~
|
||||
changed: false
|
||||
1:
|
||||
badge: 'playground'
|
||||
ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'a storm'
|
||||
agent: ~
|
||||
changed: true
|
||||
2:
|
||||
badge: 'supporting'
|
||||
ref: 'Notes/Eyes.md:9-10 @aaaaaaa'
|
||||
href: ~
|
||||
rel: ~
|
||||
quote: 'green eyes'
|
||||
agent: 'agent-written: acme/scribe'
|
||||
changed: false
|
||||
3:
|
||||
badge: 'web'
|
||||
ref: 'https://example.invalid/tides'
|
||||
href: 'https://example.invalid/tides'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'spring tides'
|
||||
agent: ~
|
||||
changed: false
|
||||
4:
|
||||
badge: 'web'
|
||||
ref: 'http://example.invalid/plain'
|
||||
href: 'http://example.invalid/plain'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'plain http'
|
||||
agent: ~
|
||||
changed: false
|
||||
5:
|
||||
badge: 'web'
|
||||
ref: 'javascript:window.injected=2'
|
||||
href: 'javascript:window.injected=2'
|
||||
rel: 'noopener noreferrer'
|
||||
quote: 'script'
|
||||
agent: ~
|
||||
changed: false
|
||||
operator: 'deepStrictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M2-http-links/packages/webui/tests/chat-replies-browser.test.mjs:90:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3)
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 640.769563
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 572.506418
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 519.031091
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 743.513043
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 676.282756
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 595.166769
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 626.475981
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 596.828198
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 8
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 5658.889854
|
||||
@@ -0,0 +1,81 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 639.027823
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 693.772757
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 683.094789
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 637.029355
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 772.100011
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 599.342035
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 574.320042
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
not ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 621.466015
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M3-missing-file/packages/webui/tests/chat-replies-browser.test.mjs:184:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly equal:
|
||||
|
||||
1 !== 0
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 0
|
||||
actual: 1
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M3-missing-file/packages/webui/tests/chat-replies-browser.test.mjs:196:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 590.165121
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 8
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 5921.651346
|
||||
@@ -0,0 +1,81 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 704.141588
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 816.229452
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 697.826745
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 638.579753
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 850.914117
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 634.004327
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 585.469632
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
not ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 673.386968
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M3-wrong-commit/packages/webui/tests/chat-replies-browser.test.mjs:184:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly equal:
|
||||
|
||||
1 !== 0
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 0
|
||||
actual: 1
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M3-wrong-commit/packages/webui/tests/chat-replies-browser.test.mjs:196:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 579.53998
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 8
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 6292.579267
|
||||
@@ -0,0 +1,102 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 683.334532
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 686.685624
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 612.757087
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 584.651483
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
not ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 637.405759
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M4-fallback/packages/webui/tests/chat-replies-browser.test.mjs:152:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly equal:
|
||||
+ actual - expected
|
||||
|
||||
+ 'Library at ccccccc · fetched 5 min ago · citations required, up to 4 per reply · no problems'
|
||||
- 'Library at ccccccc · fetched 5 min ago · citations required, up to 4 per reply · limits fell back: citationsPerReply · no problems'
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 'Library at ccccccc · fetched 5 min ago · citations required, up to 4 per reply · limits fell back: citationsPerReply · no problems'
|
||||
actual: 'Library at ccccccc · fetched 5 min ago · citations required, up to 4 per reply · no problems'
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M4-fallback/packages/webui/tests/chat-replies-browser.test.mjs:156:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 626.790802
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
not ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 643.680732
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M4-fallback/packages/webui/tests/chat-replies-browser.test.mjs:173:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly equal:
|
||||
+ actual - expected
|
||||
|
||||
+ 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · reply-limits-unreadable · no problems'
|
||||
- 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · limits fell back: requireCitation, citationsPerReply · reply-limits-unreadable · no problems'
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · limits fell back: requireCitation, citationsPerReply · reply-limits-unreadable · no problems'
|
||||
actual: 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · reply-limits-unreadable · no problems'
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M4-fallback/packages/webui/tests/chat-replies-browser.test.mjs:179:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 645.032205
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 616.242947
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 7
|
||||
# fail 2
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 5845.226677
|
||||
@@ -0,0 +1,83 @@
|
||||
TAP version 13
|
||||
# Subtest: chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
ok 1 - chat replies: free text, cites with badges, the agent label, changed since and safe links
|
||||
---
|
||||
duration_ms: 663.005514
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
ok 2 - chat replies: a write notice reads as its line with a Revert; a refused revert shows its code
|
||||
---
|
||||
duration_ms: 662.360161
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat replies: a read-only Console shows the notice with Revert disabled
|
||||
ok 3 - chat replies: a read-only Console shows the notice with Revert disabled
|
||||
---
|
||||
duration_ms: 620.68694
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
ok 4 - chat status line: served commit and age, divergence, fetch error and the problems one click away
|
||||
---
|
||||
duration_ms: 744.825035
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: limits when the status carries them, no problems, and refusals
|
||||
ok 5 - chat status line: limits when the status carries them, no problems, and refusals
|
||||
---
|
||||
duration_ms: 826.418848
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: a project with no repository link reads no library status
|
||||
ok 6 - chat status line: a project with no repository link reads no library status
|
||||
---
|
||||
duration_ms: 549.365993
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
not ok 7 - chat status line: unreadable reply limits show their problem and both fallback keys
|
||||
---
|
||||
duration_ms: 589.776762
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M4-problem/packages/webui/tests/chat-replies-browser.test.mjs:173:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly equal:
|
||||
+ actual - expected
|
||||
|
||||
+ 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · limits fell back: requireCitation, citationsPerReply · no problems'
|
||||
- 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · limits fell back: requireCitation, citationsPerReply · reply-limits-unreadable · no problems'
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · limits fell back: requireCitation, citationsPerReply · reply-limits-unreadable · no problems'
|
||||
actual: 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · limits fell back: requireCitation, citationsPerReply · no problems'
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M4-problem/packages/webui/tests/chat-replies-browser.test.mjs:179:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
ok 8 - chat replies: unchanged file at a different library commit and incomplete checks stay unmarked
|
||||
---
|
||||
duration_ms: 590.919434
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: chat status line: an invalid library mapping remains visible for diagnosis
|
||||
ok 9 - chat status line: an invalid library mapping remains visible for diagnosis
|
||||
---
|
||||
duration_ms: 545.326381
|
||||
type: 'test'
|
||||
...
|
||||
1..9
|
||||
# tests 9
|
||||
# suites 0
|
||||
# pass 8
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 5914.325706
|
||||
@@ -0,0 +1,105 @@
|
||||
TAP version 13
|
||||
# Subtest: a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
ok 1 - a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
---
|
||||
duration_ms: 16.128237
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
ok 2 - a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
---
|
||||
duration_ms: 5.987607
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
not ok 3 - a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
---
|
||||
duration_ms: 4.805637
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M5-commit-input/packages/webui/tests/library-routes.test.mjs:64:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
{"project":"books","commit":"abc"}
|
||||
|
||||
200 !== 400
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 400
|
||||
actual: 200
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M5-commit-input/packages/webui/tests/library-routes.test.mjs:69:12)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
ok 4 - a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
---
|
||||
duration_ms: 6.383811
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
ok 5 - a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
---
|
||||
duration_ms: 4.000988
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read takes one project query and answers the bus result for that project
|
||||
ok 6 - the status read takes one project query and answers the bus result for that project
|
||||
---
|
||||
duration_ms: 2.487122
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
ok 7 - a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
---
|
||||
duration_ms: 4.9292
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read needs no send; a read-only Console still has no revert
|
||||
ok 8 - the status read needs no send; a read-only Console still has no revert
|
||||
---
|
||||
duration_ms: 1.266317
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
ok 9 - library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
---
|
||||
duration_ms: 0.443059
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
ok 10 - the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
---
|
||||
duration_ms: 1.048018
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert receipt for another project is unknown and is never retried
|
||||
ok 11 - a revert receipt for another project is unknown and is never retried
|
||||
---
|
||||
duration_ms: 0.864934
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a granted-user HTTP session cannot reach owner library callbacks
|
||||
ok 12 - a granted-user HTTP session cannot reach owner library callbacks
|
||||
---
|
||||
duration_ms: 1.064626
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a configured revert callback remains unreachable when send is off
|
||||
ok 13 - a configured revert callback remains unreachable when send is off
|
||||
---
|
||||
duration_ms: 0.803048
|
||||
type: 'test'
|
||||
...
|
||||
1..13
|
||||
# tests 13
|
||||
# suites 0
|
||||
# pass 12
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 153.3549
|
||||
@@ -0,0 +1,105 @@
|
||||
TAP version 13
|
||||
# Subtest: a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
ok 1 - a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
---
|
||||
duration_ms: 20.271342
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
not ok 2 - a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
---
|
||||
duration_ms: 5.700968
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M5-fetch-metadata/packages/webui/tests/library-routes.test.mjs:48:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
sec-fetch-site
|
||||
|
||||
200 !== 403
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 403
|
||||
actual: 200
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M5-fetch-metadata/packages/webui/tests/library-routes.test.mjs:57:12)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
ok 3 - a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
---
|
||||
duration_ms: 6.427935
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
ok 4 - a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
---
|
||||
duration_ms: 7.39929
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
ok 5 - a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
---
|
||||
duration_ms: 5.425467
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read takes one project query and answers the bus result for that project
|
||||
ok 6 - the status read takes one project query and answers the bus result for that project
|
||||
---
|
||||
duration_ms: 2.634037
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
ok 7 - a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
---
|
||||
duration_ms: 5.727409
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read needs no send; a read-only Console still has no revert
|
||||
ok 8 - the status read needs no send; a read-only Console still has no revert
|
||||
---
|
||||
duration_ms: 1.317954
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
ok 9 - library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
---
|
||||
duration_ms: 0.583799
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
ok 10 - the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
---
|
||||
duration_ms: 1.207375
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert receipt for another project is unknown and is never retried
|
||||
ok 11 - a revert receipt for another project is unknown and is never retried
|
||||
---
|
||||
duration_ms: 0.956772
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a granted-user HTTP session cannot reach owner library callbacks
|
||||
ok 12 - a granted-user HTTP session cannot reach owner library callbacks
|
||||
---
|
||||
duration_ms: 1.147745
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a configured revert callback remains unreachable when send is off
|
||||
ok 13 - a configured revert callback remains unreachable when send is off
|
||||
---
|
||||
duration_ms: 0.819337
|
||||
type: 'test'
|
||||
...
|
||||
1..13
|
||||
# tests 13
|
||||
# suites 0
|
||||
# pass 12
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 166.134058
|
||||
@@ -0,0 +1,105 @@
|
||||
TAP version 13
|
||||
# Subtest: a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
ok 1 - a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
---
|
||||
duration_ms: 16.249491
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
not ok 2 - a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
---
|
||||
duration_ms: 5.463985
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M5-origin/packages/webui/tests/library-routes.test.mjs:48:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
origin
|
||||
|
||||
200 !== 403
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 403
|
||||
actual: 200
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M5-origin/packages/webui/tests/library-routes.test.mjs:57:12)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
ok 3 - a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
---
|
||||
duration_ms: 6.035196
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
ok 4 - a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
---
|
||||
duration_ms: 5.621744
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
ok 5 - a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
---
|
||||
duration_ms: 4.928333
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read takes one project query and answers the bus result for that project
|
||||
ok 6 - the status read takes one project query and answers the bus result for that project
|
||||
---
|
||||
duration_ms: 2.455282
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
ok 7 - a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
---
|
||||
duration_ms: 4.838747
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read needs no send; a read-only Console still has no revert
|
||||
ok 8 - the status read needs no send; a read-only Console still has no revert
|
||||
---
|
||||
duration_ms: 1.235209
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
ok 9 - library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
---
|
||||
duration_ms: 0.436399
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
ok 10 - the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
---
|
||||
duration_ms: 1.100574
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert receipt for another project is unknown and is never retried
|
||||
ok 11 - a revert receipt for another project is unknown and is never retried
|
||||
---
|
||||
duration_ms: 0.943474
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a granted-user HTTP session cannot reach owner library callbacks
|
||||
ok 12 - a granted-user HTTP session cannot reach owner library callbacks
|
||||
---
|
||||
duration_ms: 1.176957
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a configured revert callback remains unreachable when send is off
|
||||
ok 13 - a configured revert callback remains unreachable when send is off
|
||||
---
|
||||
duration_ms: 0.861834
|
||||
type: 'test'
|
||||
...
|
||||
1..13
|
||||
# tests 13
|
||||
# suites 0
|
||||
# pass 12
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 150.969641
|
||||
@@ -0,0 +1,105 @@
|
||||
TAP version 13
|
||||
# Subtest: a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
ok 1 - a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
---
|
||||
duration_ms: 18.918199
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
ok 2 - a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
---
|
||||
duration_ms: 7.26916
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
ok 3 - a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
---
|
||||
duration_ms: 5.352342
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
ok 4 - a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
---
|
||||
duration_ms: 6.134713
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
ok 5 - a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
---
|
||||
duration_ms: 4.288914
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read takes one project query and answers the bus result for that project
|
||||
ok 6 - the status read takes one project query and answers the bus result for that project
|
||||
---
|
||||
duration_ms: 2.745385
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
ok 7 - a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
---
|
||||
duration_ms: 5.739155
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read needs no send; a read-only Console still has no revert
|
||||
ok 8 - the status read needs no send; a read-only Console still has no revert
|
||||
---
|
||||
duration_ms: 1.264793
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
ok 9 - library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
---
|
||||
duration_ms: 0.471965
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
ok 10 - the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
---
|
||||
duration_ms: 1.045204
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert receipt for another project is unknown and is never retried
|
||||
not ok 11 - a revert receipt for another project is unknown and is never retried
|
||||
---
|
||||
duration_ms: 1.531252
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M5-project-receipt/packages/webui/tests/library-routes.test.mjs:145:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly equal:
|
||||
|
||||
200 !== 503
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 503
|
||||
actual: 200
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M5-project-receipt/packages/webui/tests/library-routes.test.mjs:148:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: a granted-user HTTP session cannot reach owner library callbacks
|
||||
ok 12 - a granted-user HTTP session cannot reach owner library callbacks
|
||||
---
|
||||
duration_ms: 1.60161
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a configured revert callback remains unreachable when send is off
|
||||
ok 13 - a configured revert callback remains unreachable when send is off
|
||||
---
|
||||
duration_ms: 0.816068
|
||||
type: 'test'
|
||||
...
|
||||
1..13
|
||||
# tests 13
|
||||
# suites 0
|
||||
# pass 12
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 171.289003
|
||||
@@ -0,0 +1,106 @@
|
||||
TAP version 13
|
||||
# Subtest: a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
ok 1 - a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
---
|
||||
duration_ms: 18.930067
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
ok 2 - a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
---
|
||||
duration_ms: 7.470645
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
ok 3 - a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
---
|
||||
duration_ms: 6.646929
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
ok 4 - a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
---
|
||||
duration_ms: 6.637697
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
ok 5 - a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
---
|
||||
duration_ms: 4.174441
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read takes one project query and answers the bus result for that project
|
||||
ok 6 - the status read takes one project query and answers the bus result for that project
|
||||
---
|
||||
duration_ms: 2.513131
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
ok 7 - a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
---
|
||||
duration_ms: 5.145692
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read needs no send; a read-only Console still has no revert
|
||||
ok 8 - the status read needs no send; a read-only Console still has no revert
|
||||
---
|
||||
duration_ms: 1.182362
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
ok 9 - library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
---
|
||||
duration_ms: 0.471806
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
ok 10 - the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
---
|
||||
duration_ms: 1.064814
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert receipt for another project is unknown and is never retried
|
||||
ok 11 - a revert receipt for another project is unknown and is never retried
|
||||
---
|
||||
duration_ms: 0.910004
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a granted-user HTTP session cannot reach owner library callbacks
|
||||
ok 12 - a granted-user HTTP session cannot reach owner library callbacks
|
||||
---
|
||||
duration_ms: 1.16191
|
||||
type: 'test'
|
||||
...
|
||||
# 2026-10-23T19:28:51.488Z library-revert user="jason" project="books" commit="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" commit=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||
# Subtest: a configured revert callback remains unreachable when send is off
|
||||
not ok 13 - a configured revert callback remains unreachable when send is off
|
||||
---
|
||||
duration_ms: 1.624909
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M5-send/packages/webui/tests/library-routes.test.mjs:175:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly equal:
|
||||
|
||||
200 !== 403
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 403
|
||||
actual: 200
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M5-send/packages/webui/tests/library-routes.test.mjs:181:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
1..13
|
||||
# tests 13
|
||||
# suites 0
|
||||
# pass 12
|
||||
# fail 1
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 165.919088
|
||||
@@ -0,0 +1,177 @@
|
||||
TAP version 13
|
||||
# Subtest: a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
not ok 1 - a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
---
|
||||
duration_ms: 17.922489
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M6-duplicate-call/packages/webui/tests/library-routes.test.mjs:40:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly deep-equal:
|
||||
+ actual - expected
|
||||
|
||||
[
|
||||
{
|
||||
commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
||||
project: 'books'
|
||||
},
|
||||
+ {
|
||||
+ commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
||||
+ project: 'books'
|
||||
+ }
|
||||
]
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected:
|
||||
0:
|
||||
project: 'books'
|
||||
commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||
actual:
|
||||
0:
|
||||
project: 'books'
|
||||
commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||
1:
|
||||
project: 'books'
|
||||
commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||
operator: 'deepStrictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M6-duplicate-call/packages/webui/tests/library-routes.test.mjs:43:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3)
|
||||
...
|
||||
# Subtest: a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
ok 2 - a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
---
|
||||
duration_ms: 7.053366
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
ok 3 - a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
---
|
||||
duration_ms: 5.869486
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
ok 4 - a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
---
|
||||
duration_ms: 6.852952
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
not ok 5 - a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
---
|
||||
duration_ms: 2.870452
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M6-duplicate-call/packages/webui/tests/library-routes.test.mjs:88:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly equal:
|
||||
|
||||
2 !== 1
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 1
|
||||
actual: 2
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M6-duplicate-call/packages/webui/tests/library-routes.test.mjs:96:12)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: the status read takes one project query and answers the bus result for that project
|
||||
ok 6 - the status read takes one project query and answers the bus result for that project
|
||||
---
|
||||
duration_ms: 2.904694
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
ok 7 - a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
---
|
||||
duration_ms: 5.7962
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read needs no send; a read-only Console still has no revert
|
||||
ok 8 - the status read needs no send; a read-only Console still has no revert
|
||||
---
|
||||
duration_ms: 1.518332
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
ok 9 - library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
---
|
||||
duration_ms: 0.563294
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
ok 10 - the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
---
|
||||
duration_ms: 1.17446
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert receipt for another project is unknown and is never retried
|
||||
not ok 11 - a revert receipt for another project is unknown and is never retried
|
||||
---
|
||||
duration_ms: 1.258633
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M6-duplicate-call/packages/webui/tests/library-routes.test.mjs:145:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly deep-equal:
|
||||
+ actual - expected
|
||||
|
||||
[
|
||||
{
|
||||
commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
||||
project: 'books'
|
||||
},
|
||||
+ {
|
||||
+ commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
||||
+ project: 'books'
|
||||
+ }
|
||||
]
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected:
|
||||
0:
|
||||
project: 'books'
|
||||
commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||
actual:
|
||||
0:
|
||||
project: 'books'
|
||||
commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||
1:
|
||||
project: 'books'
|
||||
commit: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||
operator: 'deepStrictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M6-duplicate-call/packages/webui/tests/library-routes.test.mjs:151:10)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: a granted-user HTTP session cannot reach owner library callbacks
|
||||
ok 12 - a granted-user HTTP session cannot reach owner library callbacks
|
||||
---
|
||||
duration_ms: 1.362877
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a configured revert callback remains unreachable when send is off
|
||||
ok 13 - a configured revert callback remains unreachable when send is off
|
||||
---
|
||||
duration_ms: 0.848309
|
||||
type: 'test'
|
||||
...
|
||||
1..13
|
||||
# tests 13
|
||||
# suites 0
|
||||
# pass 10
|
||||
# fail 3
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 169.162917
|
||||
@@ -0,0 +1,126 @@
|
||||
TAP version 13
|
||||
# Subtest: a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
ok 1 - a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
---
|
||||
duration_ms: 18.215173
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
ok 2 - a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
---
|
||||
duration_ms: 6.416847
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
ok 3 - a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
---
|
||||
duration_ms: 5.529629
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
ok 4 - a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
---
|
||||
duration_ms: 6.92431
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
ok 5 - a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
---
|
||||
duration_ms: 4.588509
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read takes one project query and answers the bus result for that project
|
||||
ok 6 - the status read takes one project query and answers the bus result for that project
|
||||
---
|
||||
duration_ms: 2.817257
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
ok 7 - a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
---
|
||||
duration_ms: 6.020444
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read needs no send; a read-only Console still has no revert
|
||||
ok 8 - the status read needs no send; a read-only Console still has no revert
|
||||
---
|
||||
duration_ms: 1.377224
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
not ok 9 - library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
---
|
||||
duration_ms: 1.015984
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M7-user-fence/packages/webui/tests/library-routes.test.mjs:132:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
/api/library/status
|
||||
|
||||
true !== false
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: false
|
||||
actual: true
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M7-user-fence/packages/webui/tests/library-routes.test.mjs:133:106)
|
||||
Test.runInAsyncScope (node:async_hooks:226:14)
|
||||
Test.run (node:internal/test_runner/test:1402:25)
|
||||
Test.processPendingSubtests (node:internal/test_runner/test:974:18)
|
||||
Test.postRun (node:internal/test_runner/test:1542:19)
|
||||
Test.run (node:internal/test_runner/test:1467:12)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
ok 10 - the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
---
|
||||
duration_ms: 1.695555
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert receipt for another project is unknown and is never retried
|
||||
ok 11 - a revert receipt for another project is unknown and is never retried
|
||||
---
|
||||
duration_ms: 1.378325
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a granted-user HTTP session cannot reach owner library callbacks
|
||||
not ok 12 - a granted-user HTTP session cannot reach owner library callbacks
|
||||
---
|
||||
duration_ms: 1.178045
|
||||
type: 'test'
|
||||
location: '/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M7-user-fence/packages/webui/tests/library-routes.test.mjs:155:1'
|
||||
failureType: 'testCodeFailure'
|
||||
error: |-
|
||||
Expected values to be strictly equal:
|
||||
|
||||
503 !== 403
|
||||
|
||||
code: 'ERR_ASSERTION'
|
||||
name: 'AssertionError'
|
||||
expected: 403
|
||||
actual: 503
|
||||
operator: 'strictEqual'
|
||||
stack: |-
|
||||
TestContext.<anonymous> (file:///mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mosaic-row225-mutants-e6t705gk/M7-user-fence/packages/webui/tests/library-routes.test.mjs:167:12)
|
||||
process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
async Test.run (node:internal/test_runner/test:1409:7)
|
||||
async Test.processPendingSubtests (node:internal/test_runner/test:974:7)
|
||||
...
|
||||
# Subtest: a configured revert callback remains unreachable when send is off
|
||||
ok 13 - a configured revert callback remains unreachable when send is off
|
||||
---
|
||||
duration_ms: 1.057394
|
||||
type: 'test'
|
||||
...
|
||||
1..13
|
||||
# tests 13
|
||||
# suites 0
|
||||
# pass 11
|
||||
# fail 2
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 176.864112
|
||||
@@ -0,0 +1,147 @@
|
||||
{
|
||||
"head": "50790127716002f97154800ecbfb968690a9d644",
|
||||
"clear": "sage-3647",
|
||||
"worktreeUnchanged": true,
|
||||
"results": [
|
||||
{
|
||||
"mutant": "M1-badges",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M1-badges.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M1-agent-label",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M1-agent-label.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M2-http-links",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M2-http-links.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M3-wrong-commit",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M3-wrong-commit.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M3-missing-file",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M3-missing-file.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M4-fallback",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M4-fallback.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M4-problem",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/chat-replies-browser.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M4-problem.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M5-send",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/library-routes.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M5-send.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M5-project-receipt",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/library-routes.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M5-project-receipt.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M5-commit-input",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/library-routes.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M5-commit-input.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M5-origin",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/library-routes.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M5-origin.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M5-fetch-metadata",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/library-routes.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M5-fetch-metadata.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M6-duplicate-call",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/library-routes.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M6-duplicate-call.tap"
|
||||
},
|
||||
{
|
||||
"mutant": "M7-user-fence",
|
||||
"anchorHits": 1,
|
||||
"restored": true,
|
||||
"worktreeUnchanged": true,
|
||||
"exit": 1,
|
||||
"killed": true,
|
||||
"test": "packages/webui/tests/library-routes.test.mjs",
|
||||
"log": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2/mutants-final/M7-user-fence.tap"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
{
|
||||
"rawRoot": "/mnt/storage/scratch/tmp/fethry-row225-KEmw8wQ2",
|
||||
"logs": [
|
||||
{
|
||||
"path": "evidence/browser-final.tap",
|
||||
"rawSha256": "4e6d5874786aa5d407b59d0b701652d419d0fecda5402ede40f52b313def12b0",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/browser-final2.tap",
|
||||
"rawSha256": "194b3150e59868aab023d9ccfc75c69b82e43afba38c1b12e87a1fb3d68fe821",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/browser-green.tap",
|
||||
"rawSha256": "030d7a5c9af70d4a7ade177906fb971b29fa4cf1fc5efd39f35643ed1969cd01",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/browser-red.tap",
|
||||
"rawSha256": "db00bee89b4353efe7d324b17417347b30964f79ad4469a5dc98c6d125691f55",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/channel-proof.tap",
|
||||
"rawSha256": "cb7c0398af2a2a0e7cae24ee2c8167601cbf7e3f9cf3ed7479b2a6ef65f5da8a",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/library-full.tap",
|
||||
"rawSha256": "5447e3fce497a0dfb03ddd3eb2795dc2a179554f794e4c37458219c70736a645",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mapping-red.tap",
|
||||
"rawSha256": "8ca7310e46df2d35fa96e3aba378721ad388dce41f003ee133b684eeb7eaf245",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-attempt1/M1-agent-label.tap",
|
||||
"rawSha256": "db7ab1c64bc05b719e5164ed4ce1dd8b79ad53309d9b8e3e1ca0cc8867bca70f",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-attempt1/M1-badges.tap",
|
||||
"rawSha256": "08351b9061351812008ebd7067a9aed24a9e5386d8f6284fb44ae0f59c8f2eca",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-attempt1/M2-http-links.tap",
|
||||
"rawSha256": "69921707c219d19fb2c33a3995268b6442d783ec702050b32f78d8d2db6fb581",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-attempt1/M3-wrong-commit.tap",
|
||||
"rawSha256": "fe9fb027efae26799e2dfac539e0986402cefe806ca31479f52420e67a8df423",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M1-agent-label.tap",
|
||||
"rawSha256": "afbab60cbc12348c4d0c4be1a8c4590dd157c71f9ffc7375bbde82facb9868bb",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M1-badges.tap",
|
||||
"rawSha256": "3bb9fb9dcf74a398934d6de48c2ca99ab2eab618fb944297b3d7db00eec0e69f",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M2-http-links.tap",
|
||||
"rawSha256": "8909921fcf602fcafa94edd19c1167a8f91ed970a3e649110e3503836690e567",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M3-missing-file.tap",
|
||||
"rawSha256": "3fd2749ea5bc4245f7d49f585b82eae60f61ed150ab4dd22e8148a1e9467c8c7",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M3-wrong-commit.tap",
|
||||
"rawSha256": "85696c155f0a2844ee903c8fb38cab0a0fb6b0610c8b9ee8aa77a08cb6012ca2",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M4-fallback.tap",
|
||||
"rawSha256": "6f59f2845e0130d4d2fe1cb4aa7a435502f6043e11ed4efd67339c12e986103a",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M4-problem.tap",
|
||||
"rawSha256": "61ab08b823eb08cbb9c9eeaac82b297ea5d1272bb5dc64e9598734688b55eb80",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M5-commit-input.tap",
|
||||
"rawSha256": "b703ee5ca47e5c64749aab3edfb5ae2e085367921ffa75337f4f0e5c7b3dc404",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M5-fetch-metadata.tap",
|
||||
"rawSha256": "6951725340e4d74764552e7e406e0fc4bafeec35172de56d13bca852b92daa1a",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M5-origin.tap",
|
||||
"rawSha256": "95fcb5a92e82fa7de2972fd8f78c4f0f6d1c5f49885123e01fb1b69c3b62ba21",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M5-project-receipt.tap",
|
||||
"rawSha256": "a86806a189ef73f61ddd88479336321964eadef0793c7b45da6573ccd3e38801",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M5-send.tap",
|
||||
"rawSha256": "4cce523356a3e2041197156412eb35088f8b6d38fcceca2d9b76b6098ad17627",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M6-duplicate-call.tap",
|
||||
"rawSha256": "6dda962389fbc7379ac7e7bc79cc24b68db00d4f9bb649ab73e75eaa87a5da00",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/mutants-final/M7-user-fence.tap",
|
||||
"rawSha256": "abec36c65c3ece6e7d0c4dfd41eede62c9a585f07b3ed4cb3b8d05f0dbabaed3",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/render-green.tap",
|
||||
"rawSha256": "98463ac3d1262f84758def8bbdc27c46fa7c674bb8e8c20b9c752083163d0864",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/render-red.tap",
|
||||
"rawSha256": "03645c7a5ba0c3d285e58e1d6fd05dc58a1174b463a258b01bcf258b2141a85e",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/routes-final.tap",
|
||||
"rawSha256": "f2b58a97c301dc9e57458d82785bd50debb2254df5d411d8e8c4e6b9c0aa00d2",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/routes-green.tap",
|
||||
"rawSha256": "c34451a0eef5f82fe6ddcbbf370179d8e8a14e36168175bdeff5b32e2072e9d6",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
},
|
||||
{
|
||||
"path": "evidence/routes-red.tap",
|
||||
"rawSha256": "5ca5bafe2465209128508e5459f4826c34d00de86d1e79671196dc4e5c57f874",
|
||||
"normalization": "trailing whitespace removed from display copy"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
✔ free text renders as itself with no citations (1.332106ms)
|
||||
✔ a cited reply renders its text, then each cite with the badge from the check result (0.493062ms)
|
||||
✔ a parsed body renders as its string does (0.2706ms)
|
||||
✔ without a check result a path cite has no badge, no label and is never changed (0.175324ms)
|
||||
✔ the label and the badge come from the check result only, never from a bad entry (0.171275ms)
|
||||
✔ a web cite is a link only for https (0.254363ms)
|
||||
✔ a write notice renders its fixed line (0.201038ms)
|
||||
✔ a body without the reply or notice shape is free text: the whole body, no citations (0.315846ms)
|
||||
✔ an empty citations list is a reply with no cites (0.167552ms)
|
||||
ℹ tests 9
|
||||
ℹ suites 0
|
||||
ℹ pass 9
|
||||
ℹ fail 0
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 70.188818
|
||||
@@ -0,0 +1,17 @@
|
||||
✔ free text renders as itself with no citations (1.211164ms)
|
||||
✔ a cited reply renders its text, then each cite with the badge from the check result (0.457937ms)
|
||||
✔ a parsed body renders as its string does (0.255138ms)
|
||||
✔ without a check result a path cite has no badge, no label and is never changed (0.189285ms)
|
||||
✔ the label and the badge come from the check result only, never from a bad entry (0.162195ms)
|
||||
✔ a web cite is a link only for https (0.231665ms)
|
||||
✔ a write notice renders its fixed line (0.167596ms)
|
||||
✔ a body without the reply or notice shape is free text: the whole body, no citations (0.283804ms)
|
||||
✔ an empty citations list is a reply with no cites (0.145774ms)
|
||||
ℹ tests 9
|
||||
ℹ suites 0
|
||||
ℹ pass 9
|
||||
ℹ fail 0
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 73.226696
|
||||
@@ -0,0 +1,88 @@
|
||||
TAP version 13
|
||||
# Subtest: a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
ok 1 - a signed-in same-origin revert reaches exactly one library.revert and returns the new commit
|
||||
---
|
||||
duration_ms: 18.873338
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
ok 2 - a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata
|
||||
---
|
||||
duration_ms: 7.061714
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
ok 3 - a revert takes a project and a 40-hex commit, nothing else, before the bus is asked
|
||||
---
|
||||
duration_ms: 6.45503
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
ok 4 - a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal
|
||||
---
|
||||
duration_ms: 6.964122
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
ok 5 - a revert whose answer is lost or unusable is reported unknown and is never retried
|
||||
---
|
||||
duration_ms: 5.745801
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read takes one project query and answers the bus result for that project
|
||||
ok 6 - the status read takes one project query and answers the bus result for that project
|
||||
---
|
||||
duration_ms: 2.815134
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
ok 7 - a status answer for another project or of the wrong shape is refused; a refusal keeps its status
|
||||
---
|
||||
duration_ms: 7.105984
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the status read needs no send; a read-only Console still has no revert
|
||||
ok 8 - the status read needs no send; a read-only Console still has no revert
|
||||
---
|
||||
duration_ms: 2.002948
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
ok 9 - library routes are the owner's: a granted user is refused them, and the tester never reverts
|
||||
---
|
||||
duration_ms: 0.708324
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
ok 10 - the page gets the one library renderer, byte for byte, as a JavaScript module
|
||||
---
|
||||
duration_ms: 1.553573
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a revert receipt for another project is unknown and is never retried
|
||||
ok 11 - a revert receipt for another project is unknown and is never retried
|
||||
---
|
||||
duration_ms: 1.371025
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a granted-user HTTP session cannot reach owner library callbacks
|
||||
ok 12 - a granted-user HTTP session cannot reach owner library callbacks
|
||||
---
|
||||
duration_ms: 1.586864
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: a configured revert callback remains unreachable when send is off
|
||||
ok 13 - a configured revert callback remains unreachable when send is off
|
||||
---
|
||||
duration_ms: 1.226995
|
||||
type: 'test'
|
||||
...
|
||||
1..13
|
||||
# tests 13
|
||||
# suites 0
|
||||
# pass 13
|
||||
# fail 0
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 177.384993
|
||||
@@ -0,0 +1,20 @@
|
||||
✔ a signed-in same-origin revert reaches exactly one library.revert and returns the new commit (19.266366ms)
|
||||
✔ a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata (7.415028ms)
|
||||
✔ a revert takes a project and a 40-hex commit, nothing else, before the bus is asked (6.176121ms)
|
||||
✔ a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal (7.325625ms)
|
||||
✔ a revert whose answer is lost or unusable is reported unknown and is never retried (5.0635ms)
|
||||
✔ the status read takes one project query and answers the bus result for that project (3.008847ms)
|
||||
✔ a status answer for another project or of the wrong shape is refused; a refusal keeps its status (6.314096ms)
|
||||
✔ the status read needs no send; a read-only Console still has no revert (1.440122ms)
|
||||
✔ library routes are the owner's: a granted user is refused them, and the tester never reverts (0.563979ms)
|
||||
✔ the page gets the one library renderer, byte for byte, as a JavaScript module (1.180551ms)
|
||||
✔ a revert receipt for another project is unknown and is never retried (1.12255ms)
|
||||
✔ a granted-user HTTP session cannot reach owner library callbacks (1.351581ms)
|
||||
ℹ tests 12
|
||||
ℹ suites 0
|
||||
ℹ pass 12
|
||||
ℹ fail 0
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 182.202771
|
||||
@@ -0,0 +1,76 @@
|
||||
✔ a signed-in same-origin revert reaches exactly one library.revert and returns the new commit (18.853567ms)
|
||||
✔ a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata (6.491576ms)
|
||||
✔ a revert takes a project and a 40-hex commit, nothing else, before the bus is asked (5.647113ms)
|
||||
✔ a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal (6.08423ms)
|
||||
✔ a revert whose answer is lost or unusable is reported unknown and is never retried (5.445934ms)
|
||||
✖ the status read takes one project query and answers the bus result for that project (3.470803ms)
|
||||
✖ a status answer for another project or of the wrong shape is refused; a refusal keeps its status (5.42219ms)
|
||||
✔ the status read needs no send; a read-only Console still has no revert (1.428304ms)
|
||||
✔ library routes are the owner's: a granted user is refused them, and the tester never reverts (0.509039ms)
|
||||
✔ the page gets the one library renderer, byte for byte, as a JavaScript module (1.123365ms)
|
||||
✖ a revert receipt for another project is unknown and is never retried (1.209291ms)
|
||||
✔ a granted-user HTTP session cannot reach owner library callbacks (1.398731ms)
|
||||
ℹ tests 12
|
||||
ℹ suites 0
|
||||
ℹ pass 9
|
||||
ℹ fail 3
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 198.061254
|
||||
|
||||
✖ failing tests:
|
||||
|
||||
test at packages/webui/tests/library-routes.test.mjs:100:1
|
||||
✖ the status read takes one project query and answers the bus result for that project (3.470803ms)
|
||||
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
|
||||
|
||||
403 !== 405
|
||||
|
||||
at TestContext.<anonymous> (file:///home/jwoltje/.t3/worktrees/mosaic-stack/fethry-row225/packages/webui/tests/library-routes.test.mjs:107:10)
|
||||
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
at async Test.run (node:internal/test_runner/test:1409:7)
|
||||
at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
|
||||
generatedMessage: true,
|
||||
code: 'ERR_ASSERTION',
|
||||
actual: 403,
|
||||
expected: 405,
|
||||
operator: 'strictEqual',
|
||||
diff: 'simple'
|
||||
}
|
||||
|
||||
test at packages/webui/tests/library-routes.test.mjs:111:1
|
||||
✖ a status answer for another project or of the wrong shape is refused; a refusal keeps its status (5.42219ms)
|
||||
AssertionError [ERR_ASSERTION]: project-not-declared
|
||||
|
||||
400 !== 502
|
||||
|
||||
at TestContext.<anonymous> (file:///home/jwoltje/.t3/worktrees/mosaic-stack/fethry-row225/packages/webui/tests/library-routes.test.mjs:119:12)
|
||||
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
at async Test.run (node:internal/test_runner/test:1409:7)
|
||||
at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
|
||||
generatedMessage: false,
|
||||
code: 'ERR_ASSERTION',
|
||||
actual: 400,
|
||||
expected: 502,
|
||||
operator: 'strictEqual',
|
||||
diff: 'simple'
|
||||
}
|
||||
|
||||
test at packages/webui/tests/library-routes.test.mjs:145:1
|
||||
✖ a revert receipt for another project is unknown and is never retried (1.209291ms)
|
||||
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
|
||||
|
||||
200 !== 503
|
||||
|
||||
at TestContext.<anonymous> (file:///home/jwoltje/.t3/worktrees/mosaic-stack/fethry-row225/packages/webui/tests/library-routes.test.mjs:148:10)
|
||||
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
|
||||
at async Test.run (node:internal/test_runner/test:1409:7)
|
||||
at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
|
||||
generatedMessage: true,
|
||||
code: 'ERR_ASSERTION',
|
||||
actual: 200,
|
||||
expected: 503,
|
||||
operator: 'strictEqual',
|
||||
diff: 'simple'
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
diff --git a/packages/bus/tests/channel-proof.test.mjs b/packages/bus/tests/channel-proof.test.mjs
|
||||
index ba0179832..435d8fa2d 100644
|
||||
--- a/packages/bus/tests/channel-proof.test.mjs
|
||||
+++ b/packages/bus/tests/channel-proof.test.mjs
|
||||
@@ -11,0 +12,2 @@
|
||||
+// Row 225 (C2-10b) re-pins webui bus.mjs for one STATUS entry, library-revert-not-agent: 409; no proof
|
||||
+// or transport change.
|
||||
@@ -32 +34 @@ const baselines = {
|
||||
- "packages/webui/src/bus.mjs": "604092cb706b152d458f299ff1071f6cd488774629012f96b672f7e9a16c0b2c",
|
||||
+ "packages/webui/src/bus.mjs": "9f33e9ca4feb7265ae33fd3ddf0ead0b75375d07ecbe9d8e55c618d29edea658",
|
||||
diff --git a/packages/library/tests/render.test.mjs b/packages/library/tests/render.test.mjs
|
||||
index b07e26d25..9c861bfe9 100644
|
||||
--- a/packages/library/tests/render.test.mjs
|
||||
+++ b/packages/library/tests/render.test.mjs
|
||||
@@ -3 +3 @@ import assert from 'node:assert/strict';
|
||||
-import { renderItems, UNREADABLE } from '../src/index.mjs';
|
||||
+import { renderReply } from '../src/index.mjs';
|
||||
@@ -4,0 +5 @@ import { renderItems, UNREADABLE } from '../src/index.mjs';
|
||||
+// Row 225 (C2-10b): renderReply replaces renderItems (design 7.4, the reply schema of 5.2).
|
||||
@@ -6,6 +7,12 @@ const A = 'a'.repeat(40), B = 'b'.repeat(40);
|
||||
-const cite = (path, lines, quote, commit = A) => ({ path, commit, lines, quote });
|
||||
-const options = {
|
||||
- scopeOf: path => path.includes('/Playground/') ? 'playground' : path.endsWith('.md') ? 'canon' : undefined,
|
||||
- changed: ({ path, commit }) => path === 'Book One/Characters/Mara Vell.md' && commit === A,
|
||||
-};
|
||||
-const render = items => renderItems(JSON.stringify({ items }), options);
|
||||
+const cite = (path, lines, quote, commit = A, extra = {}) => ({ path, commit, lines, quote, ...extra });
|
||||
+const web = (url, quote = 'spring tides') => ({ url, quote });
|
||||
+const reply = (text, citations) => JSON.stringify({ text, citations });
|
||||
+const CITED = reply("Mara's eyes are grey in chapter 3.", [
|
||||
+ cite('Book One/Chapters/Chapter 03.md', [41, 41], 'her grey eyes', A, { as: 'canon' }),
|
||||
+ cite('Book One/Playground/What If.md', [5, 6], 'a storm', B),
|
||||
+ cite('Notes/Eyes.md', [9, 10], 'green eyes'),
|
||||
+ web('https://example.invalid/tides'),
|
||||
+]);
|
||||
+const CHECK = { citations: [{ scope: 'canon', agent: null }, { scope: 'playground', agent: null },
|
||||
+ { scope: 'supporting', agent: 'acme/scribe' }, { scope: 'web', agent: null }] };
|
||||
+const changed = ({ path, commit }) => path === 'Notes/Eyes.md' && commit === A;
|
||||
@@ -13,21 +20,4 @@ const render = items => renderItems(JSON.stringify({ items }), options);
|
||||
-// One snapshot per item kind: the plain text both channels show.
|
||||
-const SNAPSHOTS = {
|
||||
- fact: [{ kind: 'fact', text: 'Tomas is the ferryman.', cites: [cite('Book One/Characters/Tomas.md', [3, 3], 'the ferryman', B)] }],
|
||||
- finding: [{ kind: 'finding', text: 'Eye colour differs.', cites: [cite('Book One/Chapters/Chapter 01.md', [41, 41], 'her grey eyes'),
|
||||
- cite('Book One/Characters/Mara Vell.md', [9, 10], 'green eyes')] }],
|
||||
- correction: [{ kind: 'correction', text: 'Chapter 1 says grey.', from: 'green eyes', to: 'grey eyes',
|
||||
- cites: [cite('Book One/Characters/Mara Vell.md', [9, 9], 'green eyes', B)] }],
|
||||
- question: [{ kind: 'question', text: 'Is the harbor north of the town?', cites: [cite('Book One/Places/Harbor Town.md', [2, 4], 'the harbor', B)] }],
|
||||
- idea: [{ kind: 'idea', text: 'A storm could close the harbor.', cites: [cite('Book One/Playground/What If.md', [5, 5], 'a storm', B),
|
||||
- { url: 'https://example.invalid/tides', quote: 'spring tides' }] }],
|
||||
-};
|
||||
-const EXPECTED = {
|
||||
- fact: '1. Fact: Tomas is the ferryman.\n [canon] Book One/Characters/Tomas.md:3 @bbbbbbb "the ferryman"',
|
||||
- finding: '1. Finding: Eye colour differs.\n [canon] Book One/Chapters/Chapter 01.md:41 @aaaaaaa "her grey eyes"\n'
|
||||
- + ' [canon] Book One/Characters/Mara Vell.md:9-10 @aaaaaaa "green eyes" (changed since)',
|
||||
- correction: '1. Correction: Chapter 1 says grey.\n From: "green eyes"\n To: "grey eyes"\n'
|
||||
- + ' [canon] Book One/Characters/Mara Vell.md:9 @bbbbbbb "green eyes"',
|
||||
- question: '1. Question: Is the harbor north of the town?\n [canon] Book One/Places/Harbor Town.md:2-4 @bbbbbbb "the harbor"',
|
||||
- idea: '1. Idea: A storm could close the harbor.\n [playground] Book One/Playground/What If.md:5 @bbbbbbb "a storm"\n'
|
||||
- + ' [web] https://example.invalid/tides "spring tides"',
|
||||
-};
|
||||
+test('free text renders as itself with no citations', () => {
|
||||
+ for (const body of ['Grey, in chapter 3.', '', '"a JSON string"', '[1, 2]', '42', 'null'])
|
||||
+ assert.deepEqual(renderReply(body, { check: CHECK }), { kind: 'text', text: body, plain: body });
|
||||
+});
|
||||
@@ -35,8 +25,15 @@ const EXPECTED = {
|
||||
-for (const kind of Object.keys(SNAPSHOTS)) {
|
||||
- test(`renderItems snapshot: ${kind}`, () => {
|
||||
- const out = render(SNAPSHOTS[kind]);
|
||||
- assert.equal(out.kind, 'items');
|
||||
- assert.equal(out.text, EXPECTED[kind]);
|
||||
- assert.equal(out.items[0].kind, kind);
|
||||
- });
|
||||
-}
|
||||
+test('a cited reply renders its text, then each cite with the badge from the check result', () => {
|
||||
+ const out = renderReply(CITED, { check: CHECK, changed });
|
||||
+ assert.equal(out.kind, 'reply');
|
||||
+ assert.equal(out.text, "Mara's eyes are grey in chapter 3.");
|
||||
+ assert.deepEqual(out.citations.map(c => c.badge), ['canon', 'playground', 'supporting', 'web']);
|
||||
+ assert.equal(out.plain, "Mara's eyes are grey in chapter 3.\n"
|
||||
+ + ' [canon] Book One/Chapters/Chapter 03.md:41 @aaaaaaa "her grey eyes"\n'
|
||||
+ + ' [playground] Book One/Playground/What If.md:5-6 @bbbbbbb "a storm"\n'
|
||||
+ + ' [supporting] Notes/Eyes.md:9-10 @aaaaaaa "green eyes" (agent-written: acme/scribe) (changed since)\n'
|
||||
+ + ' [web] https://example.invalid/tides "spring tides"');
|
||||
+ assert.deepEqual(out.citations[0], { badge: 'canon', path: 'Book One/Chapters/Chapter 03.md', commit: A, lines: [41, 41],
|
||||
+ ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa', quote: 'her grey eyes', canon: true, agent: null, changed: false });
|
||||
+ assert.deepEqual(out.citations[3], { badge: 'web', url: 'https://example.invalid/tides', link: 'https://example.invalid/tides',
|
||||
+ ref: 'https://example.invalid/tides', quote: 'spring tides', agent: null, changed: false });
|
||||
+});
|
||||
@@ -44,6 +41,2 @@ for (const kind of Object.keys(SNAPSHOTS)) {
|
||||
-test('renderItems numbers several items and takes a parsed body as well as a string', () => {
|
||||
- const items = [...SNAPSHOTS.fact, ...SNAPSHOTS.question];
|
||||
- const out = renderItems({ items }, options);
|
||||
- assert.equal(out.text, `${EXPECTED.fact}\n${EXPECTED.question.replace(/^1\./, '2.')}`);
|
||||
- assert.deepEqual(out.items[1].cites[0], { badge: 'canon', path: 'Book One/Places/Harbor Town.md', commit: B, lines: [2, 4],
|
||||
- ref: 'Book One/Places/Harbor Town.md:2-4 @bbbbbbb', quote: 'the harbor', changed: false });
|
||||
+test('a parsed body renders as its string does', () => {
|
||||
+ assert.deepEqual(renderReply(JSON.parse(CITED), { check: CHECK, changed }), renderReply(CITED, { check: CHECK, changed }));
|
||||
@@ -52,4 +45,4 @@ test('renderItems numbers several items and takes a parsed body as well as a str
|
||||
-test('without options a path cite has no badge and is never marked changed', () => {
|
||||
- assert.equal(renderItems({ items: SNAPSHOTS.finding }).text,
|
||||
- '1. Finding: Eye colour differs.\n Book One/Chapters/Chapter 01.md:41 @aaaaaaa "her grey eyes"\n'
|
||||
- + ' Book One/Characters/Mara Vell.md:9-10 @aaaaaaa "green eyes"');
|
||||
+test('without a check result a path cite has no badge, no label and is never changed', () => {
|
||||
+ const out = renderReply(CITED);
|
||||
+ assert.deepEqual(out.citations.map(c => [c.badge, c.agent, c.changed]),
|
||||
+ [[null, null, false], [null, null, false], [null, null, false], ['web', null, false]]);
|
||||
@@ -58,6 +51,6 @@ test('without options a path cite has no badge and is never marked changed', ()
|
||||
-const NOTICE_SNAPSHOTS = { 'no-cited-answer': 'No cited answer', 'no-answer': 'No answer', 'turn-failed': 'The turn failed' };
|
||||
-for (const [notice, text] of Object.entries(NOTICE_SNAPSHOTS)) {
|
||||
- test(`renderItems snapshot: notice ${notice}`, () => {
|
||||
- assert.deepEqual(renderItems(JSON.stringify({ items: [], notice }), options), { kind: 'notice', notice, text });
|
||||
- });
|
||||
-}
|
||||
+test('the label and the badge come from the check result only, never from a bad entry', () => {
|
||||
+ const bad = { citations: [{ scope: 'web', agent: '' }, { scope: 'story', agent: 7 }, null, { scope: 'canon', agent: 'x/y' }] };
|
||||
+ const out = renderReply(CITED, { check: bad });
|
||||
+ // A path cite can't be web; a url cite is web by its shape whatever the check says, and never agent-written.
|
||||
+ assert.deepEqual(out.citations.map(c => [c.badge, c.agent]), [[null, null], [null, null], [null, null], ['web', null]]);
|
||||
+});
|
||||
@@ -65,14 +58,8 @@ for (const [notice, text] of Object.entries(NOTICE_SNAPSHOTS)) {
|
||||
-test('a body without the reply shape shows a fixed line and none of its text', () => {
|
||||
- const secret = 'free prose the guard would refuse';
|
||||
- const bodies = [secret, JSON.stringify(secret), '{"items": [], "notice": "other"}', JSON.stringify({ items: [], notice: 'no-answer', extra: secret }),
|
||||
- JSON.stringify({ items: [] }), JSON.stringify({ items: [{ kind: 'story', text: secret, cites: [] }] }),
|
||||
- JSON.stringify({ items: [{ kind: 'fact', text: secret }] }), JSON.stringify({ items: SNAPSHOTS.fact, prose: secret }),
|
||||
- JSON.stringify({ items: [{ kind: 'correction', text: secret, cites: [] }] }),
|
||||
- JSON.stringify({ items: [{ kind: 'fact', text: secret, cites: [cite('a.md', [2, 1], 'q')] }] }),
|
||||
- JSON.stringify({ items: [{ kind: 'fact', text: secret, cites: [{ path: 'a.md', commit: 'abc', lines: [1, 1], quote: 'q' }] }] }),
|
||||
- JSON.stringify({ items: [{ kind: 'fact', text: secret, cites: [{ url: 'https://x.invalid', path: 'a.md', quote: 'q' }] }] }),
|
||||
- null, 42, '[]'];
|
||||
- for (const body of bodies) {
|
||||
- const out = renderItems(body, options);
|
||||
- assert.deepEqual(out, { kind: 'unreadable', text: UNREADABLE }, String(body));
|
||||
- assert.ok(!JSON.stringify(out).includes(secret));
|
||||
+test('a web cite is a link only for https', () => {
|
||||
+ const urls = { 'https://example.invalid/a': 'https://example.invalid/a', 'http://example.invalid/a': null,
|
||||
+ 'javascript:alert(1)': null, 'JAVASCRIPT:alert(1)': null, 'data:text/html,x': null, 'not a url': null, '//example.invalid': null };
|
||||
+ for (const [url, link] of Object.entries(urls)) {
|
||||
+ const out = renderReply(reply('t', [web(url)]));
|
||||
+ assert.equal(out.kind, 'reply', url);
|
||||
+ assert.equal(out.citations[0].link, link, url);
|
||||
+ assert.equal(out.citations[0].ref, url);
|
||||
@@ -80,0 +68,27 @@ test('a body without the reply shape shows a fixed line and none of its text', (
|
||||
+
|
||||
+test('a write notice renders its fixed line', () => {
|
||||
+ const body = op => JSON.stringify({ notice: 'library-write', op, path: 'Notes/Eyes.md', commit: B });
|
||||
+ assert.deepEqual(renderReply(body('write'), { name: 'Scribe' }),
|
||||
+ { kind: 'notice', op: 'write', path: 'Notes/Eyes.md', commit: B, text: 'Scribe wrote Notes/Eyes.md @bbbbbbb', plain: 'Scribe wrote Notes/Eyes.md @bbbbbbb' });
|
||||
+ assert.equal(renderReply(body('delete'), { name: 'Scribe' }).text, 'Scribe deleted Notes/Eyes.md @bbbbbbb');
|
||||
+ assert.equal(renderReply(body('write')).text, 'An agent wrote Notes/Eyes.md @bbbbbbb');
|
||||
+});
|
||||
+
|
||||
+test('a body without the reply or notice shape is free text: the whole body, no citations', () => {
|
||||
+ const bodies = [
|
||||
+ JSON.stringify({ text: 't' }), JSON.stringify({ citations: [] }), JSON.stringify({ text: 1, citations: [] }),
|
||||
+ JSON.stringify({ text: 't', citations: [], extra: 1 }), JSON.stringify({ items: [] }),
|
||||
+ reply('t', [cite('a.md', [2, 1], 'q')]), reply('t', [cite('a.md', [0, 1], 'q')]), reply('t', [cite('a.md', [1], 'q')]),
|
||||
+ reply('t', [{ path: 'a.md', commit: 'abc', lines: [1, 1], quote: 'q' }]), reply('t', [cite('a.md', [1, 1], 'q', A, { as: 'playground' })]),
|
||||
+ reply('t', [cite('a.md', [1, 1], 'q', A, { scope: 'canon' })]), reply('t', [{ url: 'https://x.invalid', path: 'a.md', quote: 'q' }]),
|
||||
+ reply('t', [{ url: 'https://x.invalid' }]), reply('t', [{ url: 'https://x.invalid', quote: 'q', agent: 'x/y' }]),
|
||||
+ JSON.stringify({ notice: 'library-write', op: 'move', path: 'a.md', commit: A }),
|
||||
+ JSON.stringify({ notice: 'library-write', op: 'write', path: 'a.md', commit: 'abc' }),
|
||||
+ JSON.stringify({ notice: 'library-write', op: 'write', path: 'a.md', commit: A, by: 'x' }),
|
||||
+ ];
|
||||
+ for (const body of bodies) assert.deepEqual(renderReply(body, { check: CHECK }), { kind: 'text', text: body, plain: body }, body);
|
||||
+});
|
||||
+
|
||||
+test('an empty citations list is a reply with no cites', () => {
|
||||
+ assert.deepEqual(renderReply(reply('Grey.', [])), { kind: 'reply', text: 'Grey.', citations: [], plain: 'Grey.' });
|
||||
+});
|
||||
@@ -0,0 +1,13 @@
|
||||
6bdaf870be3d8d03a68eb03f5f6916150bb1b3db134ffbe84018e91d47e6434d packages/bus/tests/channel-proof.test.mjs
|
||||
0385fc49b445ff730021eb11c20b29027631e0d27350e4591d5a0936ffbdccf6 packages/library/README.md
|
||||
653ff444ba66cb73e1ca4df1f6037f15a2ec7d3d009cf614a0dc51deabda4b50 packages/library/src/index.mjs
|
||||
dfcc9f271afc7afdab908395a7f3c402100fa89b4994b20d5bcae3140d5c335e packages/library/src/render.mjs
|
||||
f3c213f3b0bd080d0bc5837f741a29e324acb91cf0c27144dee08a4113262210 packages/library/tests/render.test.mjs
|
||||
9f33e9ca4feb7265ae33fd3ddf0ead0b75375d07ecbe9d8e55c618d29edea658 packages/webui/src/bus.mjs
|
||||
f1a0c9a55b1ae933e205c7e2b9753afe0c2f1fc9b0faa2cf18765396f99ac8dd packages/webui/src/cli.mjs
|
||||
bf49a22147be0535076640d20149116a744dad9b0b32dd667ee297a061d56134 packages/webui/src/console-bus.mjs
|
||||
793e7dd9edbe5a55c2deab3c8aef4fbd5b4c838e132e2ac9294043c7176ec6f7 packages/webui/src/public/chat.css
|
||||
af3a6f382e0d40cf2b28c31db7cb58ba775f1e242651ba42c7426bda99dc0d89 packages/webui/src/public/chat.js
|
||||
6412fe34bc640433e9cf7610f65d3574a3415c934354d8cb52e056793a81948f packages/webui/src/serve.mjs
|
||||
f191752f867a112c867ca24268f70aa99ca0903c9208f76bc4bb4c1587cb55df packages/webui/tests/chat-replies-browser.test.mjs
|
||||
df4ff385ac4ca8244ffa00faf82fcca1f4fcdac8da02a4f4d71233d4df8e1157 packages/webui/tests/library-routes.test.mjs
|
||||
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run row225 mutants in disposable snapshots, only on Sage CLEAR.
|
||||
|
||||
Commit the tested candidate first. Never change the worktree or shared dependencies.
|
||||
A timeout, import failure or process failure is not a mutation kill.
|
||||
"""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import tarfile
|
||||
import tempfile
|
||||
|
||||
BROWSER = 'packages/webui/tests/chat-replies-browser.test.mjs'
|
||||
ROUTES = 'packages/webui/tests/library-routes.test.mjs'
|
||||
CHAT = 'packages/webui/src/public/chat.js'
|
||||
SERVE = 'packages/webui/src/serve.mjs'
|
||||
RENDER = 'packages/library/src/render.mjs'
|
||||
MUTANTS = [
|
||||
('M1-badges', RENDER, 'badge: scope, path:', 'badge: null, path:', BROWSER),
|
||||
('M1-agent-label', RENDER, 'canon: c.canon, agent,', 'canon: c.canon, agent: null,', BROWSER),
|
||||
('M2-http-links', RENDER, "new URL(url).protocol === 'https:' ? url : null", 'url', BROWSER),
|
||||
('M3-wrong-commit', CHAT, 'e.file !== e.last', 'cite.commit !== e.last', BROWSER),
|
||||
('M3-missing-file', CHAT, "SHA.test(e?.file ?? '') && SHA.test(e?.last ?? '')", "SHA.test(e?.last ?? '')", BROWSER),
|
||||
('M4-fallback', CHAT, 'Array.isArray(limits.fallback) ? limits.fallback.filter', 'Array.isArray(v.replyLimitsFallback) ? v.replyLimitsFallback.filter', BROWSER),
|
||||
('M4-problem', CHAT, "if (CODE.test(limits.problem ?? '')) parts.push(`<code>${txt(limits.problem)}</code>`);", '', BROWSER),
|
||||
('M5-send', SERVE, 'if (!send || !libraryRevert || !named)', 'if (!libraryRevert || !named)', ROUTES),
|
||||
('M5-project-receipt', SERVE, 'result.project !== value.project || ', '', ROUTES),
|
||||
('M5-commit-input', SERVE, '!COMMIT.test(value.commit)', 'false', ROUTES),
|
||||
('M5-origin', SERVE, "if (one(req, 'origin') !== ownOrigin(preview)) return refuse(403, 'cross-origin request refused', 'a revert needs the Console\\'s own Origin');", '', ROUTES),
|
||||
('M5-fetch-metadata', SERVE, "if (one(req, 'sec-fetch-site') !== 'same-origin') return refuse(403, 'cross-site request refused', 'a revert needs same-origin Fetch Metadata');", '', ROUTES),
|
||||
('M6-duplicate-call', SERVE, 'result = await libraryRevert({ project: value.project, commit: value.commit });', 'result = await libraryRevert({ project: value.project, commit: value.commit }); await libraryRevert({ project: value.project, commit: value.commit });', ROUTES),
|
||||
('M7-user-fence', SERVE, "if (path === '/api/chat' || path.startsWith('/api/chat/')) return true;", "if (path.startsWith('/api/library/')) return true; if (path === '/api/chat' || path.startsWith('/api/chat/')) return true;", ROUTES),
|
||||
]
|
||||
|
||||
|
||||
def digest(path):
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--clear', required=True, help='Sage CLEAR authorizing this run')
|
||||
parser.add_argument('--output', required=True, type=Path)
|
||||
args = parser.parse_args()
|
||||
repo = Path(subprocess.check_output(['git', 'rev-parse', '--show-toplevel'], text=True).strip())
|
||||
if subprocess.check_output(['git', 'status', '--porcelain', '--', 'packages'], text=True).strip():
|
||||
raise SystemExit('Commit tested packages first: snapshot must match candidate.')
|
||||
head = subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip()
|
||||
before = {p: digest(repo / p) for p in [CHAT, SERVE, RENDER]}
|
||||
args.output.mkdir(parents=True, exist_ok=True)
|
||||
results = []
|
||||
with tempfile.TemporaryDirectory(prefix='mosaic-row225-mutants-') as directory:
|
||||
scratch = Path(directory)
|
||||
archive = scratch / 'candidate.tar'
|
||||
with archive.open('wb') as stream:
|
||||
subprocess.run(['git', 'archive', 'HEAD', 'packages', 'roles', 'contracts', 'tasks', 'missions', 'package.json', 'RELEASE'], stdout=stream, check=True)
|
||||
for name, target, old, new, test in MUTANTS:
|
||||
tree = scratch / name
|
||||
tree.mkdir()
|
||||
with tarfile.open(archive) as bundle:
|
||||
bundle.extractall(tree, filter='data')
|
||||
(tree / 'node_modules').symlink_to((repo / 'node_modules').resolve(), target_is_directory=True)
|
||||
path = tree / target
|
||||
source = path.read_text()
|
||||
hits = source.count(old)
|
||||
if hits != 1:
|
||||
raise SystemExit(f'{name}: expected one anchor, found {hits}')
|
||||
path.write_text(source.replace(old, new, 1))
|
||||
command = ['timeout', '-k', '10', '240' if test == BROWSER else '120', 'node', '--test', '--test-reporter=tap', '--test-concurrency=1', '--test-timeout=30000', test]
|
||||
run = subprocess.run(command, cwd=tree, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, env=os.environ)
|
||||
log = args.output / f'{name}.tap'
|
||||
log.write_text(run.stdout)
|
||||
path.write_text(source)
|
||||
restored = digest(path) == hashlib.sha256(source.encode()).hexdigest()
|
||||
worktree_clean = before == {p: digest(repo / p) for p in before}
|
||||
if not restored or not worktree_clean:
|
||||
raise SystemExit(f'{name}: restore/hash check failed')
|
||||
killed = run.returncode == 1 and 'ERR_ASSERTION' in run.stdout and 'not ok ' in run.stdout
|
||||
results.append({'mutant': name, 'anchorHits': hits, 'restored': restored, 'worktreeUnchanged': worktree_clean, 'exit': run.returncode, 'killed': killed, 'test': test, 'log': str(log)})
|
||||
print(json.dumps(results[-1]), flush=True)
|
||||
shutil.rmtree(tree)
|
||||
if not killed:
|
||||
break
|
||||
after = {p: digest(repo / p) for p in before}
|
||||
report = {'head': head, 'clear': args.clear, 'worktreeUnchanged': before == after, 'results': results}
|
||||
(args.output / 'summary.json').write_text(json.dumps(report, indent=2) + '\n')
|
||||
if before != after or len(results) != len(MUTANTS) or not all(r['killed'] for r in results):
|
||||
raise SystemExit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,177 @@
|
||||
# Row 225 (C2-10b) Console chat: replies, citations, write notices, status line
|
||||
|
||||
Owner: Morgana, from sage-3582 (18:53Z 10-23). Base: origin/refactor 45dca69f6. Branch: morgana/row225.
|
||||
Brief: docs/plans/2026-10-20_case2-rows.md, C2-10b. Design: agents/gosalyn/work/case2/DESIGN.md 7.4,
|
||||
5.2 (the reply schema and the check result) and the write notice and `library.revert` (about line 286).
|
||||
|
||||
## Ruling on the dependency gap (sage-3591)
|
||||
|
||||
225 builds against the design contracts. `renderReply` stays pure, and the caller supplies the answers
|
||||
it can't know. The revert route proxies to the bus verb and shows the refusal code until the verb
|
||||
exists. Landing order: 225 lands after 217 (C2-06), not after 288 (C2-02). Sage adds `after 217` to
|
||||
row 225. Before 288 lands, the Revert button gets the bus's refusal and shows its code, as the brief
|
||||
allows.
|
||||
|
||||
## A1. The check result I assume (to 217, Launchpad)
|
||||
|
||||
The broker stores one check result with each agent-to-human message the guard passes. The Console reads
|
||||
it on the message row that `/api/chat/threads/<id>/messages` returns, under the key `check`:
|
||||
|
||||
```json
|
||||
{
|
||||
"check": {
|
||||
"citations": [
|
||||
{ "scope": "canon", "agent": null },
|
||||
{ "scope": "supporting", "agent": "acme/scribe" },
|
||||
{ "scope": "web", "agent": null }
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- `check` is `null` or absent on a message the guard didn't check: a human's message, a free-text reply,
|
||||
a notice, or a message from before 217.
|
||||
- `check.citations` has one entry per entry of the body's `citations`, in the same order.
|
||||
- `scope` is one of `canon`, `playground`, `supporting` and `web`. A url cite is `web`.
|
||||
- `agent` is the `Mosaic-Agent` trailer value, `<business>/<instance>`, from
|
||||
`git log -1 --format=%(trailers:key=Mosaic-Agent,valueonly) <commit> -- <path>`, or `null` when the
|
||||
file's last commit at `commit` carries none. A url cite has `agent: null`. The Console shows the
|
||||
agent-written label when `agent` is a nonempty string, and names the agent.
|
||||
|
||||
The Console trusts nothing in the body for scope or label. A cite with no matching check entry renders
|
||||
with no badge and no label. It doesn't fall back to a scope it worked out itself.
|
||||
|
||||
If 217 uses other names, I change mine to theirs before either of us pushes (sage-3591 item 1).
|
||||
|
||||
## A2. The revert verb I assume (to 288, Honker)
|
||||
|
||||
- Verb: `library.revert`. A human verb (design M4): from an agent session it refuses `human-required`,
|
||||
like `library.status` (`broker.mjs:5133`).
|
||||
- Args: `{ "project": <business project name>, "commit": <40 lowercase hex> }`. The design writes
|
||||
`library.revert {commit}`. `project` is added to match the other library verbs, and like theirs it is the
|
||||
key of `business.projects` (`mirror.mjs:31`), which is the chat project's `repo` link, not its UUID. Both are required, and no other key
|
||||
is allowed (`invalid-request`), as the other library verbs check with `keys(args, ...)`.
|
||||
- Result: `{ "project", "path", "reverted": <the commit given>, "commit": <the new commit> }`.
|
||||
- Refusal codes the Console shows by name:
|
||||
- `library-revert-not-agent`: `commit` has no `Mosaic-Agent` trailer for this business, or isn't
|
||||
reachable from the served commit.
|
||||
- `stale-base`: a later commit changed that path.
|
||||
- `human-required`, `invalid-request`, `project-not-configured`.
|
||||
- Before 288 lands, the bus refuses the verb (expected `unknown-verb`, `broker.mjs:6578`), and the Console
|
||||
shows that code.
|
||||
- HTTP status in the Console (`packages/webui/src/bus.mjs` `busStatus`): `stale-base` and
|
||||
`library-revert-not-agent` map to 409. Every other code keeps the existing mapping.
|
||||
|
||||
## A3. The status line
|
||||
|
||||
`GET /api/library/status?project=<id>` proxies `library.status {project}` through the existing
|
||||
`libraryStatus` option. `cli.mjs:110` already passes that option, but `startServer` doesn't read it.
|
||||
The status line shows:
|
||||
|
||||
- the served commit (7 characters) and its age;
|
||||
- `library-diverged` when the sync state names it;
|
||||
- the fetch error code;
|
||||
- the reply limits in force, and the keys that fell back;
|
||||
- the count of R-problems, linking to the list.
|
||||
|
||||
It reads the fields `readSyncState` returns at the base (`packages/library/src/mirror.mjs:232`). It shows
|
||||
any field 217 adds (the limits) only when present.
|
||||
|
||||
## A4. "Changed since" (ruled sage-3596)
|
||||
|
||||
Sage ruled that 217 supplies `last`. On a `thread.messages` row that carries `check`, each path cite's
|
||||
entry gets `last`, the file's last commit at the served tip, read when the message is read. When `last`
|
||||
is absent the Console marks nothing changed, and a test pins that.
|
||||
|
||||
One more field is needed, raised in morgana-0200. The cited `commit` is a library commit, not the
|
||||
file's own last commit, so a cite made at a commit that didn't touch the file would differ from `last`
|
||||
while the file is unchanged. I asked 217 to also store `file`, the file's last commit at the cited
|
||||
commit. That's `%H` from the same `git log -1 <commit> -- <path>` call that reads the trailer, so it
|
||||
costs no extra git call. The Console marks a cite changed when both `file` and `last` are 40-hex and
|
||||
differ. The cited commit is reachable from the served one (5.2), so `file` is an ancestor of `last`,
|
||||
and differing means newer. A missing or malformed `file` or `last` marks nothing.
|
||||
|
||||
The entry the Console reads, in full: `{ scope, agent, file?, last? }`.
|
||||
|
||||
## A5. `no-cited-answer` retires
|
||||
|
||||
`renderItems` and its `NOTICES` (`no-cited-answer`, `no-answer`, `turn-failed`) go. 217 sends the
|
||||
runner's fixed texts as plain bodies (design 5.2, "Runner texts"), and renderReply shows those as free
|
||||
text. Design 7.4 names no other notice than `library-write`, so nothing is lost (sage-3596 item 3).
|
||||
|
||||
## Files
|
||||
|
||||
Both deviations below were accepted in sage-3596 and are named in the manifest for Dewey. The brief owns these:
|
||||
|
||||
- `packages/library/src/render.mjs`: `renderReply` replaces `renderItems`.
|
||||
- `packages/library/src/index.mjs`: the export.
|
||||
- `packages/library/README.md`: the section.
|
||||
- `packages/library/tests/render.test.mjs`.
|
||||
|
||||
It also owns `bus.js`, its stylesheet, `serve.mjs` (only the two routes) and new webui tests. Two
|
||||
deviations, both recorded here:
|
||||
|
||||
- The chat view's message list is `packages/webui/src/public/chat.js:85` (`window.MosaicChat`), not
|
||||
`bus.js`. The reply, notice and Revert rendering goes in `chat.js` and `chat.css`. The status line
|
||||
goes in the chat thread view, so it is also in `chat.js`.
|
||||
- `packages/webui/src/console-bus.mjs` and `cli.mjs` each get one `libraryRevert` line, beside the
|
||||
existing `libraryStatus` wiring.
|
||||
|
||||
## Overlap with row 220 (C2-10a, Researcher, 3ef6da90d)
|
||||
|
||||
220 changes one line each in the webui tests discord.test.mjs, fixture.mjs, history-fixture.mjs,
|
||||
relaunch.test.mjs and return-flow.test.mjs. Its other paths are in control-board, conversation, discord
|
||||
and business. 225 doesn't touch those five files or those packages. Its webui tests are new files.
|
||||
|
||||
## Handoff to Fethry (mos-1501, Q245)
|
||||
|
||||
The row moved to Fethry (Codex, fethry/row225). Everything below is **untested**: no suite or single file
|
||||
has run on it, since a run needs Sage's CLEAR. Each changed file passes `node --check`.
|
||||
|
||||
Done in the handoff commit:
|
||||
|
||||
- `render.mjs` `renderReply(body, {check, changed, name})`; index export; README section;
|
||||
`render.test.mjs` rewritten. `renderItems` is gone from every package.
|
||||
- `serve.mjs`: `/render.mjs` static entry (owner and user file maps), `GET /api/library/status`
|
||||
(one `project` query, answer must name that project), `POST /api/library/revert` (save's boundary,
|
||||
strict `{project, commit}`, refusal shows the code, lost or unusable answer is `outcome-unknown`,
|
||||
never retried). Both are nulled for a granted user, and `userRoute` keeps them owner-only. The tester
|
||||
listener refuses `libraryRevert`.
|
||||
- `bus.mjs`: `library-revert-not-agent: 409`. That re-pins `packages/webui/src/bus.mjs` in
|
||||
`packages/bus/tests/channel-proof.test.mjs`, with a comment line, as row 254 did. It's a third deviation,
|
||||
in another package's test.
|
||||
- `console-bus.mjs` and `cli.mjs`: `libraryRevert`, beside `libraryStatus`.
|
||||
- `chat.js`: dynamic `import('/render.mjs')` (CSP is `script-src 'self'`); body text until it loads.
|
||||
Cites with a scope badge, the agent-written label, "changed since" from `file`/`last`, links only for
|
||||
https with `rel="noopener noreferrer"`. A notice gets a Revert button behind `confirm()`. The library
|
||||
status line goes under the thread heading.
|
||||
- `chat.css`: cite, badge, notice and status styles.
|
||||
- New tests: `packages/webui/tests/library-routes.test.mjs` and
|
||||
`packages/webui/tests/chat-replies-browser.test.mjs`. 220's five files are untouched.
|
||||
|
||||
Decisions made in the build:
|
||||
|
||||
- The library name is the chat project's `repo`. A project with no repo reads no status and its
|
||||
Revert does nothing.
|
||||
- These codes hide the status line: `project-not-declared`, `library-mapping-invalid`,
|
||||
`project-not-configured`, `not-configured` and `owner-only`.
|
||||
- Otherwise every code-repo thread, and every granted user, would show "unavailable".
|
||||
- Cost: a broken library mapping also hides the line. `library.status` from the CLI still shows it.
|
||||
- "Age" is the time since `lastFetch` ("fetched 5 min ago"), not the served commit's age, which the
|
||||
status doesn't carry.
|
||||
- The limits fields are assumed to be `replyLimits {requireCitation, citationsPerReply}` and
|
||||
`replyLimitsFallback [keys]`, and are shown only when present. **Not agreed with 217.** Confirm with
|
||||
Beakley and rename.
|
||||
- A notice body's shape is all the renderer checks. An agent in a business without a library could
|
||||
send a body that looks like a notice. The page would show it, but `library.revert` still refuses it.
|
||||
|
||||
Left:
|
||||
|
||||
1. Get CLEAR and run the webui and library suites, `channel-proof.test.mjs`, and the two new files whole.
|
||||
The browser test's selectors and waits have never run.
|
||||
2. Agree the limits field names with 217 (Beakley).
|
||||
3. Granted-user R6 G5 (`granted-user.test.mjs:252`) lists owner verbs by hand. Add `library.revert`
|
||||
once 288 lands.
|
||||
4. BUILD.md: the mutant list and the mos-1275 timeout plan.
|
||||
5. The manifest names the three deviations: chat.js and chat.css in place of bus.js, the console-bus and
|
||||
cli lines, and the channel-proof re-pin.
|
||||
@@ -0,0 +1,652 @@
|
||||
# PRD 1.17 draft: Case 2 story files are DOCX (Q235 to Q237, P1 to P6)
|
||||
|
||||
Sage, 2026-10-23, for mos-1366 item 1 and Vikunja 570. Draft 9. It is d8 plus Jason's Q41 answer O2 (DECISIONS Q239, mos-1467), which makes J-b yes, Webby's round 5 N15 to N17 (webby-0210) and Webby's round 6 B1, N19 and N20 (webby-0212) (see "d9 changes"). d8 is d7 plus Mos's d8 fix list mos-1443 (see "d8 changes"). d7 is d6 plus Mos's ruling mos-1379 on Fenton's 571 B2 (see "d7 changes"). d6 is d5 with Webby's round 3 (webby-0207) fixed: B1 to B3 and N10 to N13, with N14 left for Mos (see "d6 changes"). d5 folds in:
|
||||
- Mos's d4 check ruling mos-1372 (D1 to D14; D15 was dropped).
|
||||
- mos-1374, which replaces J-c.
|
||||
- The impact map mos-1368 (jason-master-restart d183246, `projects/mosaic-mvp/case2-docx-impact-map.md`: A1 to A16, critic items C1 to C6, items 2 to 7).
|
||||
- Mos's F4 measurement.
|
||||
|
||||
Review order (mos-1367 B5): Webby, then Mos, then Jason. Base: PRD 1.16, `docs/prd/mosaic-stack.md` blob a6db9b4a at 482e865ac.
|
||||
1.16 lands first (row 291), and this text is a new version on top of it. Nothing here is built or queued. The impact map's queue changes (A24, A57 to A59) go through `scripts/mosaic queue` after 1.17 is approved (C9).
|
||||
|
||||
Sources, verbatim in Mos's DECISIONS:
|
||||
- Q235, Jason's Q36 answer.
|
||||
- Q236: chapters are DOCX, Markdown for agent files and docs.
|
||||
- Q237: "It is correct for now (subject to future change)".
|
||||
- The P1 to P6 reading as restated to Jason in Q38.
|
||||
|
||||
## Settled points (mos-1367)
|
||||
|
||||
These stand as ruled. d5 changes only what mos-1372 changed.
|
||||
|
||||
- **O1. Where a converted chapter lives.** The DOCX lives in the writing store of
|
||||
O2 design D12, and the archived Markdown stays in the user's repository under a
|
||||
human-marked archive folder. Ruled yes in B1, on the condition that the text
|
||||
says plainly that a converted chapter leaves the Gitea-mirrored repository and
|
||||
lives in the stack's writing store. mos-1372 D7 and mos-1375 add a remote for
|
||||
the store, off the stack's host.
|
||||
- **O2. The unit of conversion.** One story file per import, refusing a file
|
||||
that is already converted. Ruled yes in B2: each file gets its own fidelity
|
||||
report, human confirmation, manifest and commit.
|
||||
- **O3. Whether conversion is a vocabulary action.** A human-only verb outside
|
||||
the agent vocabulary, with no role grant and no agent request path. Ruled yes
|
||||
in B3.
|
||||
- **O4. Reading archived Markdown.** A new `archived` scope. Lookups leave it out
|
||||
unless the caller asks, every answer marks it archived, and a canon citation
|
||||
can't name it. Ruled yes in B4.
|
||||
|
||||
## d3 choices after mos-1372
|
||||
|
||||
- **C1 is replaced by D1, keep-source-scope.** A DOCX keeps its source's scope:
|
||||
universe, book, and canon or playground. A playground DOCX follows the
|
||||
playground rules and is never returned as canon. The import accepts canon and
|
||||
playground story files. Type-folder files and supporting files stay Markdown
|
||||
(P4). This also settles the impact map's Q18, item 4. It leaves one narrowing
|
||||
for Jason, J-i. A playground DOCX can't become canon in 1.17.
|
||||
- **C2 stands.** The move keeps the file's path under the archive folder:
|
||||
`book1/ch3.md` goes to `<archive>/book1/ch3.md`. An archived file's universe
|
||||
and book are those of its old path.
|
||||
- **C3 is replaced by D3 and D14.** The archive commit is written by a new
|
||||
human-only bus step (Vikunja 571) on the C2-02 write plumbing and pushed through
|
||||
C2-03b. The order is the store commit and the remote's confirmation that it
|
||||
holds that commit, then the archive commit and its push, then publication to the
|
||||
lookups.
|
||||
- **N4 stands.** REQ-LIB-8 says "a real user's books". The PRD names no user
|
||||
anywhere in Case 2.
|
||||
|
||||
## Text changes
|
||||
|
||||
### Status and sources
|
||||
|
||||
In the Status bullet's first line, "- Status: approved, version 1.16." becomes
|
||||
"- Status: approved, version 1.17." Status gains, after the two 1.16 sentences at
|
||||
the end of the bullet: "Version 1.17 records Jason's rulings Q235 to Q237 of
|
||||
2026-10-23: Case 2 story files are DOCX, Markdown stays for agent files and
|
||||
documentation, and a human-started import converts a Markdown story file one way.
|
||||
It also adds REQ-LIB-9, the Console's DOCX editor, from Jason's rulings Q195, Q226
|
||||
and Q234. It changes what Case 2 requirements allow, so Mos puts the text to Jason
|
||||
as written, and it lands only after his yes (mos-1366, Vikunja 570)."
|
||||
|
||||
New source line, above the 1.16 one: "Version 1.17 source: Jason's Q235, answering
|
||||
Q36: 'How about we see a markdown file, we convert the markdown file to docx, then
|
||||
archive or mark the markdown file as converted. The new standard for files in the
|
||||
creating writing use case is to use docx to handle versioning and WYSIWYG. We
|
||||
eliminate the potential for confusion based on the files. Agents must understand
|
||||
which files are what format and where they live. The system must allow for import
|
||||
and conversion. We will not run the systems in parallel. There will be an
|
||||
irreversible conversion of the files.' His Q236 says: 'For creative writing
|
||||
chapters, we need to utilize docx as the standard. Markdown is acceptable for
|
||||
agent files, instructions, PRDs, documentation, etc. The creative writing files
|
||||
should be docx for familiarity for the user.' His Q237 says 'Q38: It is correct
|
||||
for now (subject to future change)', which confirms Mos's reading P1 to P6.
|
||||
REQ-LIB-9 rests on his Q195 request for 'a full WYSIWYG editor within Mosaic
|
||||
Stack', his Q226 answer 'F41: We want to move editing into the WYSIWYG in the
|
||||
WebUI. All changes are instantly committed and available to the agents.' and his
|
||||
Q234 answer 'Q37: yes' to the exact security header for the editor's frame. The
|
||||
storage follows the O2 design D10 to D12 as rewritten under Vikunja 571, at
|
||||
b99ca86b9 on `refactor`."
|
||||
|
||||
### Creative library, section lead
|
||||
|
||||
Replace "The library is the user's own writing repository." with "The library is
|
||||
the user's own writing repository plus the stack's writing store, which holds the
|
||||
DOCX story files (REQ-LIB-8, version 1.17)."
|
||||
|
||||
### REQ-LIB-1
|
||||
|
||||
Add, before "(Design 1.1": "The mapping also names one archive folder, set by the
|
||||
human, where converted Markdown story files go. A book's DOCX story files are in
|
||||
the stack's writing store, under the same universe and book (REQ-LIB-8)." Version
|
||||
tag, inside the closing parenthesis: "Version 1.15: supporting folders.)" becomes
|
||||
"Version 1.15: supporting folders. Version 1.17: the archive folder and the
|
||||
writing store.)"
|
||||
|
||||
### REQ-LIB-2
|
||||
|
||||
Replace "A file's scope comes from its path alone, prefixes first: a Markdown
|
||||
file under a supporting prefix is supporting, one under a playground prefix at
|
||||
any level is playground, any other Markdown file in a book folder is canon, and
|
||||
everything else is unmapped and never returned. A folder in both lists is
|
||||
supporting." with:
|
||||
|
||||
"A Markdown file's scope comes from its path and from past imports, prefixes
|
||||
first: a Markdown file under the archive folder is archived, one under a
|
||||
supporting prefix is supporting, a Markdown file at a converted file's old path is
|
||||
unmapped under REQ-LIB-8 but flagged in the format map, one under a playground
|
||||
prefix at any level is playground, any other Markdown file in a book folder is
|
||||
canon, and everything else is unmapped and never returned. A folder in both lists
|
||||
is supporting. The archive folder follows the same placement rules and may not
|
||||
overlap another prefix or a book folder. An archived file keeps the path it had
|
||||
under the archive folder, and its universe and book are those of that old path. A
|
||||
DOCX document in the writing store keeps its source's scope: the universe, the
|
||||
book if there is one, and canon or playground. Its source is the Markdown file it
|
||||
was converted from or, for one the human starts in the editor, the universe and
|
||||
book or the playground the human picks (REQ-LIB-8). A playground DOCX follows the
|
||||
playground rules and is never returned as canon. It stays playground after its
|
||||
draft universe is made real. In version 1.17 no promotion or mapping change makes
|
||||
a playground DOCX canon. A later version of this PRD says how one becomes canon."
|
||||
|
||||
Replace "Lookups return canon unless the caller asks for playground or
|
||||
supporting." with "Lookups return canon unless the caller asks for playground,
|
||||
supporting or archived. Every answer marks an archived file as archived and names
|
||||
the DOCX that replaced it."
|
||||
|
||||
Replace "so an agent can't cite a playground or supporting file as canon" with "so
|
||||
an agent can't cite a playground, supporting or archived file as canon".
|
||||
|
||||
In REQ-LIB-2 only, replace "The Console shows each cite's scope." with "The Console shows each cite's
|
||||
scope and format, and whether a cited Markdown file was converted."
|
||||
|
||||
Version tag, inside the closing parenthesis: "Version 1.15: supporting.)" becomes
|
||||
"Version 1.15: supporting. Version 1.17: archived scope and DOCX scope.)"
|
||||
|
||||
### REQ-LIB-4
|
||||
|
||||
Replace "The user commits and pushes with their own tools, today Obsidian with
|
||||
obsidian-git." with "The user commits and pushes Markdown with their own tools,
|
||||
today Obsidian with obsidian-git. A converted story file's current text is no
|
||||
longer in that repository, which keeps only its archived Markdown (REQ-LIB-8)."
|
||||
|
||||
Add, after "Bus writes and pushes come in later rows (C2-02, C2-03b).": "A DOCX
|
||||
story file is saved in the Console's editor, and each accepted save is one commit
|
||||
by the human in the stack's writing store (REQ-LIB-9). Each writing-store commit
|
||||
is also pushed to a remote off the stack's host, never by force-push. The remote
|
||||
is a setting only a human changes, and it starts unset. A repository on the
|
||||
stack's host never counts as that remote. A missing remote or a failed push never
|
||||
undoes a save, and the user sees each push that is pending or failed. Only the
|
||||
stack's host pushes to that remote, and no agent can reach it with any credential.
|
||||
Agents read the local commit."
|
||||
|
||||
Replace "Agents read only the mirror's served commit and never hold a copy of
|
||||
their own, so they see the user's push within about a minute." with "Agents read
|
||||
the user's repository only at the mirror's served commit, except a story file
|
||||
during its import under REQ-LIB-8. They read a DOCX story file only at a committed
|
||||
version in the writing store, under REQ-LIB-5. They never hold a copy of their
|
||||
own, so they see the user's Markdown push within about a minute and a DOCX save at
|
||||
their next lookup after the editor reports it as committed."
|
||||
|
||||
Version tag: "and the sync items.)" becomes "and the sync items. Version 1.17,
|
||||
with Q222 for the remote setting.)"
|
||||
|
||||
### REQ-LIB-5
|
||||
|
||||
Add, after "Each answer names the commit it read.": "Each answer also names the
|
||||
file's format and where it lives: its path, or its document id in the writing
|
||||
store. A DOCX story file is read from its latest committed save, never from
|
||||
unsaved text. A lookup that starts after the editor reports a save as committed
|
||||
returns that save or a later one, even while its push to the remote is pending or
|
||||
has failed, and the answer names the version. Get, search and manuscript read a
|
||||
DOCX story file as its extracted text with DOCX locators, never as lines. That
|
||||
text is the file with its tracked changes accepted. An agent reads a story file's
|
||||
comments, or its text with tracked deletions shown, only after a human turns on
|
||||
the matching setting. Both settings are off by default, and only a human changes
|
||||
them. The reader in this version can't read some things a DOCX story file can
|
||||
hold, such as a web link, a text box, a field or hidden text. The editor warns the
|
||||
human when an edit adds one, and the human can still save it. Until a later save
|
||||
takes it out, lookups give agents none of the text of the part that holds it,
|
||||
whether that is the chapter's body, a note or a comment. The manuscript lookup
|
||||
follows the book's chapter order across both formats (O2 design D10), and the next
|
||||
chapter it names is never an archived file. Links out and in resolve across both
|
||||
formats. The universe lookup returns the format map (REQ-LIB-8)."
|
||||
|
||||
Replace "The user sees them in Obsidian's graph and backlinks." with "The user sees
|
||||
a Markdown file's links in Obsidian's graph and backlinks. A DOCX story file's
|
||||
wikilinks stay clickable in the Console's editor (O2 design D11), and no graph
|
||||
shows them yet. The Console's Connections view lists the current links and
|
||||
backlinks of each story file the user may see, in both formats, with each one's
|
||||
scope and format."
|
||||
|
||||
Version tag: 'and "Connections are always visible".)' becomes 'and "Connections
|
||||
are always visible". Version 1.17, with Q222 for the two settings and Q239 for
|
||||
the Connections view.)'
|
||||
|
||||
### REQ-LIB-6
|
||||
|
||||
Replace "A reply may cite lines of the repository at a commit or pages the agent
|
||||
fetched, and the broker checks every citation before it stores the message." with
|
||||
"A reply may cite lines of a Markdown file at a commit, a place in a committed
|
||||
DOCX story file, or pages the agent fetched, and the broker checks every citation
|
||||
before it stores the message. A DOCX citation never calls a paragraph a line. It
|
||||
names the document id, the committed version and a DOCX locator. A citation that
|
||||
names an archived file as current is refused. The `requireCitation` setting below
|
||||
applies to Markdown and DOCX citations alike, and so does the rule for a citation
|
||||
marked as canon."
|
||||
|
||||
Add, after "the broker refuses such a write before any git call.": "The writing
|
||||
store and the archive folder are read-only to a creative agent as well, and the
|
||||
broker's path check treats the archive folder as story. No agent creates, edits,
|
||||
deletes, converts, archives or restores a story file in any format, and no agent
|
||||
writes a DOCX. No creative agent starts or undoes a conversion, and none asks for
|
||||
one through a tool or a decision it raises, as REQ-LIB-8 says. An agent may still
|
||||
suggest a conversion to the human in chat. Each creative role's contract states
|
||||
which files are DOCX and which are Markdown, and cites a DOCX story file by its
|
||||
locator, never by line."
|
||||
|
||||
Version tag, inside the closing parenthesis: "Version 1.15.)" becomes "Version
|
||||
1.15. Version 1.17.)"
|
||||
|
||||
### New REQ-LIB-8
|
||||
|
||||
This bullet goes after REQ-LIB-7 and before the "### Installer" heading.
|
||||
|
||||
"- **REQ-LIB-8.** Story files become DOCX. DOCX is the standard for chapters and
|
||||
the other story text in a Case 2 writing project, canon and playground alike. A
|
||||
story file becomes DOCX through a human's import (below), or when the human
|
||||
starts it in the editor. From then on DOCX is its only working format, edited in
|
||||
the Console's editor (REQ-LIB-9). A Markdown story file stays Markdown until its
|
||||
import. Files in a type folder (REQ-LIB-1), such as character and place notes,
|
||||
stay Markdown. So do supporting files, agent files, instructions, PRDs and
|
||||
documentation, including the character sheets, summaries and cross-links agents
|
||||
keep under REQ-LIB-6.
|
||||
- A converted story file's current text leaves the user's Gitea-mirrored
|
||||
repository. Its DOCX lives in the stack's writing store, on the stack's host,
|
||||
and not in the repository the user pushes or opens in Obsidian. Only its
|
||||
archived Markdown stays there.
|
||||
- An import converts one Markdown story file, canon or playground, outside every
|
||||
type folder (REQ-LIB-1), to a DOCX document in the writing store. It refuses
|
||||
an unmapped, supporting, archived or type-folder file, and a file that is
|
||||
already converted. Each import has its own fidelity report, the human's
|
||||
confirmation of that report, a manifest naming the source file and its commit,
|
||||
and one commit in the store. The DOCX keeps every wiki link of the source as
|
||||
written, and a lost link to another library file fails the fidelity report. A
|
||||
web link becomes plain text that keeps its label and address, and the fidelity
|
||||
report lists it for the human to confirm. A web link that can't be kept safely
|
||||
as plain text refuses the import.
|
||||
- The human can also start a new story file in the editor, in a universe and
|
||||
book or a playground the human picks. It is a DOCX document in the writing
|
||||
store from its first commit, with no Markdown copy, and it opens under the
|
||||
same gate as the import.
|
||||
- The same import marks the Markdown file converted, naming the document, and
|
||||
moves it to the archive folder under its old path (REQ-LIB-1, REQ-LIB-2).
|
||||
The mark and the move are one commit authored by the human in the user's
|
||||
repository. A new human-only bus step (Vikunja 571) on the C2-02 write
|
||||
plumbing writes it, and C2-03b pushes it. The move keeps the bytes and the
|
||||
git history, so it isn't `data.delete`.
|
||||
- The store commit comes first, and the writing store's remote must confirm it
|
||||
holds that commit. Then come the archive commit and its push, then publication
|
||||
to the lookups. Until publication the Markdown at its old path keeps its canon
|
||||
or playground scope. Agents read that file at the commit the import started
|
||||
from, even after the mirror's served commit reaches the archive commit or a
|
||||
later one. No lookup returns the file's archived copy before publication, even
|
||||
one that asks for archived files. A refusal or failure before the archive push
|
||||
leaves the Markdown unmoved and no DOCX that a lookup returns. A failure after
|
||||
the archive push leaves a pending import that the human sees and can resume,
|
||||
never a claim that nothing moved. An archive push whose result is unknown
|
||||
counts as a failure after the archive push until the stack reads the result
|
||||
back from the user's remote.
|
||||
- Each stage of an import writes a logged event. The import's record on the
|
||||
stack's host names the source file's path, commit and blob and the new
|
||||
document id, and each event points to that record.
|
||||
- After a conversion, a Markdown file at the converted file's old path is
|
||||
neither canon nor playground. Lookups leave it out, the format map flags it,
|
||||
and the human is told.
|
||||
- A new Markdown story file in a book folder that holds converted files stays
|
||||
canon until its import, unless it sits at a converted file's old path or under
|
||||
a playground prefix. The Console flags it and offers the import. Nothing
|
||||
converts it on its own.
|
||||
- A hybrid's exclusion that covers a converted file's old path also covers its
|
||||
DOCX document (REQ-LIB-3). An exclusion of a whole book folder also covers
|
||||
every DOCX document in that book, including one started in the editor. An
|
||||
exclusion can also name a DOCX document by its id.
|
||||
- Only a human starts an import or a new story file, from the CLI or a Console
|
||||
session signed in as that human. Both are human verbs outside the agent action
|
||||
vocabulary. Neither is added to `ACTIONS` in the business vocabulary or to the
|
||||
broker's always-gated list, including the import's action, `library.convert`.
|
||||
No role holds them, no agent can request them, and the hard-wait list in
|
||||
REQ-WAIT-1 doesn't change. In an organization with several humans, who may
|
||||
start them is a setting only a human changes, and the default is the owner
|
||||
only.
|
||||
- Conversion is one way, with no parallel run. Neither the Console nor any agent
|
||||
edits a converted story file as Markdown, and no DOCX edit syncs back to
|
||||
Markdown. The Console's Markdown save refuses every file under the archive
|
||||
folder. The user's own tools can still change the archived Markdown, and no
|
||||
such change reaches the DOCX. The old Markdown stays in git history, and
|
||||
nothing rewrites history. A promotion into a book folder (C2-19) runs the
|
||||
import for a Markdown story file or is refused. A promotion of a playground
|
||||
DOCX is refused in version 1.17.
|
||||
- Agents get a format map: for each mapped folder and story file, its format,
|
||||
scope and where it lives, archived files, flagged files and pending imports
|
||||
included.
|
||||
- The import and new story files ship closed. They open only after four things.
|
||||
The editor ships. The human has set the writing store's remote, and the stack
|
||||
has checked that it can push there. Agents can read committed DOCX story files
|
||||
through the lookups and cite them (REQ-LIB-5, REQ-LIB-6). Any earlier agent
|
||||
system that writes the user's files has stopped, which for Case 2 is the
|
||||
Hermes retirement (#423 step 5). So the import itself never cuts agents off
|
||||
from a chapter, the chapter's current text never lives only on the stack's
|
||||
host, and no second system writes the story. The first import of a real user's
|
||||
books waits for Jason's go.
|
||||
(Q235, Q236, Q237: P1 to P6. Q222 for the setting. O2 design D10 to D12.
|
||||
Version 1.17.)"
|
||||
|
||||
### New REQ-LIB-9
|
||||
|
||||
This bullet goes after REQ-LIB-8.
|
||||
|
||||
"- **REQ-LIB-9.** The Console's DOCX editor. The human edits a DOCX story file in
|
||||
the Console's editor, in a split pane with the agent chat alongside it. The
|
||||
human can pin an agent chat to a document. The human can select a word,
|
||||
right-click it, and choose a synonym from a thesaurus. Only a human saves. Saves
|
||||
happen on their own while the human types (Q226), at intervals only a human
|
||||
changes, and each accepted save is one commit with the human as author, pushed
|
||||
as REQ-LIB-4 says. A save made against an older version than the current one is
|
||||
refused. Agents never write a DOCX. Versioning is the editor's tracked changes
|
||||
plus one git commit per save. The editor's code is vendored and pinned, with a
|
||||
hash per file and the licenses that its independent security review accepted. At
|
||||
runtime the editor loads only files that the stack itself serves, and it
|
||||
requests nothing from any other host. The editor's frame sends exactly the
|
||||
content security policy Jason approved in Q234, and the WebUI shell's own header
|
||||
is unchanged. REQ-PROJ-3's project docs editor is unchanged. (Q195, Q226, Q234,
|
||||
Q236. O2 design D3, D4, D6, D8, D10, D13, D14, D16 and D22. Version 1.17.)"
|
||||
|
||||
### Version 1.17 notes
|
||||
|
||||
Added after the 1.16 notes:
|
||||
|
||||
"- Version 1.17:
|
||||
- Jason confirmed the reading 'for now (subject to future change)' (Q237). The
|
||||
rulings stand until he revises them.
|
||||
- The 10-27 Case 2 release ships on Markdown as built (P6). The 1.11 line 'The
|
||||
Case 2 MVP for 10-27 is the Markdown library (#416). The WYSIWYG editor (Q195,
|
||||
Q196) is an add-on that doesn't gate it.' still holds. Conversion opens after
|
||||
10-27, and only once REQ-LIB-8's four conditions are met. The editor ships,
|
||||
the writing store's remote is set and the stack has checked that it can push
|
||||
there, agents can read and cite committed DOCX story files through the
|
||||
lookups, and Hermes is retired, which is #423 step 5.
|
||||
- The 1.12 note says five bus write and Console editor rows, C2-02, C2-03b,
|
||||
C2-11a, C2-11b and C2-19, don't gate 10-27. Jason's Q226 F42 later moved
|
||||
C2-02, C2-03b and C2-11b into the 10-27 slice. The Case 2 design brings C2-11a
|
||||
in with them, because C2-11b needs it. C2-19 stays outside the slice. Mos's
|
||||
reading of F42 is that C2-02 and C2-03b now gate 10-27, because design 9.2
|
||||
puts them in 'the smallest slice that lets her start'. C2-11a and C2-11b are
|
||||
slice rows that still don't gate 10-27, because the editor is the Q195 add-on.
|
||||
The DOCX change in 1.17 leaves this slice as it is, and C2-11b's Markdown
|
||||
editor never edits a converted story file.
|
||||
- Q236 narrows Q176's editor choice to DOCX for story files (REQ-LIB-9). The
|
||||
1.12 note that the Case 2 design keeps Obsidian now holds only for Markdown
|
||||
files, including story files not yet imported. A DOCX story file is edited
|
||||
only in the Console's editor under REQ-LIB-9.
|
||||
- This replaces two parts of the O2 design at 25c09f19f. The superseded-notice
|
||||
proposal from Fenton's F1 in D12 is withdrawn, and the
|
||||
keep-Markdown-at-its-path model of D11 is replaced. Gyro's rewrite of the O2
|
||||
design for Vikunja 571, landed on `refactor` at b99ca86b9, carries the
|
||||
details, and where it differs from this text, this text holds:
|
||||
- the import and archive steps, the mark, and the new bus step;
|
||||
- links from supporting files to a moved chapter;
|
||||
- the DOCX reader;
|
||||
- the user's unpushed or later changes to an archived file or at its old path,
|
||||
and pushing and closing the file in Obsidian before each import;
|
||||
- the writing store's remote in W4 section 7.3, which replaces the no-remote
|
||||
and no-backup rule that W4 section 7.4 held before the rewrite, at
|
||||
062646487;
|
||||
- import events counted by a bus restore, and recovery when a bus restore or a
|
||||
restore of the whole host predates an import;
|
||||
- manifest order for the manuscript lookup and its next chapter;
|
||||
- `library.convert` kept out of `ACTIONS`, out of the hard-wait note and out
|
||||
of the pinned `GATED_ONLY` list in packages/business/src/vocabulary.mjs.
|
||||
- Agents read a converted story file through the Case 2 lookups under the same
|
||||
project and universe access as Markdown canon, in any thread or room. W4's
|
||||
earlier O2-only conversations, per-document grants and per-send sharing don't
|
||||
gate these lookups. The 571 rewrite replaced them in W4 sections 7.1 and 7.2.
|
||||
The creative tool list in REQ-LIB-6 doesn't change.
|
||||
- The six creative role contracts row 213 landed say 'Every item cites the
|
||||
lines of the user's material it is about'. A build row under 571 changes that
|
||||
line for DOCX story files (REQ-LIB-6).
|
||||
- A new Markdown file in a book folder is still canon in 1.17. The 1.17
|
||||
exception is a file at a converted file's old path, which REQ-LIB-2 makes
|
||||
unmapped.
|
||||
- Story files convert whether canon or playground. Type-folder and supporting
|
||||
files stay Markdown.
|
||||
- Measured 2026-10-23 at about 01:21Z: the Case 2 user's library repository
|
||||
tracks 213 files, 203 of them Markdown, and none is a .docx or .doc. It has no
|
||||
untracked files. The user's .doc files (Q196) are outside it. So the landed
|
||||
code has no DOCX there to report as unreadable at 10-27.
|
||||
- Text replaced in 1.17, kept here as in earlier notes:
|
||||
- Creative library lead, the 1.16 sentence: "The library is the user's own
|
||||
writing repository."
|
||||
- REQ-LIB-2, the 1.16 sentences: "A file's scope comes from its path alone,
|
||||
prefixes first: a Markdown file under a supporting prefix is supporting,
|
||||
one under a playground prefix at any level is playground, any other
|
||||
Markdown file in a book folder is canon, and everything else is unmapped
|
||||
and never returned. A folder in both lists is supporting." "Lookups return
|
||||
canon unless the caller asks for playground or supporting." "so an agent
|
||||
can't cite a playground or supporting file as canon" "The Console shows
|
||||
each cite's scope."
|
||||
- REQ-LIB-4, the 1.16 sentences: "The user commits and pushes with their own
|
||||
tools, today Obsidian with obsidian-git." "Agents read only the mirror's
|
||||
served commit and never hold a copy of their own, so they see the user's
|
||||
push within about a minute."
|
||||
- REQ-LIB-5, the 1.16 sentence: "The user sees them in Obsidian's graph and
|
||||
backlinks." A converted chapter's connections show in Obsidian only as they
|
||||
stood at conversion, and the Console's Connections view shows their
|
||||
current links.
|
||||
- REQ-LIB-6, the 1.16 sentence: "A reply may cite lines of the repository at
|
||||
a commit or pages the agent fetched, and the broker checks every citation
|
||||
before it stores the message."
|
||||
- REQ-LIB-1 only gains sentences.
|
||||
- REQ-LIB-3's text and REQ-LIB-7 are unchanged. REQ-LIB-8 adds one form of
|
||||
exclusion REQ-LIB-3 doesn't have: naming a DOCX document by its id. A path
|
||||
exclusion also covers DOCX documents, through a converted file's old path or a
|
||||
whole book folder. An archived file and a DOCX document keep a universe, and a
|
||||
book where their source has one, so every lookup still names one universe.
|
||||
REQ-PROJ-3, the Console editor for a project's spec and docs, is unchanged.
|
||||
C2-11b opens the library's Markdown files in that same editor.
|
||||
- In `packages/tasks/requirements.json` the titles of REQ-LIB-1, REQ-LIB-2 and
|
||||
REQ-LIB-4 change, and those of REQ-LIB-5 and REQ-LIB-6 stay. REQ-LIB-1 becomes
|
||||
'A human-set library maps the user's repository onto universes, books, types,
|
||||
playgrounds, supporting and archive folders'. REQ-LIB-2 becomes 'Scope comes
|
||||
from the path or a DOCX's source, lookups default to canon, and only canon
|
||||
files are ever cited as canon'. REQ-LIB-4 becomes 'Git holds every change. The
|
||||
bus fast-forwards a read-only mirror every 60 seconds, the one place agents
|
||||
read Markdown'. REQ-LIB-8 and REQ-LIB-9 add two ids, so the count goes from 85
|
||||
to 87. REQ-LIB-8 is titled 'Case 2 story files become DOCX by a human-only
|
||||
one-way import or in the editor; Markdown stays for notes and docs', and
|
||||
REQ-LIB-9 'The Console's DOCX editor: only a human saves, each save is one
|
||||
commit, and the editor code is vendored and pinned'.
|
||||
- Open points O1 to O4 of draft 1 were ruled by Mos in mos-1367 B1 to B4.
|
||||
- Sage files the build rows under Vikunja 570 and 571 after the rewrite is
|
||||
approved. This amendment adds the requirements only."
|
||||
|
||||
### Risks
|
||||
|
||||
The new lines go at the end of "## Risks and open questions", after the bullet
|
||||
that begins "Trusted mode lets an agent" and before the "## Milestones" heading.
|
||||
- "A DOCX file is a zip archive, so git can't show a line diff of a chapter.
|
||||
Review of a story change goes through the editor and the committed reader,
|
||||
not `git diff`. (Version 1.17.)"
|
||||
- "A converted chapter's DOCX is not in Obsidian's graph. Obsidian shows the
|
||||
chapter only through its archived Markdown, and no DOCX edit reaches that file's
|
||||
links. The DOCX's current links show in the Console's editor and its
|
||||
Connections view, and no graph shows them yet. (Version 1.17.)"
|
||||
- "Conversion can't be undone in place. Front matter, wiki link forms and
|
||||
unsupported blocks may not survive it, and the mirror can't refuse the user's
|
||||
push to an archived file. The controls are the fidelity report, the human's
|
||||
confirmation, an untouched original on refusal, and the kept archive.
|
||||
(Version 1.17.)"
|
||||
- "A restore of the stack's bus alone from a backup taken before an import drops
|
||||
the import's logged events, while the archive commit and the DOCX stay. A
|
||||
restore of the stack's whole host from such a backup also takes the writing
|
||||
store and the host's import records back to before the import. The archive
|
||||
commit stays in the user's Gitea repository and the DOCX stays on the writing
|
||||
store's remote, but the host keeps no record of the import. A bus restore counts
|
||||
import events, and the import's recovery covers both cases (Vikunja 571).
|
||||
(Version 1.17.)"
|
||||
|
||||
## d9 changes (Q239 and Webby round 5)
|
||||
|
||||
- J-b yes (Q239, mos-1467), in the five edits mos-1443 R3 set for a yes (Webby round 6 B1). R3.1: REQ-LIB-5's replacement gains the Connections view sentence after "no graph shows them yet.". R3.2: the graph Risks line ends with the editor and the Connections view. R3.3: the A6 line moves from "Not taken" under A6. R3.5: the REQ-LIB-5 note ends with the Connections view, which drops "until a Console view of their links exists" and "Q226 records that view as a later option". R3.4 is Gyro's design edit at 767bb62c7 (writing-editor.md:188-190, :240-244 and :1272, docx-citations.md:66), and it follows in his docs round. Beyond these and N21, nothing else in the PRD text changes.
|
||||
- N19 and N20 (Webby round 6): J-b's question text is in the past tense, and the line that the import doesn't wait for the view is cited as Mos's R3 default. Mos confirmed it at his J-b check (mos-1470).
|
||||
- N21 (Webby round 6, Mos yes in mos-1470): REQ-LIB-5's version tag cites Q239 for the Connections view beside Q222 for the two settings.
|
||||
- N15: the D7 landing line gives R8's wording beside the impact map's quote.
|
||||
- N16: the d7 changes line notes that R8 replaces "no agent credential reaches it" in d8.
|
||||
- N17: the REQ-LIB-2 Replace quote and the REQ-LIB-8 old-path bullet are rewrapped under 82 columns. Their words are unchanged.
|
||||
|
||||
## d8 changes (Mos's d8 fix list, check wf_63bba879-180)
|
||||
|
||||
- R1: REQ-LIB-4's tail covers DOCX saves, which agents see at their next lookup after the editor reports them as committed. The notes quote the whole 1.16 sentence. Source: nit/jason/F10.
|
||||
- R2: REQ-LIB-4's new title says the mirror is "the one place agents read Markdown". Source: decisions.n14.
|
||||
- R3: J-b asks whether 1.17 requires the Console Connections view, with Mos's recommendation of yes. Sources: mos1372/F9, jason/F2, anchors/F5.
|
||||
- R4: C2-02 and C2-03b gate 10-27, C2-11a and C2-11b are slice rows that don't, and "F42 wins" is gone. New J-k. Sources: anchors/F6, jason/F5.
|
||||
- R5: where the landed 571 design differs, this text holds. Sources: anchors/F8, adversarial/F8 item 1, jason/F8, critic/C6, G16's design follow-on.
|
||||
- R6: `library.convert` stays out of `ACTIONS`, and REQ-WAIT-1's hard-wait list doesn't change. Sources: gyro571/F1, adversarial/F8 item 3, critic/C6.
|
||||
- R7: a repository on the stack's host never counts as the writing store's remote, and Item 2 says so. Sources: mos1372/F2, adversarial/F1, gyro571/F2.
|
||||
- R8: "no agent credential reaches it" becomes "no agent can reach it with any credential". Source: Fenton's B1 under mos-1379.
|
||||
- R9: no playground DOCX becomes canon in 1.17, and a promotion of one is refused. New J-i. Sources: mos1372/F8, adversarial/F2.
|
||||
- R10: REQ-LIB-9 restates Q195's pin and right-click thesaurus, and its cite gains D4 and D22. Source: critic/C4.
|
||||
- R11: REQ-LIB-9's license bar is the licenses its independent security review accepted. New J-l. Source: critic/C3.
|
||||
- R12: no text for D16's narrow-window tabs. Mos records that reading in STATE. Sources: jason/F1, second verifier vote.
|
||||
- R13: no lookup returns a file's archived copy before publication. Source: adversarial/F5 part 3.
|
||||
- R14: a restore of the whole host from a backup taken before an import is a fourth recovery case. Source: adversarial/F6.
|
||||
- M1: REQ-LIB-4's writing-store sentences follow the later bus rows sentence and add the off-host remote rules and DOCX read timing. The note quotes both 1.16 sentences. Sources: mos1372/F2, adversarial/F1, gyro571/F2, anchors/F4, nit/jason/F10, adversarial/F5 part 1, Fenton B1.
|
||||
- M2: REQ-LIB-8's order bullet adds the remote's confirmation, the old-path read rule and "archive push". Sources: mos1372/F2 and the other remote findings, mos1372/F7, adversarial/F5 parts 2 to 4.
|
||||
- M3: REQ-LIB-8's gate bullet has four conditions, adding the remote. Sources: the remote findings, critic/C1 and C2 edit 2.
|
||||
- M4: the 1.17 note on when conversion opens restates the four conditions and drops W4b. Sources: jason/F5, the remote findings.
|
||||
- M5: Item 2 rewritten with the remote rules. Sources: the remote findings.
|
||||
- M6: the 1.12 gating note rewritten. Sources: anchors/F6, jason/F5.
|
||||
- M7: REQ-LIB-9 gains the split pane, the pin, the thesaurus, the license bar and the runtime load rule, and cites more of the design. Sources: jason/F1, critic/C4, critic/C3, nit/anchors/F12, nit/gyro571/F9.
|
||||
- M8: REQ-LIB-2, the one-way bullet and the C1 note keep a playground DOCX out of canon in 1.17. Sources: mos1372/F8, adversarial/F2.
|
||||
- M9: REQ-LIB-5 says what the reader can't read, and the import turns web links into plain text. New J-j. Sources: critic/C1, critic/C2.
|
||||
- M10: an exclusion of a whole book folder covers that book's DOCX documents. Source: adversarial/F3, with B5.
|
||||
- M11: the human-verbs sentence and the 571 list item name `library.convert` and REQ-WAIT-1. Sources: gyro571/F1, adversarial/F8 item 3, critic/C6.
|
||||
- M12: J-b rewritten. Sources: mos1372/F9, jason/F2, anchors/F5, gyro571/F3, critic/C6.
|
||||
- M13: J-d puts the agent read model to Jason as his call. Source: mos1372/F1.
|
||||
- M14: Status moves to version 1.17 and names REQ-LIB-9. Sources: anchors/F2, mos1372/F4, critic/C7.
|
||||
- M15: the 1.17 source line quotes Q235 in full (mos-1446) and the REQ-LIB-9 sources, at b99ca86b9. Sources: critic/C5, anchors/F9, jason/F8 pin part, nit/gyro571/F8, critic/C6 pin part.
|
||||
- M16: the 571 list lead names the two replaced design parts and the landed design. Sources: anchors/F9, anchors/F8, adversarial/F8 item 1, jason/F8, critic/C6.
|
||||
- Landing swap: Gyro's docs round for R5, R6 and R14 landed as b99ca86b9 (Fenton fenton-0015), so M15 and M16 cite b99ca86b9 in place of 767bb62c7, as the d8 fix list's header says. J-b keeps 767bb62c7 for its line numbers.
|
||||
- M17: W4 section numbers in the remote item and the lookups note. Sources: gyro571/F5, nit/adversarial/F11.
|
||||
- M18: the D7 landing line. Sources: gyro571/F5, the remote findings.
|
||||
- M19: a logged event for each import stage, in REQ-LIB-8 and A2. Source: gyro571/F7.
|
||||
- M20: the Risks line on restores adds the whole-host case. Sources: adversarial/F6, gyro571/F7.
|
||||
- M21: the 571 restore item adds the whole-host case. Source: adversarial/F6.
|
||||
- M22: the graph Risks line and the REQ-LIB-5 note name a Console view. Sources: anchors/F5, jason/F2.
|
||||
- M23: the d6 B3 line drops "F42 wins". Source: anchors/F6.
|
||||
- M24: new Markdown in a converted book, with the old-path and playground exceptions. Source: mos1372/F6.
|
||||
- M25: J-c's last sentence is Mos's reading. Source: mos1372/F10.
|
||||
- M26: J-h rewritten with the D13 defaults. Source: jason/F3.
|
||||
- M27: Item 4 rewritten. Sources: jason/F4, gyro571/F4, decisions.unmarked_folders.
|
||||
- M28: the "Not taken" note on unmarked folders. Sources: jason/F4, gyro571/F4, decisions.unmarked_folders.
|
||||
- M29: the import refuses an unmapped file. Sources: gyro571/F4, decisions.unmarked_folders.
|
||||
- M30: placement notes for REQ-LIB-8, REQ-LIB-9 and the Risks lines. Sources: anchors/F3, nit/anchors/F14.
|
||||
- M31: REQ-LIB-4's title and the D11 landing line. Source: decisions.n14.
|
||||
- M32: the Q236 note limits the 1.12 Obsidian note to Markdown files. Source: critic/C8.
|
||||
- M33: the exclusion note adds path exclusions of DOCX documents. Source: anchors/F7.
|
||||
- M34: A9 moves from "Mine" to the impact-map list. Source: decisions.exclusion_by_id.
|
||||
- M35: the D5 landing line. Sources: anchors/F10, mos1372/F5, nit/adversarial/F12.
|
||||
- M36: the D9 and D14 landing lines. Source: mos1372/F1.
|
||||
- M37: the O1 and C3 notes add the off-host remote and its confirmation. Sources: the remote findings.
|
||||
- M38: the REQ-PROJ-3 note. Source: nit/anchors/F11.
|
||||
- M39: REQ-LIB-5's freshness sentence keys on the editor reporting a save as committed. Source: nit/adversarial/F9.
|
||||
- M40: REQ-LIB-6 bars agent requests for a conversion and allows a suggestion in chat. Source: nit/jason/F9.
|
||||
- M41: REQ-LIB-2's opening and old-path rule, and the "Mine" note. Source: nit/adversarial/F10.
|
||||
- M42: REQ-LIB-8's lead sentence on Markdown story files. Source: nit/mos1372/F12.
|
||||
- M43: REQ-LIB-6's citation sentence. Source: nit/anchors/F13.
|
||||
- M44: REQ-LIB-5's version tag uses plain quotes. Source: nit/anchors/F15.
|
||||
- M45: reference codes B5, D12, D10 and B4 name their source. Source: nit/mos1372/F11.
|
||||
- Files the row would own: four files, with the id count going to 87. Sources: anchors/F1, adversarial/F4, decisions.n14 F4.
|
||||
|
||||
## d7 changes (mos-1379, Fenton's 571 B2)
|
||||
|
||||
- REQ-LIB-5 gains Mos's three sentences after the extracted-text sentence. The text agents read has tracked changes accepted. Comments, and text with tracked deletions shown, each wait for a setting only a human turns on, off by default. Its version tag cites Q222 for the two settings, which is the only text here beyond Mos's.
|
||||
- J-d gains Mos's sentence on comments and tracked deletions.
|
||||
- Fenton's B1 is design only. d6's "no agent credential reaches it" holds (R8 replaces it in d8), and the shared helper stays #431.
|
||||
|
||||
## d6 changes (Webby round 3, webby-0207)
|
||||
|
||||
- B1: titles for REQ-LIB-8 and REQ-LIB-9 in the requirements.json note and the file list. REQ-LIB-9 takes Webby's title. REQ-LIB-8 keeps mine, because Webby's ("...one-way import that archives the Markdown under its old path") leaves out D2's story files started in the editor.
|
||||
- B2: REQ-LIB-2 makes a Markdown file at a converted file's old path unmapped, ahead of the playground and canon rules, so a playground conversion is covered too. REQ-LIB-8's old-path bullet says "neither canon nor playground".
|
||||
- B3: the slice note names Q226 F42's three rows (C2-02, C2-03b, C2-11b). C2-11a joined the slice with C2-11b, because C2-11b needs it. Both are slice rows that don't gate 10-27, as design 9.2, case2-rows.md:1655 and the impact map's A57 say. The 'F42 wins' sentence is gone from the note in d8, so no queue change follows from it.
|
||||
- N10: the cite-scope replacement is scoped to REQ-LIB-2. The 1.14 note's copy stays.
|
||||
- N11: the notes say REQ-LIB-8 adds the by-id exclusion form REQ-LIB-3 doesn't have.
|
||||
- N12: J-h marks the autosave intervals for Jason.
|
||||
- N13: J-b names REQ-LIB-5's "Connections are always visible" tag and Q226's "another way to handle the visual brain map".
|
||||
- N14, not taken: REQ-LIB-4's title stays internal F3's text, as mos-1372 D11 ruled. Webby's alternative, "...and agents read Markdown from it alone" (120 chars), is Mos's call.
|
||||
|
||||
## Where each mos-1372 item landed
|
||||
|
||||
- D1: REQ-LIB-2's DOCX sentences, the REQ-LIB-8 lead and import bullet, C1 above, and the notes. "Playground files stay Markdown in 1.17" is gone.
|
||||
- D2: REQ-LIB-2's "for one the human starts in the editor" and the REQ-LIB-8 new-story-file bullet. The universe-and-book note is now true.
|
||||
- D3: the REQ-LIB-8 order bullet. This also settles N8.
|
||||
- D4: REQ-LIB-8's one-way bullet, which carries the archive refusal and consequence F2's text, and the 571 list item.
|
||||
- D5: it landed in REQ-LIB-2's "a Markdown file at a converted file's old path is unmapped" in Webby's B2 form, and in the REQ-LIB-8 old-path bullet.
|
||||
- D6: REQ-LIB-5's freshness sentences.
|
||||
- D7 and mos-1375: REQ-LIB-4's remote sentences, the remote step in REQ-LIB-8's order bullet, the fourth opening condition and the 1.17 note on when conversion opens, plus the 571 list item on W4 section 7.3, which replaces the no-remote rule of the old W4 section 7.4. The impact map's item 2 adds "only the stack's host pushes, and no agent credential reaches it", which R8 words in d8 as "no agent can reach it with any credential".
|
||||
- D8: the REQ-LIB-5 replacement, the import bullet's wiki-link sentence, the Risks line, the note quoting the old sentence, and "REQ-LIB-1 only gains sentences".
|
||||
- D9: the 1.17 note that agents read a converted story file through the Case 2 lookups, from the d4 check's consistency B2, and J-d, which puts the read model to Jason as his call.
|
||||
- D10: the d4 check's B5 sentence, in REQ-LIB-8.
|
||||
- D11: internal F3's clause in the REQ-LIB-4 section, and in the notes the title as Mos amended it for N14.
|
||||
- D12: the whole 1.16 sentence replaced, and quoted in full in the notes.
|
||||
- D13: consequence F1's text, in REQ-LIB-4 and REQ-LIB-8's first bullet.
|
||||
- D14: the row text from the d4 check's consistency B1, in the mark-and-move bullet and C3 above.
|
||||
|
||||
## What d5 adds beyond mos-1372 (for Webby and Mos to check)
|
||||
|
||||
From the impact map, folded as mos-1368 item 1 asked:
|
||||
- A1: the Console shows a cite's format and converted state (REQ-LIB-2).
|
||||
- A2: the logged events and the several-humans setting, default owner only, under Q222.
|
||||
- A3: the import is outside the vocabulary, the hard-wait list is unchanged, and the archive move isn't `data.delete`. The C6 code site is in the 571 list.
|
||||
- A4: the section lead and REQ-LIB-1's writing-store sentence.
|
||||
- A6: format and location in every answer, extracted text with DOCX locators, links across formats.
|
||||
- A6's named chapter-links view. D8 took B8's "no graph shows them yet", and J-b put the view to Jason. His O2 (Q239) takes it in d9 as REQ-LIB-5's Connections view (mos-1443 R3).
|
||||
- A7: read-only extends to the store and the archive, no agent action on a story file in any format, no agent DOCX write, and role contracts state the formats. C1's role contract line is a 571 build item.
|
||||
- A8: the DOCX cite shape, and a cite naming an archived file as current is refused.
|
||||
- A9: a hybrid sees a source's DOCX canon through REQ-LIB-2's source scope, and REQ-LIB-8 lets an exclusion name a DOCX document by its id. The id form lets the human exclude a single DOCX started in the editor, which has no old path. An archived file isn't canon, so no hybrid sees it.
|
||||
- A10: REQ-LIB-9, so the count is 87, not 86.
|
||||
- A11: the Hermes gate, from item 3.
|
||||
- A12: the C2-19 promotion sentence.
|
||||
- A13: the broker's path check treats the archive folder as story.
|
||||
- A14 and C5: two Risks lines.
|
||||
- A15: the flagged-new-file bullet. It sits beside the note from the d4 check's B4, "a new Markdown file in a book folder is still canon". The file stays canon and is offered for import.
|
||||
- A16: three titles change and two stay.
|
||||
- C2: manifest order for the manuscript lookup.
|
||||
- F3: the C2-02 gating note.
|
||||
- F4: Mos's measurement.
|
||||
|
||||
Mine, beyond either source:
|
||||
- REQ-LIB-2 opens "A Markdown file's scope comes from its path and from past imports". DOCX scope comes from the source, so "a file's" would be false.
|
||||
- REQ-LIB-9's autosave sentence. It is Mos's reading of F41's "instantly committed", with human-set intervals. The exact intervals stay in the design.
|
||||
|
||||
Not taken:
|
||||
- Impact map item 4's "files in unmarked folders are eligible one at a time", for folders outside every book folder and playground only. Their files are unmapped under REQ-LIB-2, so a DOCX made from one would have no universe or book to keep. The human maps such a folder into a book folder or a playground first, under REQ-LIB-1. A file in an unmarked folder inside a book folder or a playground is canon or playground, and the import takes it one file at a time.
|
||||
|
||||
## Marked for Jason (additions in the text he sees)
|
||||
|
||||
- J-a. Whether "We will not run the systems in parallel" applies per chapter or as one switch per book. His call. As written, it applies per chapter.
|
||||
- J-b. A converted chapter's DOCX is not in Obsidian's graph. Obsidian shows the chapter only through its archived Markdown, and no DOCX edit reaches that file's links. REQ-LIB-5 still cites two TARGET lines, "Visualization of data via Obsidian or equivalent is required" and "Connections are always visible". Mos's reading was that 1.17 as d8 wrote it met neither line for converted chapters. Their current links showed to the user only as clickable text inside the editor, and no graph or list showed them. Q226 leaves room for "another way to handle the visual brain map". The O2 design that landed for Vikunja 571 at 767bb62c7 held a Console Connections view and its tests as later work that waited for this answer. His call was whether 1.17 requires that view. As d8 was written, it did not. Mos recommended that it does, because impact map A6 says "Recommended: name the view" and TARGET says "Connections are always visible". Jason answered O2 (Q239): 1.17 requires the view. d9 writes it into REQ-LIB-5, its note and the Risks line, in the text of mos-1443 R3. The view comes with the conversion work after 10-27, and the 10-27 Case 2 release stays on Markdown (Q235 P6, Q237). That the import does not wait for the view is Mos's default in mos-1443 R3. Q239 doesn't address it, and Mos confirmed it at his J-b check (mos-1470).
|
||||
- J-c (mos-1374): "The store pushes to a remote (D7), and the Case 2 VM is in the nightly PBS backup. For a fixed restore point before her first real import, a manual backup of VM 1012 with PBS protect runs first. That step is reversible and needs no reboot." Mos's reading is that this sits inside the P5 go step, so it needs no new question.
|
||||
- J-d. How agents read a converted chapter, D9. His call. As written, an agent reads it through the ordinary Case 2 lookups in any thread or room, under the same project and universe access as Markdown canon. This is Mos's reading of F41 and REQ-LIB-7. The other choice is the model in the earlier O2 design, W4 sections 7.1 and 7.2. Under it, an agent reads a converted chapter only in a new writing conversation that holds one human and one agent, only after the business owner grants that agent access to that document, and by default only what the human attaches to each message. Comments and tracked deletions stay hidden from agents until a human turns on a setting for each. Markdown has neither, so the default keeps agents at the access Markdown gives them. Those two sentences are Mos's ruling mos-1379. A yes to the text as written settles it.
|
||||
- J-e. Versioning means the editor's tracked changes plus one git commit per save.
|
||||
- J-f. A converted chapter can be edited only in the Console while the stack is reachable. Obsidian no longer edits it offline.
|
||||
- J-g. The import takes Markdown only. Importing .doc files stays a separate task.
|
||||
- J-h. Autosave under REQ-LIB-9. Jason's Q226 F41 says "All changes are instantly committed and available to the agents." Mos's reading, recorded with that ruling, is "Each save is a commit at once, and agents read it at their next lookup." At the O2 design's D13 defaults, a save commits at most 2 seconds after a pause in typing or 15 seconds into steady typing, with no human action needed. Mos's reading in mos-1359 counts that delay as "instantly committed". Only a human changes the intervals. The PRD names no values, and the defaults stay in the design. Whether a delay of seconds fits his word "instantly" is his call, so this is marked for him.
|
||||
- J-i. In 1.17 a playground story that is DOCX can't become canon. That covers a playground Markdown file the human imports, a story the human starts in a playground in the editor, and the DOCX of a draft universe after it is made real. Today Melanie promotes a playground file by moving it into a book folder in Obsidian, and a DOCX in the writing store can't be moved that way. She can start a new story in the book and paste the text in, but it gets a new document id and the playground copy keeps the history. A later version adds DOCX promotion with C2-19, which comes after the slice.
|
||||
- J-j. Web links, text boxes and fields in a converted chapter. Jason's Q226 F41 says "All changes are instantly committed and available to the agents." The reader in this version can't read a web link, a text box, a field or hidden text. As written, the import turns each web link into plain text that keeps its label and address, and the human confirms that in the fidelity report. A web link that can't be kept safely as plain text refuses the import. If a later edit adds one of these, the save keeps it and the editor warns the human. Agents then get none of that part's text until a save takes it out.
|
||||
- J-k. The 1.12 note Jason approved says bus writes, C2-02 and C2-03b, don't gate 10-27. His Q226 "F42: ok" moved them into the 10-27 slice, and design 9.2 counts them in the smallest slice that lets Melanie start. Mos reads that as making them gate 10-27. The editor rows C2-11a and C2-11b still don't gate it, per his Q195 words "we need to get it moving as an add-on".
|
||||
- J-l. REQ-LIB-9 does not use REQ-PROJ-3's "permissive license" bar. It takes the licenses that the editor's independent security review accepted, because that review cleared fonts under the SIL Open Font License and the Ubuntu Font License, which not every reader counts as permissive. Mos's reading.
|
||||
|
||||
Marked as changes beyond P1 to P6, from the impact map (Q17, item 5):
|
||||
- A1 (archived scope and canon cites)
|
||||
- A2 (the conversion requirement, REQ-LIB-8)
|
||||
- A3 (outside the vocabulary, hard-wait list unchanged)
|
||||
- A6 (lookups across formats)
|
||||
- A7 (agent bounds)
|
||||
- A8 (DOCX cites)
|
||||
- Item 2 and mos-1375: each writing-store commit is pushed to a remote off the stack's host. Only a human sets it, it starts unset, and a repository on the stack's host doesn't count. Only the stack's host pushes to it, and no agent can reach it with any credential. Import and new story files stay closed until the remote is set and checked, and each import's archive push waits until the remote holds the DOCX commit. This keeps "Git is used for all changes -- local and remote" true for DOCX chapters.
|
||||
- Item 3 (the Hermes gate)
|
||||
- Item 4. Canon and playground story files convert one file at a time, including files in unmarked folders inside a book folder or a playground. Type-folder and supporting files stay Markdown. A story file outside every book folder and playground has no universe or book, so it converts only after a human maps its folder into a book folder or a playground. The mapping step is Mos's reading of P1 and Q30.
|
||||
|
||||
The F4 measurement goes with them.
|
||||
|
||||
## Files the row would own
|
||||
|
||||
The id count goes from 85 to 87. 1.16 owned three files because its count stayed at 85. Like 1.13, the last version that added ids, the row owns four files:
|
||||
- `docs/prd/mosaic-stack.md`
|
||||
- `packages/tasks/requirements.json`: the version 1.17, the two new ids REQ-LIB-8 and REQ-LIB-9 with their titles, and the changed titles of REQ-LIB-1, REQ-LIB-2 and REQ-LIB-4. The new ids go after REQ-LIB-7 and before REQ-INST-1, in the same order as the PRD's bullets.
|
||||
- `packages/tasks/tests/requirements.test.mjs`: the version pin 1.17, the id count of 87, and the duplicate-id message, which goes from `requirements[85].id: REQ-ROLE-1 twice` to `requirements[87].id: REQ-ROLE-1 twice`.
|
||||
- `packages/bus/tests/requirements.test.mjs`: the list length, which goes from 85 to 87.
|
||||
|
||||
The gate would match 1.16's:
|
||||
1. A reviewer approves the text.
|
||||
2. Jason says yes to the exact text through Mos.
|
||||
3. Both `requirements.test.mjs` files, in `packages/tasks/tests` and `packages/bus/tests`, and every `scripts/test-*.sh` that reads the PRD or `requirements.json` are green on Sage's gate.
|
||||
4. Mos gets the landing commit.
|
||||
@@ -0,0 +1,652 @@
|
||||
# PRD 1.17 draft: Case 2 story files are DOCX (Q235 to Q237, P1 to P6)
|
||||
|
||||
Sage, 2026-10-23, for mos-1366 item 1 and Vikunja 570. Draft 9. It is d8 plus Jason's Q41 answer O2 (DECISIONS Q239, mos-1467), which makes J-b yes, Webby's round 5 N15 to N17 (webby-0210) and Webby's round 6 B1, N19 and N20 (webby-0212) (see "d9 changes"). d8 is d7 plus Mos's d8 fix list mos-1443 (see "d8 changes"). d7 is d6 plus Mos's ruling mos-1379 on Fenton's 571 B2 (see "d7 changes"). d6 is d5 with Webby's round 3 (webby-0207) fixed: B1 to B3 and N10 to N13, with N14 left for Mos (see "d6 changes"). d5 folds in:
|
||||
- Mos's d4 check ruling mos-1372 (D1 to D14; D15 was dropped).
|
||||
- mos-1374, which replaces J-c.
|
||||
- The impact map mos-1368 (jason-master-restart d183246, `projects/mosaic-mvp/case2-docx-impact-map.md`: A1 to A16, critic items C1 to C6, items 2 to 7).
|
||||
- Mos's F4 measurement.
|
||||
|
||||
Review order (mos-1367 B5): Webby, then Mos, then Jason. Base: PRD 1.16, `docs/prd/mosaic-stack.md` blob a6db9b4a at 482e865ac.
|
||||
1.16 lands first (row 291), and this text is a new version on top of it. Nothing here is built or queued. The impact map's queue changes (A24, A57 to A59) go through `scripts/mosaic queue` after 1.17 is approved (C9).
|
||||
|
||||
Sources, verbatim in Mos's DECISIONS:
|
||||
- Q235, Jason's Q36 answer.
|
||||
- Q236: chapters are DOCX, Markdown for agent files and docs.
|
||||
- Q237: "It is correct for now (subject to future change)".
|
||||
- The P1 to P6 reading as restated to Jason in Q38.
|
||||
|
||||
## Settled points (mos-1367)
|
||||
|
||||
These stand as ruled. d5 changes only what mos-1372 changed.
|
||||
|
||||
- **O1. Where a converted chapter lives.** The DOCX lives in the writing store of
|
||||
O2 design D12, and the archived Markdown stays in the user's repository under a
|
||||
human-marked archive folder. Ruled yes in B1, on the condition that the text
|
||||
says plainly that a converted chapter leaves the Gitea-mirrored repository and
|
||||
lives in the stack's writing store. mos-1372 D7 and mos-1375 add a remote for
|
||||
the store, off the stack's host.
|
||||
- **O2. The unit of conversion.** One story file per import, refusing a file
|
||||
that is already converted. Ruled yes in B2: each file gets its own fidelity
|
||||
report, human confirmation, manifest and commit.
|
||||
- **O3. Whether conversion is a vocabulary action.** A human-only verb outside
|
||||
the agent vocabulary, with no role grant and no agent request path. Ruled yes
|
||||
in B3.
|
||||
- **O4. Reading archived Markdown.** A new `archived` scope. Lookups leave it out
|
||||
unless the caller asks, every answer marks it archived, and a canon citation
|
||||
can't name it. Ruled yes in B4.
|
||||
|
||||
## d3 choices after mos-1372
|
||||
|
||||
- **C1 is replaced by D1, keep-source-scope.** A DOCX keeps its source's scope:
|
||||
universe, book, and canon or playground. A playground DOCX follows the
|
||||
playground rules and is never returned as canon. The import accepts canon and
|
||||
playground story files. Type-folder files and supporting files stay Markdown
|
||||
(P4). This also settles the impact map's Q18, item 4. It leaves one narrowing
|
||||
for Jason, J-i. A playground DOCX can't become canon in 1.17.
|
||||
- **C2 stands.** The move keeps the file's path under the archive folder:
|
||||
`book1/ch3.md` goes to `<archive>/book1/ch3.md`. An archived file's universe
|
||||
and book are those of its old path.
|
||||
- **C3 is replaced by D3 and D14.** The archive commit is written by a new
|
||||
human-only bus step (Vikunja 571) on the C2-02 write plumbing and pushed through
|
||||
C2-03b. The order is the store commit and the remote's confirmation that it
|
||||
holds that commit, then the archive commit and its push, then publication to the
|
||||
lookups.
|
||||
- **N4 stands.** REQ-LIB-8 says "a real user's books". The PRD names no user
|
||||
anywhere in Case 2.
|
||||
|
||||
## Text changes
|
||||
|
||||
### Status and sources
|
||||
|
||||
In the Status bullet's first line, "- Status: approved, version 1.16." becomes
|
||||
"- Status: approved, version 1.17." Status gains, after the two 1.16 sentences at
|
||||
the end of the bullet: "Version 1.17 records Jason's rulings Q235 to Q237 of
|
||||
2026-10-23: Case 2 story files are DOCX, Markdown stays for agent files and
|
||||
documentation, and a human-started import converts a Markdown story file one way.
|
||||
It also adds REQ-LIB-9, the Console's DOCX editor, from Jason's rulings Q195, Q226
|
||||
and Q234. It changes what Case 2 requirements allow, so Mos puts the text to Jason
|
||||
as written, and it lands only after his yes (mos-1366, Vikunja 570)."
|
||||
|
||||
New source line, above the 1.16 one: "Version 1.17 source: Jason's Q235, answering
|
||||
Q36: 'How about we see a markdown file, we convert the markdown file to docx, then
|
||||
archive or mark the markdown file as converted. The new standard for files in the
|
||||
creating writing use case is to use docx to handle versioning and WYSIWYG. We
|
||||
eliminate the potential for confusion based on the files. Agents must understand
|
||||
which files are what format and where they live. The system must allow for import
|
||||
and conversion. We will not run the systems in parallel. There will be an
|
||||
irreversible conversion of the files.' His Q236 says: 'For creative writing
|
||||
chapters, we need to utilize docx as the standard. Markdown is acceptable for
|
||||
agent files, instructions, PRDs, documentation, etc. The creative writing files
|
||||
should be docx for familiarity for the user.' His Q237 says 'Q38: It is correct
|
||||
for now (subject to future change)', which confirms Mos's reading P1 to P6.
|
||||
REQ-LIB-9 rests on his Q195 request for 'a full WYSIWYG editor within Mosaic
|
||||
Stack', his Q226 answer 'F41: We want to move editing into the WYSIWYG in the
|
||||
WebUI. All changes are instantly committed and available to the agents.' and his
|
||||
Q234 answer 'Q37: yes' to the exact security header for the editor's frame. The
|
||||
storage follows the O2 design D10 to D12 as rewritten under Vikunja 571, at
|
||||
b99ca86b9 on `refactor`."
|
||||
|
||||
### Creative library, section lead
|
||||
|
||||
Replace "The library is the user's own writing repository." with "The library is
|
||||
the user's own writing repository plus the stack's writing store, which holds the
|
||||
DOCX story files (REQ-LIB-8, version 1.17)."
|
||||
|
||||
### REQ-LIB-1
|
||||
|
||||
Add, before "(Design 1.1": "The mapping also names one archive folder, set by the
|
||||
human, where converted Markdown story files go. A book's DOCX story files are in
|
||||
the stack's writing store, under the same universe and book (REQ-LIB-8)." Version
|
||||
tag, inside the closing parenthesis: "Version 1.15: supporting folders.)" becomes
|
||||
"Version 1.15: supporting folders. Version 1.17: the archive folder and the
|
||||
writing store.)"
|
||||
|
||||
### REQ-LIB-2
|
||||
|
||||
Replace "A file's scope comes from its path alone, prefixes first: a Markdown
|
||||
file under a supporting prefix is supporting, one under a playground prefix at
|
||||
any level is playground, any other Markdown file in a book folder is canon, and
|
||||
everything else is unmapped and never returned. A folder in both lists is
|
||||
supporting." with:
|
||||
|
||||
"A Markdown file's scope comes from its path and from past imports, prefixes
|
||||
first: a Markdown file under the archive folder is archived, one under a
|
||||
supporting prefix is supporting, a Markdown file at a converted file's old path is
|
||||
unmapped under REQ-LIB-8 but flagged in the format map, one under a playground
|
||||
prefix at any level is playground, any other Markdown file in a book folder is
|
||||
canon, and everything else is unmapped and never returned. A folder in both lists
|
||||
is supporting. The archive folder follows the same placement rules and may not
|
||||
overlap another prefix or a book folder. An archived file keeps the path it had
|
||||
under the archive folder, and its universe and book are those of that old path. A
|
||||
DOCX document in the writing store keeps its source's scope: the universe, the
|
||||
book if there is one, and canon or playground. Its source is the Markdown file it
|
||||
was converted from or, for one the human starts in the editor, the universe and
|
||||
book or the playground the human picks (REQ-LIB-8). A playground DOCX follows the
|
||||
playground rules and is never returned as canon. It stays playground after its
|
||||
draft universe is made real. In version 1.17 no promotion or mapping change makes
|
||||
a playground DOCX canon. A later version of this PRD says how one becomes canon."
|
||||
|
||||
Replace "Lookups return canon unless the caller asks for playground or
|
||||
supporting." with "Lookups return canon unless the caller asks for playground,
|
||||
supporting or archived. Every answer marks an archived file as archived and names
|
||||
the DOCX that replaced it."
|
||||
|
||||
Replace "so an agent can't cite a playground or supporting file as canon" with "so
|
||||
an agent can't cite a playground, supporting or archived file as canon".
|
||||
|
||||
In REQ-LIB-2 only, replace "The Console shows each cite's scope." with "The Console shows each cite's
|
||||
scope and format, and whether a cited Markdown file was converted."
|
||||
|
||||
Version tag, inside the closing parenthesis: "Version 1.15: supporting.)" becomes
|
||||
"Version 1.15: supporting. Version 1.17: archived scope and DOCX scope.)"
|
||||
|
||||
### REQ-LIB-4
|
||||
|
||||
Replace "The user commits and pushes with their own tools, today Obsidian with
|
||||
obsidian-git." with "The user commits and pushes Markdown with their own tools,
|
||||
today Obsidian with obsidian-git. A converted story file's current text is no
|
||||
longer in that repository, which keeps only its archived Markdown (REQ-LIB-8)."
|
||||
|
||||
Add, after "Bus writes and pushes come in later rows (C2-02, C2-03b).": "A DOCX
|
||||
story file is saved in the Console's editor, and each accepted save is one commit
|
||||
by the human in the stack's writing store (REQ-LIB-9). Each writing-store commit
|
||||
is also pushed to a remote off the stack's host, never by force-push. The remote
|
||||
is a setting only a human changes, and it starts unset. A repository on the
|
||||
stack's host never counts as that remote. A missing remote or a failed push never
|
||||
undoes a save, and the user sees each push that is pending or failed. Only the
|
||||
stack's host pushes to that remote, and no agent can reach it with any credential.
|
||||
Agents read the local commit."
|
||||
|
||||
Replace "Agents read only the mirror's served commit and never hold a copy of
|
||||
their own, so they see the user's push within about a minute." with "Agents read
|
||||
the user's repository only at the mirror's served commit, except a story file
|
||||
during its import under REQ-LIB-8. They read a DOCX story file only at a committed
|
||||
version in the writing store, under REQ-LIB-5. They never hold a copy of their
|
||||
own, so they see the user's Markdown push within about a minute and a DOCX save at
|
||||
their next lookup after the editor reports it as committed."
|
||||
|
||||
Version tag: "and the sync items.)" becomes "and the sync items. Version 1.17,
|
||||
with Q222 for the remote setting.)"
|
||||
|
||||
### REQ-LIB-5
|
||||
|
||||
Add, after "Each answer names the commit it read.": "Each answer also names the
|
||||
file's format and where it lives: its path, or its document id in the writing
|
||||
store. A DOCX story file is read from its latest committed save, never from
|
||||
unsaved text. A lookup that starts after the editor reports a save as committed
|
||||
returns that save or a later one, even while its push to the remote is pending or
|
||||
has failed, and the answer names the version. Get, search and manuscript read a
|
||||
DOCX story file as its extracted text with DOCX locators, never as lines. That
|
||||
text is the file with its tracked changes accepted. An agent reads a story file's
|
||||
comments, or its text with tracked deletions shown, only after a human turns on
|
||||
the matching setting. Both settings are off by default, and only a human changes
|
||||
them. The reader in this version can't read some things a DOCX story file can
|
||||
hold, such as a web link, a text box, a field or hidden text. The editor warns the
|
||||
human when an edit adds one, and the human can still save it. Until a later save
|
||||
takes it out, lookups give agents none of the text of the part that holds it,
|
||||
whether that is the chapter's body, a note or a comment. The manuscript lookup
|
||||
follows the book's chapter order across both formats (O2 design D10), and the next
|
||||
chapter it names is never an archived file. Links out and in resolve across both
|
||||
formats. The universe lookup returns the format map (REQ-LIB-8)."
|
||||
|
||||
Replace "The user sees them in Obsidian's graph and backlinks." with "The user sees
|
||||
a Markdown file's links in Obsidian's graph and backlinks. A DOCX story file's
|
||||
wikilinks stay clickable in the Console's editor (O2 design D11), and no graph
|
||||
shows them yet. The Console's Connections view lists the current links and
|
||||
backlinks of each story file the user may see, in both formats, with each one's
|
||||
scope and format."
|
||||
|
||||
Version tag: 'and "Connections are always visible".)' becomes 'and "Connections
|
||||
are always visible". Version 1.17, with Q222 for the two settings and Q239 for
|
||||
the Connections view.)'
|
||||
|
||||
### REQ-LIB-6
|
||||
|
||||
Replace "A reply may cite lines of the repository at a commit or pages the agent
|
||||
fetched, and the broker checks every citation before it stores the message." with
|
||||
"A reply may cite lines of a Markdown file at a commit, a place in a committed
|
||||
DOCX story file, or pages the agent fetched, and the broker checks every citation
|
||||
before it stores the message. A DOCX citation never calls a paragraph a line. It
|
||||
names the document id, the committed version and a DOCX locator. A citation that
|
||||
names an archived file as current is refused. The `requireCitation` setting below
|
||||
applies to Markdown and DOCX citations alike, and so does the rule for a citation
|
||||
marked as canon."
|
||||
|
||||
Add, after "the broker refuses such a write before any git call.": "The writing
|
||||
store and the archive folder are read-only to a creative agent as well, and the
|
||||
broker's path check treats the archive folder as story. No agent creates, edits,
|
||||
deletes, converts, archives or restores a story file in any format, and no agent
|
||||
writes a DOCX. No creative agent starts or undoes a conversion, and none asks for
|
||||
one through a tool or a decision it raises, as REQ-LIB-8 says. An agent may still
|
||||
suggest a conversion to the human in chat. Each creative role's contract states
|
||||
which files are DOCX and which are Markdown, and cites a DOCX story file by its
|
||||
locator, never by line."
|
||||
|
||||
Version tag, inside the closing parenthesis: "Version 1.15.)" becomes "Version
|
||||
1.15. Version 1.17.)"
|
||||
|
||||
### New REQ-LIB-8
|
||||
|
||||
This bullet goes after REQ-LIB-7 and before the "### Installer" heading.
|
||||
|
||||
"- **REQ-LIB-8.** Story files become DOCX. DOCX is the standard for chapters and
|
||||
the other story text in a Case 2 writing project, canon and playground alike. A
|
||||
story file becomes DOCX through a human's import (below), or when the human
|
||||
starts it in the editor. From then on DOCX is its only working format, edited in
|
||||
the Console's editor (REQ-LIB-9). A Markdown story file stays Markdown until its
|
||||
import. Files in a type folder (REQ-LIB-1), such as character and place notes,
|
||||
stay Markdown. So do supporting files, agent files, instructions, PRDs and
|
||||
documentation, including the character sheets, summaries and cross-links agents
|
||||
keep under REQ-LIB-6.
|
||||
- A converted story file's current text leaves the user's Gitea-mirrored
|
||||
repository. Its DOCX lives in the stack's writing store, on the stack's host,
|
||||
and not in the repository the user pushes or opens in Obsidian. Only its
|
||||
archived Markdown stays there.
|
||||
- An import converts one Markdown story file, canon or playground, outside every
|
||||
type folder (REQ-LIB-1), to a DOCX document in the writing store. It refuses
|
||||
an unmapped, supporting, archived or type-folder file, and a file that is
|
||||
already converted. Each import has its own fidelity report, the human's
|
||||
confirmation of that report, a manifest naming the source file and its commit,
|
||||
and one commit in the store. The DOCX keeps every wiki link of the source as
|
||||
written, and a lost link to another library file fails the fidelity report. A
|
||||
web link becomes plain text that keeps its label and address, and the fidelity
|
||||
report lists it for the human to confirm. A web link that can't be kept safely
|
||||
as plain text refuses the import.
|
||||
- The human can also start a new story file in the editor, in a universe and
|
||||
book or a playground the human picks. It is a DOCX document in the writing
|
||||
store from its first commit, with no Markdown copy, and it opens under the
|
||||
same gate as the import.
|
||||
- The same import marks the Markdown file converted, naming the document, and
|
||||
moves it to the archive folder under its old path (REQ-LIB-1, REQ-LIB-2).
|
||||
The mark and the move are one commit authored by the human in the user's
|
||||
repository. A new human-only bus step (Vikunja 571) on the C2-02 write
|
||||
plumbing writes it, and C2-03b pushes it. The move keeps the bytes and the
|
||||
git history, so it isn't `data.delete`.
|
||||
- The store commit comes first, and the writing store's remote must confirm it
|
||||
holds that commit. Then come the archive commit and its push, then publication
|
||||
to the lookups. Until publication the Markdown at its old path keeps its canon
|
||||
or playground scope. Agents read that file at the commit the import started
|
||||
from, even after the mirror's served commit reaches the archive commit or a
|
||||
later one. No lookup returns the file's archived copy before publication, even
|
||||
one that asks for archived files. A refusal or failure before the archive push
|
||||
leaves the Markdown unmoved and no DOCX that a lookup returns. A failure after
|
||||
the archive push leaves a pending import that the human sees and can resume,
|
||||
never a claim that nothing moved. An archive push whose result is unknown
|
||||
counts as a failure after the archive push until the stack reads the result
|
||||
back from the user's remote.
|
||||
- Each stage of an import writes a logged event. The import's record on the
|
||||
stack's host names the source file's path, commit and blob and the new
|
||||
document id, and each event points to that record.
|
||||
- After a conversion, a Markdown file at the converted file's old path is
|
||||
neither canon nor playground. Lookups leave it out, the format map flags it,
|
||||
and the human is told.
|
||||
- A new Markdown story file in a book folder that holds converted files stays
|
||||
canon until its import, unless it sits at a converted file's old path or under
|
||||
a playground prefix. The Console flags it and offers the import. Nothing
|
||||
converts it on its own.
|
||||
- A hybrid's exclusion that covers a converted file's old path also covers its
|
||||
DOCX document (REQ-LIB-3). An exclusion of a whole book folder also covers
|
||||
every DOCX document in that book, including one started in the editor. An
|
||||
exclusion can also name a DOCX document by its id.
|
||||
- Only a human starts an import or a new story file, from the CLI or a Console
|
||||
session signed in as that human. Both are human verbs outside the agent action
|
||||
vocabulary. Neither is added to `ACTIONS` in the business vocabulary or to the
|
||||
broker's always-gated list, including the import's action, `library.convert`.
|
||||
No role holds them, no agent can request them, and the hard-wait list in
|
||||
REQ-WAIT-1 doesn't change. In an organization with several humans, who may
|
||||
start them is a setting only a human changes, and the default is the owner
|
||||
only.
|
||||
- Conversion is one way, with no parallel run. Neither the Console nor any agent
|
||||
edits a converted story file as Markdown, and no DOCX edit syncs back to
|
||||
Markdown. The Console's Markdown save refuses every file under the archive
|
||||
folder. The user's own tools can still change the archived Markdown, and no
|
||||
such change reaches the DOCX. The old Markdown stays in git history, and
|
||||
nothing rewrites history. A promotion into a book folder (C2-19) runs the
|
||||
import for a Markdown story file or is refused. A promotion of a playground
|
||||
DOCX is refused in version 1.17.
|
||||
- Agents get a format map: for each mapped folder and story file, its format,
|
||||
scope and where it lives, archived files, flagged files and pending imports
|
||||
included.
|
||||
- The import and new story files ship closed. They open only after four things.
|
||||
The editor ships. The human has set the writing store's remote, and the stack
|
||||
has checked that it can push there. Agents can read committed DOCX story files
|
||||
through the lookups and cite them (REQ-LIB-5, REQ-LIB-6). Any earlier agent
|
||||
system that writes the user's files has stopped, which for Case 2 is the
|
||||
Hermes retirement (#423 step 5). So the import itself never cuts agents off
|
||||
from a chapter, the chapter's current text never lives only on the stack's
|
||||
host, and no second system writes the story. The first import of a real user's
|
||||
books waits for Jason's go.
|
||||
(Q235, Q236, Q237: P1 to P6. Q222 for the setting. O2 design D10 to D12.
|
||||
Version 1.17.)"
|
||||
|
||||
### New REQ-LIB-9
|
||||
|
||||
This bullet goes after REQ-LIB-8.
|
||||
|
||||
"- **REQ-LIB-9.** The Console's DOCX editor. The human edits a DOCX story file in
|
||||
the Console's editor, in a split pane with the agent chat alongside it. The
|
||||
human can pin an agent chat to a document. The human can select a word,
|
||||
right-click it, and choose a synonym from a thesaurus. Only a human saves. Saves
|
||||
happen on their own while the human types (Q226), at intervals only a human
|
||||
changes, and each accepted save is one commit with the human as author, pushed
|
||||
as REQ-LIB-4 says. A save made against an older version than the current one is
|
||||
refused. Agents never write a DOCX. Versioning is the editor's tracked changes
|
||||
plus one git commit per save. The editor's code is vendored and pinned, with a
|
||||
hash per file and the licenses that its independent security review accepted. At
|
||||
runtime the editor loads only files that the stack itself serves, and it
|
||||
requests nothing from any other host. The editor's frame sends exactly the
|
||||
content security policy Jason approved in Q234, and the WebUI shell's own header
|
||||
is unchanged. REQ-PROJ-3's project docs editor is unchanged. (Q195, Q226, Q234,
|
||||
Q236. O2 design D3, D4, D6, D8, D10, D13, D14, D16 and D22. Version 1.17.)"
|
||||
|
||||
### Version 1.17 notes
|
||||
|
||||
Added after the 1.16 notes:
|
||||
|
||||
"- Version 1.17:
|
||||
- Jason confirmed the reading 'for now (subject to future change)' (Q237). The
|
||||
rulings stand until he revises them.
|
||||
- The 10-27 Case 2 release ships on Markdown as built (P6). The 1.11 line 'The
|
||||
Case 2 MVP for 10-27 is the Markdown library (#416). The WYSIWYG editor (Q195,
|
||||
Q196) is an add-on that doesn't gate it.' still holds. Conversion opens after
|
||||
10-27, and only once REQ-LIB-8's four conditions are met. The editor ships,
|
||||
the writing store's remote is set and the stack has checked that it can push
|
||||
there, agents can read and cite committed DOCX story files through the
|
||||
lookups, and Hermes is retired, which is #423 step 5.
|
||||
- The 1.12 note says five bus write and Console editor rows, C2-02, C2-03b,
|
||||
C2-11a, C2-11b and C2-19, don't gate 10-27. Jason's Q226 F42 later moved
|
||||
C2-02, C2-03b and C2-11b into the 10-27 slice. The Case 2 design brings C2-11a
|
||||
in with them, because C2-11b needs it. C2-19 stays outside the slice. Mos's
|
||||
reading of F42 is that C2-02 and C2-03b now gate 10-27, because design 9.2
|
||||
puts them in 'the smallest slice that lets her start'. C2-11a and C2-11b are
|
||||
slice rows that still don't gate 10-27, because the editor is the Q195 add-on.
|
||||
The DOCX change in 1.17 leaves this slice as it is, and C2-11b's Markdown
|
||||
editor never edits a converted story file.
|
||||
- Q236 narrows Q176's editor choice to DOCX for story files (REQ-LIB-9). The
|
||||
1.12 note that the Case 2 design keeps Obsidian now holds only for Markdown
|
||||
files, including story files not yet imported. A DOCX story file is edited
|
||||
only in the Console's editor under REQ-LIB-9.
|
||||
- This replaces two parts of the O2 design at 25c09f19f. The superseded-notice
|
||||
proposal from Fenton's F1 in D12 is withdrawn, and the
|
||||
keep-Markdown-at-its-path model of D11 is replaced. Gyro's rewrite of the O2
|
||||
design for Vikunja 571, landed on `refactor` at b99ca86b9, carries the
|
||||
details, and where it differs from this text, this text holds:
|
||||
- the import and archive steps, the mark, and the new bus step;
|
||||
- links from supporting files to a moved chapter;
|
||||
- the DOCX reader;
|
||||
- the user's unpushed or later changes to an archived file or at its old path,
|
||||
and pushing and closing the file in Obsidian before each import;
|
||||
- the writing store's remote in W4 section 7.3, which replaces the no-remote
|
||||
and no-backup rule that W4 section 7.4 held before the rewrite, at
|
||||
062646487;
|
||||
- import events counted by a bus restore, and recovery when a bus restore or a
|
||||
restore of the whole host predates an import;
|
||||
- manifest order for the manuscript lookup and its next chapter;
|
||||
- `library.convert` kept out of `ACTIONS`, out of the hard-wait note and out
|
||||
of the pinned `GATED_ONLY` list in packages/business/src/vocabulary.mjs.
|
||||
- Agents read a converted story file through the Case 2 lookups under the same
|
||||
project and universe access as Markdown canon, in any thread or room. W4's
|
||||
earlier O2-only conversations, per-document grants and per-send sharing don't
|
||||
gate these lookups. The 571 rewrite replaced them in W4 sections 7.1 and 7.2.
|
||||
The creative tool list in REQ-LIB-6 doesn't change.
|
||||
- The six creative role contracts row 213 landed say 'Every item cites the
|
||||
lines of the user's material it is about'. A build row under 571 changes that
|
||||
line for DOCX story files (REQ-LIB-6).
|
||||
- A new Markdown file in a book folder is still canon in 1.17. The 1.17
|
||||
exception is a file at a converted file's old path, which REQ-LIB-2 makes
|
||||
unmapped.
|
||||
- Story files convert whether canon or playground. Type-folder and supporting
|
||||
files stay Markdown.
|
||||
- Measured 2026-10-23 at about 01:21Z: the Case 2 user's library repository
|
||||
tracks 213 files, 203 of them Markdown, and none is a .docx or .doc. It has no
|
||||
untracked files. The user's .doc files (Q196) are outside it. So the landed
|
||||
code has no DOCX there to report as unreadable at 10-27.
|
||||
- Text replaced in 1.17, kept here as in earlier notes:
|
||||
- Creative library lead, the 1.16 sentence: "The library is the user's own
|
||||
writing repository."
|
||||
- REQ-LIB-2, the 1.16 sentences: "A file's scope comes from its path alone,
|
||||
prefixes first: a Markdown file under a supporting prefix is supporting,
|
||||
one under a playground prefix at any level is playground, any other
|
||||
Markdown file in a book folder is canon, and everything else is unmapped
|
||||
and never returned. A folder in both lists is supporting." "Lookups return
|
||||
canon unless the caller asks for playground or supporting." "so an agent
|
||||
can't cite a playground or supporting file as canon" "The Console shows
|
||||
each cite's scope."
|
||||
- REQ-LIB-4, the 1.16 sentences: "The user commits and pushes with their own
|
||||
tools, today Obsidian with obsidian-git." "Agents read only the mirror's
|
||||
served commit and never hold a copy of their own, so they see the user's
|
||||
push within about a minute."
|
||||
- REQ-LIB-5, the 1.16 sentence: "The user sees them in Obsidian's graph and
|
||||
backlinks." A converted chapter's connections show in Obsidian only as they
|
||||
stood at conversion, and the Console's Connections view shows their
|
||||
current links.
|
||||
- REQ-LIB-6, the 1.16 sentence: "A reply may cite lines of the repository at
|
||||
a commit or pages the agent fetched, and the broker checks every citation
|
||||
before it stores the message."
|
||||
- REQ-LIB-1 only gains sentences.
|
||||
- REQ-LIB-3's text and REQ-LIB-7 are unchanged. REQ-LIB-8 adds one form of
|
||||
exclusion REQ-LIB-3 doesn't have: naming a DOCX document by its id. A path
|
||||
exclusion also covers DOCX documents, through a converted file's old path or a
|
||||
whole book folder. An archived file and a DOCX document keep a universe, and a
|
||||
book where their source has one, so every lookup still names one universe.
|
||||
REQ-PROJ-3, the Console editor for a project's spec and docs, is unchanged.
|
||||
C2-11b opens the library's Markdown files in that same editor.
|
||||
- In `packages/tasks/requirements.json` the titles of REQ-LIB-1, REQ-LIB-2 and
|
||||
REQ-LIB-4 change, and those of REQ-LIB-5 and REQ-LIB-6 stay. REQ-LIB-1 becomes
|
||||
'A human-set library maps the user's repository onto universes, books, types,
|
||||
playgrounds, supporting and archive folders'. REQ-LIB-2 becomes 'Scope comes
|
||||
from the path or a DOCX's source, lookups default to canon, and only canon
|
||||
files are ever cited as canon'. REQ-LIB-4 becomes 'Git holds every change. The
|
||||
bus fast-forwards a read-only mirror every 60 seconds, the one place agents
|
||||
read Markdown'. REQ-LIB-8 and REQ-LIB-9 add two ids, so the count goes from 85
|
||||
to 87. REQ-LIB-8 is titled 'Case 2 story files become DOCX by a human-only
|
||||
one-way import or in the editor; Markdown stays for notes and docs', and
|
||||
REQ-LIB-9 'The Console's DOCX editor: only a human saves, each save is one
|
||||
commit, and the editor code is vendored and pinned'.
|
||||
- Open points O1 to O4 of draft 1 were ruled by Mos in mos-1367 B1 to B4.
|
||||
- Sage files the build rows under Vikunja 570 and 571 after the rewrite is
|
||||
approved. This amendment adds the requirements only."
|
||||
|
||||
### Risks
|
||||
|
||||
The new lines go at the end of "## Risks and open questions", after the bullet
|
||||
that begins "Trusted mode lets an agent" and before the "## Milestones" heading.
|
||||
- "A DOCX file is a zip archive, so git can't show a line diff of a chapter.
|
||||
Review of a story change goes through the editor and the committed reader,
|
||||
not `git diff`. (Version 1.17.)"
|
||||
- "A converted chapter's DOCX is not in Obsidian's graph. Obsidian shows the
|
||||
chapter only through its archived Markdown, and no DOCX edit reaches that file's
|
||||
links. The DOCX's current links show in the Console's editor and its
|
||||
Connections view, and no graph shows them yet. (Version 1.17.)"
|
||||
- "Conversion can't be undone in place. Front matter, wiki link forms and
|
||||
unsupported blocks may not survive it, and the mirror can't refuse the user's
|
||||
push to an archived file. The controls are the fidelity report, the human's
|
||||
confirmation, an untouched original on refusal, and the kept archive.
|
||||
(Version 1.17.)"
|
||||
- "A restore of the stack's bus alone from a backup taken before an import drops
|
||||
the import's logged events, while the archive commit and the DOCX stay. A
|
||||
restore of the stack's whole host from such a backup also takes the writing
|
||||
store and the host's import records back to before the import. The archive
|
||||
commit stays in the user's Gitea repository and the DOCX stays on the writing
|
||||
store's remote, but the host keeps no record of the import. A bus restore counts
|
||||
import events, and the import's recovery covers both cases (Vikunja 571).
|
||||
(Version 1.17.)"
|
||||
|
||||
## d9 changes (Q239 and Webby round 5)
|
||||
|
||||
- J-b yes (Q239, mos-1467), in the five edits mos-1443 R3 set for a yes (Webby round 6 B1). R3.1: REQ-LIB-5's replacement gains the Connections view sentence after "no graph shows them yet.". R3.2: the graph Risks line ends with the editor and the Connections view. R3.3: the A6 line moves from "Not taken" under A6. R3.5: the REQ-LIB-5 note ends with the Connections view, which drops "until a Console view of their links exists" and "Q226 records that view as a later option". R3.4 is Gyro's design edit at 767bb62c7 (writing-editor.md:188-190, :240-244 and :1272, docx-citations.md:66), and it follows in his docs round. Beyond these and N21, nothing else in the PRD text changes.
|
||||
- N19 and N20 (Webby round 6): J-b's question text is in the past tense, and the line that the import doesn't wait for the view is cited as Mos's R3 default. Mos confirmed it at his J-b check (mos-1470).
|
||||
- N21 (Webby round 6, Mos yes in mos-1470): REQ-LIB-5's version tag cites Q239 for the Connections view beside Q222 for the two settings.
|
||||
- N15: the D7 landing line gives R8's wording beside the impact map's quote.
|
||||
- N16: the d7 changes line notes that R8 replaces "no agent credential reaches it" in d8.
|
||||
- N17: the REQ-LIB-2 Replace quote and the REQ-LIB-8 old-path bullet are rewrapped under 82 columns. Their words are unchanged.
|
||||
|
||||
## d8 changes (Mos's d8 fix list, check wf_63bba879-180)
|
||||
|
||||
- R1: REQ-LIB-4's tail covers DOCX saves, which agents see at their next lookup after the editor reports them as committed. The notes quote the whole 1.16 sentence. Source: nit/jason/F10.
|
||||
- R2: REQ-LIB-4's new title says the mirror is "the one place agents read Markdown". Source: decisions.n14.
|
||||
- R3: J-b asks whether 1.17 requires the Console Connections view, with Mos's recommendation of yes. Sources: mos1372/F9, jason/F2, anchors/F5.
|
||||
- R4: C2-02 and C2-03b gate 10-27, C2-11a and C2-11b are slice rows that don't, and "F42 wins" is gone. New J-k. Sources: anchors/F6, jason/F5.
|
||||
- R5: where the landed 571 design differs, this text holds. Sources: anchors/F8, adversarial/F8 item 1, jason/F8, critic/C6, G16's design follow-on.
|
||||
- R6: `library.convert` stays out of `ACTIONS`, and REQ-WAIT-1's hard-wait list doesn't change. Sources: gyro571/F1, adversarial/F8 item 3, critic/C6.
|
||||
- R7: a repository on the stack's host never counts as the writing store's remote, and Item 2 says so. Sources: mos1372/F2, adversarial/F1, gyro571/F2.
|
||||
- R8: "no agent credential reaches it" becomes "no agent can reach it with any credential". Source: Fenton's B1 under mos-1379.
|
||||
- R9: no playground DOCX becomes canon in 1.17, and a promotion of one is refused. New J-i. Sources: mos1372/F8, adversarial/F2.
|
||||
- R10: REQ-LIB-9 restates Q195's pin and right-click thesaurus, and its cite gains D4 and D22. Source: critic/C4.
|
||||
- R11: REQ-LIB-9's license bar is the licenses its independent security review accepted. New J-l. Source: critic/C3.
|
||||
- R12: no text for D16's narrow-window tabs. Mos records that reading in STATE. Sources: jason/F1, second verifier vote.
|
||||
- R13: no lookup returns a file's archived copy before publication. Source: adversarial/F5 part 3.
|
||||
- R14: a restore of the whole host from a backup taken before an import is a fourth recovery case. Source: adversarial/F6.
|
||||
- M1: REQ-LIB-4's writing-store sentences follow the later bus rows sentence and add the off-host remote rules and DOCX read timing. The note quotes both 1.16 sentences. Sources: mos1372/F2, adversarial/F1, gyro571/F2, anchors/F4, nit/jason/F10, adversarial/F5 part 1, Fenton B1.
|
||||
- M2: REQ-LIB-8's order bullet adds the remote's confirmation, the old-path read rule and "archive push". Sources: mos1372/F2 and the other remote findings, mos1372/F7, adversarial/F5 parts 2 to 4.
|
||||
- M3: REQ-LIB-8's gate bullet has four conditions, adding the remote. Sources: the remote findings, critic/C1 and C2 edit 2.
|
||||
- M4: the 1.17 note on when conversion opens restates the four conditions and drops W4b. Sources: jason/F5, the remote findings.
|
||||
- M5: Item 2 rewritten with the remote rules. Sources: the remote findings.
|
||||
- M6: the 1.12 gating note rewritten. Sources: anchors/F6, jason/F5.
|
||||
- M7: REQ-LIB-9 gains the split pane, the pin, the thesaurus, the license bar and the runtime load rule, and cites more of the design. Sources: jason/F1, critic/C4, critic/C3, nit/anchors/F12, nit/gyro571/F9.
|
||||
- M8: REQ-LIB-2, the one-way bullet and the C1 note keep a playground DOCX out of canon in 1.17. Sources: mos1372/F8, adversarial/F2.
|
||||
- M9: REQ-LIB-5 says what the reader can't read, and the import turns web links into plain text. New J-j. Sources: critic/C1, critic/C2.
|
||||
- M10: an exclusion of a whole book folder covers that book's DOCX documents. Source: adversarial/F3, with B5.
|
||||
- M11: the human-verbs sentence and the 571 list item name `library.convert` and REQ-WAIT-1. Sources: gyro571/F1, adversarial/F8 item 3, critic/C6.
|
||||
- M12: J-b rewritten. Sources: mos1372/F9, jason/F2, anchors/F5, gyro571/F3, critic/C6.
|
||||
- M13: J-d puts the agent read model to Jason as his call. Source: mos1372/F1.
|
||||
- M14: Status moves to version 1.17 and names REQ-LIB-9. Sources: anchors/F2, mos1372/F4, critic/C7.
|
||||
- M15: the 1.17 source line quotes Q235 in full (mos-1446) and the REQ-LIB-9 sources, at b99ca86b9. Sources: critic/C5, anchors/F9, jason/F8 pin part, nit/gyro571/F8, critic/C6 pin part.
|
||||
- M16: the 571 list lead names the two replaced design parts and the landed design. Sources: anchors/F9, anchors/F8, adversarial/F8 item 1, jason/F8, critic/C6.
|
||||
- Landing swap: Gyro's docs round for R5, R6 and R14 landed as b99ca86b9 (Fenton fenton-0015), so M15 and M16 cite b99ca86b9 in place of 767bb62c7, as the d8 fix list's header says. J-b keeps 767bb62c7 for its line numbers.
|
||||
- M17: W4 section numbers in the remote item and the lookups note. Sources: gyro571/F5, nit/adversarial/F11.
|
||||
- M18: the D7 landing line. Sources: gyro571/F5, the remote findings.
|
||||
- M19: a logged event for each import stage, in REQ-LIB-8 and A2. Source: gyro571/F7.
|
||||
- M20: the Risks line on restores adds the whole-host case. Sources: adversarial/F6, gyro571/F7.
|
||||
- M21: the 571 restore item adds the whole-host case. Source: adversarial/F6.
|
||||
- M22: the graph Risks line and the REQ-LIB-5 note name a Console view. Sources: anchors/F5, jason/F2.
|
||||
- M23: the d6 B3 line drops "F42 wins". Source: anchors/F6.
|
||||
- M24: new Markdown in a converted book, with the old-path and playground exceptions. Source: mos1372/F6.
|
||||
- M25: J-c's last sentence is Mos's reading. Source: mos1372/F10.
|
||||
- M26: J-h rewritten with the D13 defaults. Source: jason/F3.
|
||||
- M27: Item 4 rewritten. Sources: jason/F4, gyro571/F4, decisions.unmarked_folders.
|
||||
- M28: the "Not taken" note on unmarked folders. Sources: jason/F4, gyro571/F4, decisions.unmarked_folders.
|
||||
- M29: the import refuses an unmapped file. Sources: gyro571/F4, decisions.unmarked_folders.
|
||||
- M30: placement notes for REQ-LIB-8, REQ-LIB-9 and the Risks lines. Sources: anchors/F3, nit/anchors/F14.
|
||||
- M31: REQ-LIB-4's title and the D11 landing line. Source: decisions.n14.
|
||||
- M32: the Q236 note limits the 1.12 Obsidian note to Markdown files. Source: critic/C8.
|
||||
- M33: the exclusion note adds path exclusions of DOCX documents. Source: anchors/F7.
|
||||
- M34: A9 moves from "Mine" to the impact-map list. Source: decisions.exclusion_by_id.
|
||||
- M35: the D5 landing line. Sources: anchors/F10, mos1372/F5, nit/adversarial/F12.
|
||||
- M36: the D9 and D14 landing lines. Source: mos1372/F1.
|
||||
- M37: the O1 and C3 notes add the off-host remote and its confirmation. Sources: the remote findings.
|
||||
- M38: the REQ-PROJ-3 note. Source: nit/anchors/F11.
|
||||
- M39: REQ-LIB-5's freshness sentence keys on the editor reporting a save as committed. Source: nit/adversarial/F9.
|
||||
- M40: REQ-LIB-6 bars agent requests for a conversion and allows a suggestion in chat. Source: nit/jason/F9.
|
||||
- M41: REQ-LIB-2's opening and old-path rule, and the "Mine" note. Source: nit/adversarial/F10.
|
||||
- M42: REQ-LIB-8's lead sentence on Markdown story files. Source: nit/mos1372/F12.
|
||||
- M43: REQ-LIB-6's citation sentence. Source: nit/anchors/F13.
|
||||
- M44: REQ-LIB-5's version tag uses plain quotes. Source: nit/anchors/F15.
|
||||
- M45: reference codes B5, D12, D10 and B4 name their source. Source: nit/mos1372/F11.
|
||||
- Files the row would own: four files, with the id count going to 87. Sources: anchors/F1, adversarial/F4, decisions.n14 F4.
|
||||
|
||||
## d7 changes (mos-1379, Fenton's 571 B2)
|
||||
|
||||
- REQ-LIB-5 gains Mos's three sentences after the extracted-text sentence. The text agents read has tracked changes accepted. Comments, and text with tracked deletions shown, each wait for a setting only a human turns on, off by default. Its version tag cites Q222 for the two settings, which is the only text here beyond Mos's.
|
||||
- J-d gains Mos's sentence on comments and tracked deletions.
|
||||
- Fenton's B1 is design only. d6's "no agent credential reaches it" holds (R8 replaces it in d8), and the shared helper stays #431.
|
||||
|
||||
## d6 changes (Webby round 3, webby-0207)
|
||||
|
||||
- B1: titles for REQ-LIB-8 and REQ-LIB-9 in the requirements.json note and the file list. REQ-LIB-9 takes Webby's title. REQ-LIB-8 keeps mine, because Webby's ("...one-way import that archives the Markdown under its old path") leaves out D2's story files started in the editor.
|
||||
- B2: REQ-LIB-2 makes a Markdown file at a converted file's old path unmapped, ahead of the playground and canon rules, so a playground conversion is covered too. REQ-LIB-8's old-path bullet says "neither canon nor playground".
|
||||
- B3: the slice note names Q226 F42's three rows (C2-02, C2-03b, C2-11b). C2-11a joined the slice with C2-11b, because C2-11b needs it. Both are slice rows that don't gate 10-27, as design 9.2, case2-rows.md:1655 and the impact map's A57 say. The 'F42 wins' sentence is gone from the note in d8, so no queue change follows from it.
|
||||
- N10: the cite-scope replacement is scoped to REQ-LIB-2. The 1.14 note's copy stays.
|
||||
- N11: the notes say REQ-LIB-8 adds the by-id exclusion form REQ-LIB-3 doesn't have.
|
||||
- N12: J-h marks the autosave intervals for Jason.
|
||||
- N13: J-b names REQ-LIB-5's "Connections are always visible" tag and Q226's "another way to handle the visual brain map".
|
||||
- N14, not taken: REQ-LIB-4's title stays internal F3's text, as mos-1372 D11 ruled. Webby's alternative, "...and agents read Markdown from it alone" (120 chars), is Mos's call.
|
||||
|
||||
## Where each mos-1372 item landed
|
||||
|
||||
- D1: REQ-LIB-2's DOCX sentences, the REQ-LIB-8 lead and import bullet, C1 above, and the notes. "Playground files stay Markdown in 1.17" is gone.
|
||||
- D2: REQ-LIB-2's "for one the human starts in the editor" and the REQ-LIB-8 new-story-file bullet. The universe-and-book note is now true.
|
||||
- D3: the REQ-LIB-8 order bullet. This also settles N8.
|
||||
- D4: REQ-LIB-8's one-way bullet, which carries the archive refusal and consequence F2's text, and the 571 list item.
|
||||
- D5: it landed in REQ-LIB-2's "a Markdown file at a converted file's old path is unmapped" in Webby's B2 form, and in the REQ-LIB-8 old-path bullet.
|
||||
- D6: REQ-LIB-5's freshness sentences.
|
||||
- D7 and mos-1375: REQ-LIB-4's remote sentences, the remote step in REQ-LIB-8's order bullet, the fourth opening condition and the 1.17 note on when conversion opens, plus the 571 list item on W4 section 7.3, which replaces the no-remote rule of the old W4 section 7.4. The impact map's item 2 adds "only the stack's host pushes, and no agent credential reaches it", which R8 words in d8 as "no agent can reach it with any credential".
|
||||
- D8: the REQ-LIB-5 replacement, the import bullet's wiki-link sentence, the Risks line, the note quoting the old sentence, and "REQ-LIB-1 only gains sentences".
|
||||
- D9: the 1.17 note that agents read a converted story file through the Case 2 lookups, from the d4 check's consistency B2, and J-d, which puts the read model to Jason as his call.
|
||||
- D10: the d4 check's B5 sentence, in REQ-LIB-8.
|
||||
- D11: internal F3's clause in the REQ-LIB-4 section, and in the notes the title as Mos amended it for N14.
|
||||
- D12: the whole 1.16 sentence replaced, and quoted in full in the notes.
|
||||
- D13: consequence F1's text, in REQ-LIB-4 and REQ-LIB-8's first bullet.
|
||||
- D14: the row text from the d4 check's consistency B1, in the mark-and-move bullet and C3 above.
|
||||
|
||||
## What d5 adds beyond mos-1372 (for Webby and Mos to check)
|
||||
|
||||
From the impact map, folded as mos-1368 item 1 asked:
|
||||
- A1: the Console shows a cite's format and converted state (REQ-LIB-2).
|
||||
- A2: the logged events and the several-humans setting, default owner only, under Q222.
|
||||
- A3: the import is outside the vocabulary, the hard-wait list is unchanged, and the archive move isn't `data.delete`. The C6 code site is in the 571 list.
|
||||
- A4: the section lead and REQ-LIB-1's writing-store sentence.
|
||||
- A6: format and location in every answer, extracted text with DOCX locators, links across formats.
|
||||
- A6's named chapter-links view. D8 took B8's "no graph shows them yet", and J-b put the view to Jason. His O2 (Q239) takes it in d9 as REQ-LIB-5's Connections view (mos-1443 R3).
|
||||
- A7: read-only extends to the store and the archive, no agent action on a story file in any format, no agent DOCX write, and role contracts state the formats. C1's role contract line is a 571 build item.
|
||||
- A8: the DOCX cite shape, and a cite naming an archived file as current is refused.
|
||||
- A9: a hybrid sees a source's DOCX canon through REQ-LIB-2's source scope, and REQ-LIB-8 lets an exclusion name a DOCX document by its id. The id form lets the human exclude a single DOCX started in the editor, which has no old path. An archived file isn't canon, so no hybrid sees it.
|
||||
- A10: REQ-LIB-9, so the count is 87, not 86.
|
||||
- A11: the Hermes gate, from item 3.
|
||||
- A12: the C2-19 promotion sentence.
|
||||
- A13: the broker's path check treats the archive folder as story.
|
||||
- A14 and C5: two Risks lines.
|
||||
- A15: the flagged-new-file bullet. It sits beside the note from the d4 check's B4, "a new Markdown file in a book folder is still canon". The file stays canon and is offered for import.
|
||||
- A16: three titles change and two stay.
|
||||
- C2: manifest order for the manuscript lookup.
|
||||
- F3: the C2-02 gating note.
|
||||
- F4: Mos's measurement.
|
||||
|
||||
Mine, beyond either source:
|
||||
- REQ-LIB-2 opens "A Markdown file's scope comes from its path and from past imports". DOCX scope comes from the source, so "a file's" would be false.
|
||||
- REQ-LIB-9's autosave sentence. It is Mos's reading of F41's "instantly committed", with human-set intervals. The exact intervals stay in the design.
|
||||
|
||||
Not taken:
|
||||
- Impact map item 4's "files in unmarked folders are eligible one at a time", for folders outside every book folder and playground only. Their files are unmapped under REQ-LIB-2, so a DOCX made from one would have no universe or book to keep. The human maps such a folder into a book folder or a playground first, under REQ-LIB-1. A file in an unmarked folder inside a book folder or a playground is canon or playground, and the import takes it one file at a time.
|
||||
|
||||
## Marked for Jason (additions in the text he sees)
|
||||
|
||||
- J-a. Whether "We will not run the systems in parallel" applies per chapter or as one switch per book. His call. As written, it applies per chapter.
|
||||
- J-b. A converted chapter's DOCX is not in Obsidian's graph. Obsidian shows the chapter only through its archived Markdown, and no DOCX edit reaches that file's links. REQ-LIB-5 still cites two TARGET lines, "Visualization of data via Obsidian or equivalent is required" and "Connections are always visible". Mos's reading was that 1.17 as d8 wrote it met neither line for converted chapters. Their current links showed to the user only as clickable text inside the editor, and no graph or list showed them. Q226 leaves room for "another way to handle the visual brain map". The O2 design that landed for Vikunja 571 at 767bb62c7 held a Console Connections view and its tests as later work that waited for this answer. His call was whether 1.17 requires that view. As d8 was written, it did not. Mos recommended that it does, because impact map A6 says "Recommended: name the view" and TARGET says "Connections are always visible". Jason answered O2 (Q239): 1.17 requires the view. d9 writes it into REQ-LIB-5, its note and the Risks line, in the text of mos-1443 R3. The view comes with the conversion work after 10-27, and the 10-27 Case 2 release stays on Markdown (Q235 P6, Q237). That the import does not wait for the view is Mos's default in mos-1443 R3. Q239 doesn't address it, and Mos confirmed it at his J-b check (mos-1470).
|
||||
- J-c (mos-1374): "The store pushes to a remote (D7), and the Case 2 VM is in the nightly PBS backup. For a fixed restore point before her first real import, a manual backup of VM 1012 with PBS protect runs first. That step is reversible and needs no reboot." Mos's reading is that this sits inside the P5 go step, so it needs no new question.
|
||||
- J-d. How agents read a converted chapter, D9. His call. As written, an agent reads it through the ordinary Case 2 lookups in any thread or room, under the same project and universe access as Markdown canon. This is Mos's reading of F41 and REQ-LIB-7. The other choice is the model in the earlier O2 design, W4 sections 7.1 and 7.2. Under it, an agent reads a converted chapter only in a new writing conversation that holds one human and one agent, only after the business owner grants that agent access to that document, and by default only what the human attaches to each message. Comments and tracked deletions stay hidden from agents until a human turns on a setting for each. Markdown has neither, so the default keeps agents at the access Markdown gives them. Those two sentences are Mos's ruling mos-1379. A yes to the text as written settles it.
|
||||
- J-e. Versioning means the editor's tracked changes plus one git commit per save.
|
||||
- J-f. A converted chapter can be edited only in the Console while the stack is reachable. Obsidian no longer edits it offline.
|
||||
- J-g. The import takes Markdown only. Importing .doc files stays a separate task.
|
||||
- J-h. Autosave under REQ-LIB-9. Jason's Q226 F41 says "All changes are instantly committed and available to the agents." Mos's reading, recorded with that ruling, is "Each save is a commit at once, and agents read it at their next lookup." At the O2 design's D13 defaults, a save commits at most 2 seconds after a pause in typing or 15 seconds into steady typing, with no human action needed. Mos's reading in mos-1359 counts that delay as "instantly committed". Only a human changes the intervals. The PRD names no values, and the defaults stay in the design. Whether a delay of seconds fits his word "instantly" is his call, so this is marked for him.
|
||||
- J-i. In 1.17 a playground story that is DOCX can't become canon. That covers a playground Markdown file the human imports, a story the human starts in a playground in the editor, and the DOCX of a draft universe after it is made real. Today Melanie promotes a playground file by moving it into a book folder in Obsidian, and a DOCX in the writing store can't be moved that way. She can start a new story in the book and paste the text in, but it gets a new document id and the playground copy keeps the history. A later version adds DOCX promotion with C2-19, which comes after the slice.
|
||||
- J-j. Web links, text boxes and fields in a converted chapter. Jason's Q226 F41 says "All changes are instantly committed and available to the agents." The reader in this version can't read a web link, a text box, a field or hidden text. As written, the import turns each web link into plain text that keeps its label and address, and the human confirms that in the fidelity report. A web link that can't be kept safely as plain text refuses the import. If a later edit adds one of these, the save keeps it and the editor warns the human. Agents then get none of that part's text until a save takes it out.
|
||||
- J-k. The 1.12 note Jason approved says bus writes, C2-02 and C2-03b, don't gate 10-27. His Q226 "F42: ok" moved them into the 10-27 slice, and design 9.2 counts them in the smallest slice that lets Melanie start. Mos reads that as making them gate 10-27. The editor rows C2-11a and C2-11b still don't gate it, per his Q195 words "we need to get it moving as an add-on".
|
||||
- J-l. REQ-LIB-9 does not use REQ-PROJ-3's "permissive license" bar. It takes the licenses that the editor's independent security review accepted, because that review cleared fonts under the SIL Open Font License and the Ubuntu Font License, which not every reader counts as permissive. Mos's reading.
|
||||
|
||||
Marked as changes beyond P1 to P6, from the impact map (Q17, item 5):
|
||||
- A1 (archived scope and canon cites)
|
||||
- A2 (the conversion requirement, REQ-LIB-8)
|
||||
- A3 (outside the vocabulary, hard-wait list unchanged)
|
||||
- A6 (lookups across formats)
|
||||
- A7 (agent bounds)
|
||||
- A8 (DOCX cites)
|
||||
- Item 2 and mos-1375: each writing-store commit is pushed to a remote off the stack's host. Only a human sets it, it starts unset, and a repository on the stack's host doesn't count. Only the stack's host pushes to it, and no agent can reach it with any credential. Import and new story files stay closed until the remote is set and checked, and each import's archive push waits until the remote holds the DOCX commit. This keeps "Git is used for all changes -- local and remote" true for DOCX chapters.
|
||||
- Item 3 (the Hermes gate)
|
||||
- Item 4. Canon and playground story files convert one file at a time, including files in unmarked folders inside a book folder or a playground. Type-folder and supporting files stay Markdown. A story file outside every book folder and playground has no universe or book, so it converts only after a human maps its folder into a book folder or a playground. The mapping step is Mos's reading of P1 and Q30.
|
||||
|
||||
The F4 measurement goes with them.
|
||||
|
||||
## Files the row would own
|
||||
|
||||
The id count goes from 85 to 87. 1.16 owned three files because its count stayed at 85. Like 1.13, the last version that added ids, the row owns four files:
|
||||
- `docs/prd/mosaic-stack.md`
|
||||
- `packages/tasks/requirements.json`: the version 1.17, the two new ids REQ-LIB-8 and REQ-LIB-9 with their titles, and the changed titles of REQ-LIB-1, REQ-LIB-2 and REQ-LIB-4. The new ids go after REQ-LIB-7 and before REQ-INST-1, in the same order as the PRD's bullets.
|
||||
- `packages/tasks/tests/requirements.test.mjs`: the version pin 1.17, the id count of 87, and the duplicate-id message, which goes from `requirements[85].id: REQ-ROLE-1 twice` to `requirements[87].id: REQ-ROLE-1 twice`.
|
||||
- `packages/bus/tests/requirements.test.mjs`: the list length, which goes from 85 to 87.
|
||||
|
||||
The gate would match 1.16's:
|
||||
1. A reviewer approves the text.
|
||||
2. Jason says yes to the exact text through Mos.
|
||||
3. Both `requirements.test.mjs` files, in `packages/tasks/tests` and `packages/bus/tests`, and every `scripts/test-*.sh` that reads the PRD or `requirements.json` are green on Sage's gate.
|
||||
4. Mos gets the landing commit.
|
||||
@@ -0,0 +1,132 @@
|
||||
--- DRAFT-d8.md 2026-10-23 06:16:54.374694135 -0500
|
||||
+++ DRAFT-d9.md 2026-10-23 10:40:54.806553704 -0500
|
||||
@@ -1,6 +1,6 @@
|
||||
# PRD 1.17 draft: Case 2 story files are DOCX (Q235 to Q237, P1 to P6)
|
||||
|
||||
-Sage, 2026-10-23, for mos-1366 item 1 and Vikunja 570. Draft 8. It is d7 plus Mos's d8 fix list mos-1443 (see "d8 changes"). d7 is d6 plus Mos's ruling mos-1379 on Fenton's 571 B2 (see "d7 changes"). d6 is d5 with Webby's round 3 (webby-0207) fixed: B1 to B3 and N10 to N13, with N14 left for Mos (see "d6 changes"). d5 folds in:
|
||||
+Sage, 2026-10-23, for mos-1366 item 1 and Vikunja 570. Draft 9. It is d8 plus Jason's Q41 answer O2 (DECISIONS Q239, mos-1467), which makes J-b yes, Webby's round 5 N15 to N17 (webby-0210) and Webby's round 6 B1, N19 and N20 (webby-0212) (see "d9 changes"). d8 is d7 plus Mos's d8 fix list mos-1443 (see "d8 changes"). d7 is d6 plus Mos's ruling mos-1379 on Fenton's 571 B2 (see "d7 changes"). d6 is d5 with Webby's round 3 (webby-0207) fixed: B1 to B3 and N10 to N13, with N14 left for Mos (see "d6 changes"). d5 folds in:
|
||||
- Mos's d4 check ruling mos-1372 (D1 to D14; D15 was dropped).
|
||||
- mos-1374, which replaces J-c.
|
||||
- The impact map mos-1368 (jason-master-restart d183246, `projects/mosaic-mvp/case2-docx-impact-map.md`: A1 to A16, critic items C1 to C6, items 2 to 7).
|
||||
@@ -103,10 +103,11 @@
|
||||
|
||||
### REQ-LIB-2
|
||||
|
||||
-Replace "A file's scope comes from its path alone, prefixes first: a Markdown file
|
||||
-under a supporting prefix is supporting, one under a playground prefix at any level
|
||||
-is playground, any other Markdown file in a book folder is canon, and everything
|
||||
-else is unmapped and never returned. A folder in both lists is supporting." with:
|
||||
+Replace "A file's scope comes from its path alone, prefixes first: a Markdown
|
||||
+file under a supporting prefix is supporting, one under a playground prefix at
|
||||
+any level is playground, any other Markdown file in a book folder is canon, and
|
||||
+everything else is unmapped and never returned. A folder in both lists is
|
||||
+supporting." with:
|
||||
|
||||
"A Markdown file's scope comes from its path and from past imports, prefixes
|
||||
first: a Markdown file under the archive folder is archived, one under a
|
||||
@@ -191,10 +192,13 @@
|
||||
Replace "The user sees them in Obsidian's graph and backlinks." with "The user sees
|
||||
a Markdown file's links in Obsidian's graph and backlinks. A DOCX story file's
|
||||
wikilinks stay clickable in the Console's editor (O2 design D11), and no graph
|
||||
-shows them yet."
|
||||
+shows them yet. The Console's Connections view lists the current links and
|
||||
+backlinks of each story file the user may see, in both formats, with each one's
|
||||
+scope and format."
|
||||
|
||||
Version tag: 'and "Connections are always visible".)' becomes 'and "Connections
|
||||
-are always visible". Version 1.17, with Q222 for the two settings.)'
|
||||
+are always visible". Version 1.17, with Q222 for the two settings and Q239 for
|
||||
+the Connections view.)'
|
||||
|
||||
### REQ-LIB-6
|
||||
|
||||
@@ -273,8 +277,9 @@
|
||||
- Each stage of an import writes a logged event. The import's record on the
|
||||
stack's host names the source file's path, commit and blob and the new
|
||||
document id, and each event points to that record.
|
||||
- - After a conversion, a Markdown file at the converted file's old path is neither
|
||||
- canon nor playground. Lookups leave it out, the format map flags it, and the human is told.
|
||||
+ - After a conversion, a Markdown file at the converted file's old path is
|
||||
+ neither canon nor playground. Lookups leave it out, the format map flags it,
|
||||
+ and the human is told.
|
||||
- A new Markdown story file in a book folder that holds converted files stays
|
||||
canon until its import, unless it sits at a converted file's old path or under
|
||||
a playground prefix. The Console flags it and offers the import. Nothing
|
||||
@@ -413,8 +418,8 @@
|
||||
push within about a minute."
|
||||
- REQ-LIB-5, the 1.16 sentence: "The user sees them in Obsidian's graph and
|
||||
backlinks." A converted chapter's connections show in Obsidian only as they
|
||||
- stood at conversion, until a Console view of their links exists. Q226
|
||||
- records that view as a later option.
|
||||
+ stood at conversion, and the Console's Connections view shows their
|
||||
+ current links.
|
||||
- REQ-LIB-6, the 1.16 sentence: "A reply may cite lines of the repository at
|
||||
a commit or pages the agent fetched, and the broker checks every citation
|
||||
before it stores the message."
|
||||
@@ -451,8 +456,8 @@
|
||||
not `git diff`. (Version 1.17.)"
|
||||
- "A converted chapter's DOCX is not in Obsidian's graph. Obsidian shows the
|
||||
chapter only through its archived Markdown, and no DOCX edit reaches that file's
|
||||
- links. The DOCX's current links show only in the Console's editor until a
|
||||
- Console view of them exists. (Version 1.17.)"
|
||||
+ links. The DOCX's current links show in the Console's editor and its
|
||||
+ Connections view, and no graph shows them yet. (Version 1.17.)"
|
||||
- "Conversion can't be undone in place. Front matter, wiki link forms and
|
||||
unsupported blocks may not survive it, and the mirror can't refuse the user's
|
||||
push to an archived file. The controls are the fidelity report, the human's
|
||||
@@ -467,6 +472,15 @@
|
||||
import events, and the import's recovery covers both cases (Vikunja 571).
|
||||
(Version 1.17.)"
|
||||
|
||||
+## d9 changes (Q239 and Webby round 5)
|
||||
+
|
||||
+- J-b yes (Q239, mos-1467), in the five edits mos-1443 R3 set for a yes (Webby round 6 B1). R3.1: REQ-LIB-5's replacement gains the Connections view sentence after "no graph shows them yet.". R3.2: the graph Risks line ends with the editor and the Connections view. R3.3: the A6 line moves from "Not taken" under A6. R3.5: the REQ-LIB-5 note ends with the Connections view, which drops "until a Console view of their links exists" and "Q226 records that view as a later option". R3.4 is Gyro's design edit at 767bb62c7 (writing-editor.md:188-190, :240-244 and :1272, docx-citations.md:66), and it follows in his docs round. Beyond these and N21, nothing else in the PRD text changes.
|
||||
+- N19 and N20 (Webby round 6): J-b's question text is in the past tense, and the line that the import doesn't wait for the view is cited as Mos's R3 default. Mos confirmed it at his J-b check (mos-1470).
|
||||
+- N21 (Webby round 6, Mos yes in mos-1470): REQ-LIB-5's version tag cites Q239 for the Connections view beside Q222 for the two settings.
|
||||
+- N15: the D7 landing line gives R8's wording beside the impact map's quote.
|
||||
+- N16: the d7 changes line notes that R8 replaces "no agent credential reaches it" in d8.
|
||||
+- N17: the REQ-LIB-2 Replace quote and the REQ-LIB-8 old-path bullet are rewrapped under 82 columns. Their words are unchanged.
|
||||
+
|
||||
## d8 changes (Mos's d8 fix list, check wf_63bba879-180)
|
||||
|
||||
- R1: REQ-LIB-4's tail covers DOCX saves, which agents see at their next lookup after the editor reports them as committed. The notes quote the whole 1.16 sentence. Source: nit/jason/F10.
|
||||
@@ -535,7 +549,7 @@
|
||||
|
||||
- REQ-LIB-5 gains Mos's three sentences after the extracted-text sentence. The text agents read has tracked changes accepted. Comments, and text with tracked deletions shown, each wait for a setting only a human turns on, off by default. Its version tag cites Q222 for the two settings, which is the only text here beyond Mos's.
|
||||
- J-d gains Mos's sentence on comments and tracked deletions.
|
||||
-- Fenton's B1 is design only. d6's "no agent credential reaches it" holds, and the shared helper stays #431.
|
||||
+- Fenton's B1 is design only. d6's "no agent credential reaches it" holds (R8 replaces it in d8), and the shared helper stays #431.
|
||||
|
||||
## d6 changes (Webby round 3, webby-0207)
|
||||
|
||||
@@ -556,7 +570,7 @@
|
||||
- D4: REQ-LIB-8's one-way bullet, which carries the archive refusal and consequence F2's text, and the 571 list item.
|
||||
- D5: it landed in REQ-LIB-2's "a Markdown file at a converted file's old path is unmapped" in Webby's B2 form, and in the REQ-LIB-8 old-path bullet.
|
||||
- D6: REQ-LIB-5's freshness sentences.
|
||||
-- D7 and mos-1375: REQ-LIB-4's remote sentences, the remote step in REQ-LIB-8's order bullet, the fourth opening condition and the 1.17 note on when conversion opens, plus the 571 list item on W4 section 7.3, which replaces the no-remote rule of the old W4 section 7.4. The impact map's item 2 adds "only the stack's host pushes, and no agent credential reaches it".
|
||||
+- D7 and mos-1375: REQ-LIB-4's remote sentences, the remote step in REQ-LIB-8's order bullet, the fourth opening condition and the 1.17 note on when conversion opens, plus the 571 list item on W4 section 7.3, which replaces the no-remote rule of the old W4 section 7.4. The impact map's item 2 adds "only the stack's host pushes, and no agent credential reaches it", which R8 words in d8 as "no agent can reach it with any credential".
|
||||
- D8: the REQ-LIB-5 replacement, the import bullet's wiki-link sentence, the Risks line, the note quoting the old sentence, and "REQ-LIB-1 only gains sentences".
|
||||
- D9: the 1.17 note that agents read a converted story file through the Case 2 lookups, from the d4 check's consistency B2, and J-d, which puts the read model to Jason as his call.
|
||||
- D10: the d4 check's B5 sentence, in REQ-LIB-8.
|
||||
@@ -573,6 +587,7 @@
|
||||
- A3: the import is outside the vocabulary, the hard-wait list is unchanged, and the archive move isn't `data.delete`. The C6 code site is in the 571 list.
|
||||
- A4: the section lead and REQ-LIB-1's writing-store sentence.
|
||||
- A6: format and location in every answer, extracted text with DOCX locators, links across formats.
|
||||
+ - A6's named chapter-links view. D8 took B8's "no graph shows them yet", and J-b put the view to Jason. His O2 (Q239) takes it in d9 as REQ-LIB-5's Connections view (mos-1443 R3).
|
||||
- A7: read-only extends to the store and the archive, no agent action on a story file in any format, no agent DOCX write, and role contracts state the formats. C1's role contract line is a 571 build item.
|
||||
- A8: the DOCX cite shape, and a cite naming an archived file as current is refused.
|
||||
- A9: a hybrid sees a source's DOCX canon through REQ-LIB-2's source scope, and REQ-LIB-8 lets an exclusion name a DOCX document by its id. The id form lets the human exclude a single DOCX started in the editor, which has no old path. An archived file isn't canon, so no hybrid sees it.
|
||||
@@ -593,12 +608,11 @@
|
||||
|
||||
Not taken:
|
||||
- Impact map item 4's "files in unmarked folders are eligible one at a time", for folders outside every book folder and playground only. Their files are unmapped under REQ-LIB-2, so a DOCX made from one would have no universe or book to keep. The human maps such a folder into a book folder or a playground first, under REQ-LIB-1. A file in an unmarked folder inside a book folder or a playground is canon or playground, and the import takes it one file at a time.
|
||||
-- A6's named chapter-links view. D8 takes B8's "no graph shows them yet", and J-b puts the view to Jason.
|
||||
|
||||
## Marked for Jason (additions in the text he sees)
|
||||
|
||||
- J-a. Whether "We will not run the systems in parallel" applies per chapter or as one switch per book. His call. As written, it applies per chapter.
|
||||
-- J-b. A converted chapter's DOCX is not in Obsidian's graph. Obsidian shows the chapter only through its archived Markdown, and no DOCX edit reaches that file's links. REQ-LIB-5 still cites two TARGET lines, "Visualization of data via Obsidian or equivalent is required" and "Connections are always visible". Mos's reading is that 1.17 as written meets neither line for converted chapters. Their current links show to the user only as clickable text inside the editor, and no graph or list shows them. Q226 leaves room for "another way to handle the visual brain map". The O2 design that landed for Vikunja 571 at 767bb62c7 holds a Console Connections view and its tests as later work that waits for this answer. His call whether 1.17 requires that view. As written, it does not. Mos recommends that it does, because impact map A6 says "Recommended: name the view" and TARGET says "Connections are always visible".
|
||||
+- J-b. A converted chapter's DOCX is not in Obsidian's graph. Obsidian shows the chapter only through its archived Markdown, and no DOCX edit reaches that file's links. REQ-LIB-5 still cites two TARGET lines, "Visualization of data via Obsidian or equivalent is required" and "Connections are always visible". Mos's reading was that 1.17 as d8 wrote it met neither line for converted chapters. Their current links showed to the user only as clickable text inside the editor, and no graph or list showed them. Q226 leaves room for "another way to handle the visual brain map". The O2 design that landed for Vikunja 571 at 767bb62c7 held a Console Connections view and its tests as later work that waited for this answer. His call was whether 1.17 requires that view. As d8 was written, it did not. Mos recommended that it does, because impact map A6 says "Recommended: name the view" and TARGET says "Connections are always visible". Jason answered O2 (Q239): 1.17 requires the view. d9 writes it into REQ-LIB-5, its note and the Risks line, in the text of mos-1443 R3. The view comes with the conversion work after 10-27, and the 10-27 Case 2 release stays on Markdown (Q235 P6, Q237). That the import does not wait for the view is Mos's default in mos-1443 R3. Q239 doesn't address it, and Mos confirmed it at his J-b check (mos-1470).
|
||||
- J-c (mos-1374): "The store pushes to a remote (D7), and the Case 2 VM is in the nightly PBS backup. For a fixed restore point before her first real import, a manual backup of VM 1012 with PBS protect runs first. That step is reversible and needs no reboot." Mos's reading is that this sits inside the P5 go step, so it needs no new question.
|
||||
- J-d. How agents read a converted chapter, D9. His call. As written, an agent reads it through the ordinary Case 2 lookups in any thread or room, under the same project and universe access as Markdown canon. This is Mos's reading of F41 and REQ-LIB-7. The other choice is the model in the earlier O2 design, W4 sections 7.1 and 7.2. Under it, an agent reads a converted chapter only in a new writing conversation that holds one human and one agent, only after the business owner grants that agent access to that document, and by default only what the human attaches to each message. Comments and tracked deletions stay hidden from agents until a human turns on a setting for each. Markdown has neither, so the default keeps agents at the access Markdown gives them. Those two sentences are Mos's ruling mos-1379. A yes to the text as written settles it.
|
||||
- J-e. Versioning means the editor's tracked changes plus one git commit per save.
|
||||
@@ -0,0 +1,269 @@
|
||||
# Row 252 build notes: Console inbox Approve and Deny for grant requests
|
||||
|
||||
Seat: Scrooge. Reviewer: Webby. Issue #1753, Vikunja #435 (J2).
|
||||
Brief: `docs/plans/2026-10-21_console-inbox-approve.md` (blob b41676d06).
|
||||
Design: Gander's DESIGN.md at d218e14bd, approved by Webby at 5d8f0f4b5 (webby-0082) with manifest checks N1-N5.
|
||||
Base: aca16404c on branch `scrooge/row252`. Rebase onto the row 253 tip under a new branch name once 253 lands.
|
||||
|
||||
## Status
|
||||
|
||||
- Code, tests and docs are written. No test has been run yet, because Gander holds the gate slot for row 253 run 5 and Sage ruled no node until a CLEAR.
|
||||
- Everything in the Results section is empty until that run. Nothing below claims a pass.
|
||||
|
||||
## Q188
|
||||
|
||||
No agent creates a grant. Approve and Deny are human-only Console actions.
|
||||
|
||||
- Only a console cap reaches `decision.preview.console` and `decision.resolve.console`. A console cap reaches nothing else (console-decide `J1, Q188`).
|
||||
- The socket refuses a console proof for any other verb before the proof check (`server.mjs`).
|
||||
- A console cap binds only through `authenticateConsole`, which needs the console proof (section 2): the same-tree `console-cli.mjs` wrapper, its own nonce, a direct same-tree `serve` parent, and a configured owner subject from the spawn environment.
|
||||
- `recordEvent` keeps `human.input` reserved, so no agent writes the record that lets a console close start the executor (console-decide `recordEvent keeps human.input reserved`).
|
||||
- A `via console` close without its matching `human.input` approves nothing (console-decide `J14`).
|
||||
|
||||
## Manifest checks N1-N5
|
||||
|
||||
- **N1.** Every `console.sso` subject is an owner of the business. Name is display only.
|
||||
- `cli/src/config.mjs` carries `{provider, iss, sub}` per subject into the boot as `consoleOwners`. No sso means no key.
|
||||
- `bus/src/runtime.mjs` validates the list (array, at most 512, exactly three non-empty strings each) and passes it to `verifyPrincipal`.
|
||||
- Tests: cli config.test `Row 252 (Webby N1)` and principal.test.
|
||||
- **N2.** `human.input` is written in the same transaction, before `#approvedGrant`. The executor starts once, and a deny starts none.
|
||||
- Tests: console-decide `N2, J13` checks the order by seq and that the grant runs once. `J15` checks that a deny starts nothing.
|
||||
- **N3.** The close notice comes from `from_run 'human-console'`, and `public/bus.js` shows "via console". `landing` and `#protectedEnd` stay CLI-only.
|
||||
- Tests: console-decide `N2, J13` checks the notice. decide-browser `J17` checks the close-elsewhere line.
|
||||
- **N4.** `decision.resolve` is not a Console verb.
|
||||
- `CONSOLE_VERBS` is exactly the two console verbs. The webui serve `BUS_VERBS` read list has no decision verb, and webui `cli.mjs` has no `decision.` string. `consoleCall` refuses anything outside `CONSOLE_VERBS`.
|
||||
- Tests: console-decide `N4`, and decide-sso `N4`, which hits `/api/bus/decision.*` for 404 and covers the cli.mjs scan and the consoleCall refusals.
|
||||
- **N5.** `readProcess` keeps the five `MOSAIC_BUS_CONSOLE_*` keys in the env allowlist (`bus/src/human.mjs`). The human proof and its spawn are unchanged.
|
||||
|
||||
## Design choices and tradeoffs
|
||||
|
||||
- **Webui imports from the broker.** `webui/src/bus.mjs` imports `CONSOLE_VERBS` from `bus/src/broker.mjs`, which loads the broker module into the Console at import.
|
||||
- I chose one source for the verb list over a second copy that could drift.
|
||||
- If Webby prefers the copy, the alternative is a literal list plus a test pinning it equal to `CONSOLE_VERBS`.
|
||||
- **The Console transport shares humanCall's spawn.** `consoleCall` and `humanCall` share it as `transport()`, so `webui/src/bus.mjs` changed. The busCaller `business` default keeps `||` (the old falsy semantics), not `??`.
|
||||
- **Confirmations are held in memory in the serve process.** Their lifetime is 2 minutes, they are single use, and they bind the session, decision, choice and digest. The cap is a limit that never drops a live confirmation.
|
||||
- A restart loses all held confirmations. The user clicks again and gets a new preview. Nothing is written until the resolve.
|
||||
- **No retry anywhere.** A resolve whose bus reply is lost answers `outcome-unknown`, the confirmation is spent, and the page says "Nothing was sent again."
|
||||
|
||||
## Old tests changed (for Mos, per mos-1272)
|
||||
|
||||
Mos ruled both changes allowed in mos-1321 (17:12:28Z), each with one condition.
|
||||
- **shell.test condition:** reword the comment that opened "No Resolve control", since it is false once the row lands. It now says row 252's Approve and Deny is the one decision control, that its labels come from ACTIONS, and that the doesNotMatch keeps any literal label out of the markup. Webby checks the wording in review.
|
||||
- **channel-proof condition:** a header comment is not enough, because human.mjs changes what readProcess keeps. In the review, Webby reads the human.mjs and webui bus.mjs diffs and states two things:
|
||||
- the human proof's checks are unchanged
|
||||
- only the console verifier reads the five MOSAIC_BUS_CONSOLE_* keys, and each case is covered by a named test in console-decide or decide-sso
|
||||
- **Second row to land (252 or 239):** it recomputes the webui bus.mjs hash, adds its own header line, and its reviewer re-reads bus.mjs from the base to the combined tip.
|
||||
|
||||
- **`webui/tests/shell.test.mjs`**, write-boundary test. Allowed under mos-1321, with the comment reworded.
|
||||
- The `writes` list gains the new `fetch(url, ...)` in `decidePost`. It is first in file order (bus.js:362).
|
||||
- The `method:` count goes from 7 to 8.
|
||||
- A new assertion pins `decidePost`'s callers to `url` plus the two literal `/api/decisions/${enc(a.id)}/...` routes.
|
||||
- No existing entry was loosened.
|
||||
- **`bus/tests/channel-proof.test.mjs`**, sha256 re-pins with a header comment:
|
||||
- `bus/src/human.mjs` (N5 env keys) to bb13c146…c885.
|
||||
- `webui/src/bus.mjs` (consoleCall and `transport()`) to 701f009e…5272.
|
||||
- Any later edit to either file needs a re-pin.
|
||||
- `bus/tests/principal.test.mjs`, `webui/tests/tester-listener.test.mjs` and `cli/tests/config.test.mjs` have new tests appended only.
|
||||
|
||||
## Overlap with row 239 (Honker, b0c28366f, sage-2835)
|
||||
|
||||
- Row 239 also re-pins `channel-proof.test.mjs`:
|
||||
- `packages/webui/src/bus.mjs`, to 1eba9774…e5cf. That is the pin both rows change.
|
||||
- `packages/cli/src/transport.mjs`, which is 239 only.
|
||||
- `packages/bus/src/human.mjs` is a 252-only pin.
|
||||
- The two rows also share source files: `bus/src/broker.mjs`, `bus/src/runtime.mjs`, `webui/src/bus.mjs` and `webui/src/serve.mjs`.
|
||||
- Whichever row lands second rebases onto the first and recomputes the webui `bus.mjs` pin from the merged file. Both header comments are kept. It then reruns every touched test file whole.
|
||||
- Mos needs to see that re-pin (re-pins need Mos).
|
||||
|
||||
## Mutant plan (design section 6, J1-J17)
|
||||
|
||||
Each mutant is one edit to the named source. Run the killing test, then restore and compare the sha256 against the pre-mutant hash with `git status` clean apart from the build. Kill rules are written before the runs.
|
||||
|
||||
| J | Mutant | Source | Expected kill |
|
||||
|---|---|---|---|
|
||||
| J1 | eligibility from the request, `#consoleResolution` returns non-null for any decision | broker.mjs | console-decide `J1, J2` (ineligible) |
|
||||
| J2 | hardcode `approve = yes`, `deny = no` | broker.mjs | console-decide `J2` (go/stop, deny listed first) |
|
||||
| J3 | owner from name or header, skip the owner match in verifyPrincipal | principal.mjs | principal.test `console requires…` |
|
||||
| J4 | skip the serve-parent walk | principal.mjs | principal.test `console requires…` |
|
||||
| J5 | accept the human nonce namespace | principal.mjs | principal.test `console requires…` |
|
||||
| J6 | reuse the session from the confirmation, skip the live session check at resolve | decision-http.mjs | decision-http `session that ends`, decide-sso `listener gates` (new session) |
|
||||
| J7 | keep the console cap bound after the call (skip `release` for kind console) | server.mjs | **open**: no new test pins release for a console proof. Before the run, check whether an existing server test kills it. If not, add one and name it in the report. |
|
||||
| J8 | skip the same-origin check | decision-http.mjs | decision-http `gates`, decide-sso `listener gates` |
|
||||
| J9 | resolve without a confirmation token | decision-http.mjs | decision-http `a confirmation then a resolve`, `bad body` |
|
||||
| J10 | drop the choice, decision or session binding | decision-http.mjs | decision-http `binds the session, decision and choice` |
|
||||
| J11 | skip the digest, closed or business check | broker.mjs | console-decide `J11`, `N2, J13` (second answer closed) |
|
||||
| J12 | do not spend the confirmation | decision-http.mjs | decision-http `a second resolve refuses`, `confirmations… one use` |
|
||||
| J13 | write via cli, or omit the subject in human.input | broker.mjs | console-decide `N2, J13` |
|
||||
| J14 | `#approvedGrant` accepts via console without the human.input | broker.mjs | console-decide `J14` |
|
||||
| J15 | start the executor on any resolved choice | broker.mjs | console-decide `J15` and `J2` (stop starts nothing) |
|
||||
| J16 | `decide` true without sso or send | serve.mjs, public/bus.js | decide-sso `J16`, decide-browser `J16` |
|
||||
| J17 | retry on outcome-unknown or auto-submit after preview | public/bus.js | decide-browser `J17` (post count stays at 7) |
|
||||
|
||||
## Manifest
|
||||
|
||||
Source:
|
||||
- packages/bus/src/broker.mjs
|
||||
- packages/bus/src/client.mjs
|
||||
- packages/bus/src/console-cli.mjs (new)
|
||||
- packages/bus/src/human.mjs
|
||||
- packages/bus/src/principal.mjs
|
||||
- packages/bus/src/runtime.mjs
|
||||
- packages/bus/src/server.mjs
|
||||
- packages/cli/src/config.mjs
|
||||
- packages/webui/src/bus.mjs
|
||||
- packages/webui/src/cli.mjs
|
||||
- packages/webui/src/decision-http.mjs (new)
|
||||
- packages/webui/src/public/bus.js
|
||||
- packages/webui/src/serve.mjs
|
||||
|
||||
Tests:
|
||||
- packages/bus/tests/channel-proof.test.mjs (re-pins)
|
||||
- packages/bus/tests/console-decide.test.mjs (new)
|
||||
- packages/bus/tests/principal.test.mjs
|
||||
- packages/cli/tests/config.test.mjs
|
||||
- packages/webui/tests/decide-browser.test.mjs (new)
|
||||
- packages/webui/tests/decide-sso.test.mjs (new)
|
||||
- packages/webui/tests/decision-http.test.mjs (new)
|
||||
- packages/webui/tests/shell.test.mjs (old test changed, see above)
|
||||
- packages/webui/tests/tester-listener.test.mjs
|
||||
|
||||
Docs:
|
||||
- packages/webui/README.md
|
||||
- agents/scrooge/work/queue-252/BUILD.md (this file)
|
||||
|
||||
## Results
|
||||
|
||||
Not run. At the first CLEAR:
|
||||
1. Run each touched test file whole, with TMPDIR under /mnt/storage/scratch/tmp.
|
||||
2. Run the bus, webui and cli suites.
|
||||
3. Run the mutants above, then the drift check against refactor.
|
||||
|
||||
## Rebase onto fe4ee8c7b (sage-3482, 2026-10-23)
|
||||
|
||||
The old base aca16404c had drifted. Since then refactor changed 8 of the row's 24 paths, across 15 commits. I made a new branch, scrooge/row252-fe4ee8c7b, so scrooge/row252 22cc74645 is untouched and nothing was force-pushed. I rebased with local git, `-c core.hooksPath=/dev/null`, and no stash.
|
||||
|
||||
Commit map:
|
||||
- 4bd273bce -> 1891d36e4 (product and tests; six files conflicted)
|
||||
- ca4537cc9 -> 9e5980acd (BUILD.md; clean)
|
||||
- 22cc74645 -> 6fd206e80 (shell.test comment and BUILD.md; clean)
|
||||
|
||||
Conflicts, all in 4bd273bce, and how each was resolved:
|
||||
1. packages/bus/src/broker.mjs, verb lists. On the base, row 206 added the share verbs to USER_VERBS, and row 275 added VIEWER_VERBS, userLevel and BOARD_VERBS and removed the USER_LEVEL const. I kept the base's lists and dropped USER_LEVEL, because nothing on the base reads it. CONSOLE_VERBS goes in after USER_VERBS with its comment unchanged. The request() gate (`!!s.console !== CONSOLE_VERBS.includes(verb)`) auto-merged after the FED R4 access sweep and the user check. Its order relative to the user gate is the same as on the old base.
|
||||
2. packages/bus/src/runtime.mjs, startBroker. FED R4 (#1801) added `access.intervalMs` to the access check. I kept the consoleOwners validation and the frozen owners first, as in the row, and then the base's access check with intervalMs.
|
||||
3. packages/cli/src/config.mjs. FED R6 (#1800) added accessFor and `config.access`. I kept both: accessFor and then consoleOwners, and in bootConfig `config.access` and then `config.consoleOwners`. process.mjs passes the boot config to startBroker whole, so both keys reach it.
|
||||
4. packages/webui/src/cli.mjs. FED R6 moved the owner's bus options into consoleBus() (console-bus.mjs) and added userCaller and userOptions. I kept the base's form, added consoleCall to the bus.mjs import, and added decisionWrite to the declarations. I kept the row's `if (ssoOn && sendOn) decisionWrite = consoleCall(...)` after the consoleBus() call, and pass decisionWrite to startServer next to userOptions and federation.
|
||||
5. packages/webui/src/serve.mjs. FED R6 added granted-user sessions: userRoute gates them, and userOptions rebinds the options per request.
|
||||
- The signature now has both decisionWrite and userOptions/federation.
|
||||
- The session hunk keeps the base's signer and granted-user block. ssoSession is set only for a session with no `user`, which is the owner's. A granted user is refused at userRoute before the decision route anyway, because /api/decisions/* is not on userRoute's list. Under the new base this keeps the design section 2 rule that only the owner answers a decision.
|
||||
- /api/config keeps the base's `user` and `federation` keys. `decide` gains `!granted`, matching how the base gates `edit`, so a granted user's config never offers Approve and Deny.
|
||||
- The decisionWrite startup check and createConfirmations() auto-merged unchanged.
|
||||
6. packages/bus/tests/channel-proof.test.mjs, webui bus.mjs pin. Row 301 (#1808, mos-1449) moved the user transport into bus.mjs and re-pinned it to 39fcb27c. The row's consoleCall auto-merged on top. I kept row 301's comment and re-pinned to the merged blob's sha256, 604092cb706b152d458f299ff1071f6cd488774629012f96b672f7e9a16c0b2c. The human.mjs pin (bb13c146) auto-merged and matches the blob at the new tip. The row's existing header comment (Webby N5) still describes why bus.mjs is re-pinned. humanCall and transport() are unchanged.
|
||||
|
||||
Auto-merged without conflict: webui bus.mjs (consoleCall next to row 301's userCaller), webui README.md, bus client.mjs, human.mjs, principal.mjs, server.mjs and public/bus.js.
|
||||
|
||||
Two new-base reads I checked:
|
||||
- granted-user.test.mjs reads `/api/config` key by key and has no deepEqual on the whole object, so the extra `decide` key doesn't break it.
|
||||
- No other test pins one of the row's source files by sha256, apart from channel-proof.
|
||||
|
||||
Not run: no test, node or syntax check during this step. Sage's next CLEAR covers the push, the whole webui, bus and cli suites, every scripts/test-*.sh, and J1-J17. Plugins must show 0 failures (mos-1456/1462). J7 still needs a killer test. The serve.mjs `!granted` and ssoSession lines are new since the build, so they get mutants too. I'll add them to the J list at the run.
|
||||
|
||||
## Runs (sage-3488 CLEAR, 2026-10-23)
|
||||
|
||||
Gate tree: detached worktree of 3e6de9807 with the canonical node_modules linked, so
|
||||
`MOSAIC_REQUIRE_EDITOR_BUILD=1` is set (mos-1453). TMPDIR comes from mktemp under
|
||||
/mnt/storage/scratch/tmp. Each step runs under `timeout -k 10` (mos-1275):
|
||||
|
||||
| Step | Limit (s) |
|
||||
|---|---|
|
||||
| pkg bus, cli, plugins, webui, business (`node --test tests/*.test.mjs`) | 1800 each |
|
||||
| test-auth / conductor / config / discord / extension-package | 126 / 145 / 130 / 147 / 130 |
|
||||
| test-foundation / land-work / queue / release / task | 269 / 171 / 226 / 157 / 231 |
|
||||
| mutant single file | 300, chat-browser 600 |
|
||||
|
||||
The script limits are 3x the longest runs recorded in queue-253 (receipt 3b91cfdaf).
|
||||
|
||||
### First-run reds placed (mos-1272)
|
||||
|
||||
- pkg-bus at 3e6de9807: 902 pass, 1 fail. The failure is `N2, J13` in console-decide.test.mjs:180, a new
|
||||
test (0 human.input rows found, 1 expected). The cause is in the test, not the product. `events()` spread
|
||||
the parsed body after the row's `kind`, so an answer body's own `kind: 'answer'` overwrote
|
||||
`'human.input'` and the filter could never match. Three more filters on the same field had the same
|
||||
defect, :250 and :290 (count of human.input must be 0) and :252 (an action.refused exists). The two
|
||||
zero counts passed vacuously. Fix: the row's kind is also kept as `event`, set after the body, and all
|
||||
four filters read `event`. The deepEqual at :181 now names `event: 'human.input'`. The file then ran
|
||||
whole at 11 pass, 0 fail.
|
||||
- J7 (open in the plan): no existing test bound a console proof over the socket. The new test
|
||||
`J7: a console proof over the socket binds a cap for its one call and the reply releases it` in
|
||||
console-decide.test.mjs serves a real socket with authenticateConsole, makes one console call that
|
||||
answers and one that refuses (`decision-not-found`), and checks that both caps are released
|
||||
(`unauthenticated`). J7 is applied as `boundCap = kind === 'console' ? null : transient;` in server.mjs,
|
||||
which skips every release path for a console cap (finish, the finally, and socket close). It ran
|
||||
at 11 pass, 1 fail, failing only the new J7 test. KILLED. The restored server.mjs matched its pre-mutant sha256.
|
||||
- decide-sso.test.mjs (new) ran 2 pass, 2 fail before any mutant:
|
||||
- `J16`: its `{ send: null }` case reached `setup`, and startServer refused it, because a decision
|
||||
transport without `--send` never starts (serve.mjs guard). That case now asserts the refusal, and the
|
||||
`{ decisionWrite: null }` case still checks the read-only routes and `decide: false`.
|
||||
- `N4`: a POST to `/api/bus/decision.*` gets row 74's preview refusal (403 `read-only`, for every
|
||||
write without a route of its own) before any verb lookup. POST now asserts that refusal and GET
|
||||
still asserts 404. Either way the transport sees no call.
|
||||
- The file then ran whole at 4 pass, 0 fail.
|
||||
- Old-test reds, sent to Sage before any fix (status 2):
|
||||
- cli `access-boot.test.mjs` R6 B1-B3 come from this row. The fixture's SSO provider has no issuer,
|
||||
so `consoleOwners` maps `iss: undefined` and startBroker refuses the owner list
|
||||
(`invalid-host-request`). The file is 4/0 on fe4ee8c7b.
|
||||
- cli `compactions-launch.test.mjs` REQ-THREAD-2 T3, 5 tests, each "timed out waiting". They also fail
|
||||
0/5 on a fe4ee8c7b tree, so they are not this row's.
|
||||
- Correction (sage-3492): the compactions-launch reds were the environment, not a base red. The gate
|
||||
TMPDIR (`<gate>/tmp`) was long enough to break the launcher/bwrap paths. Alone in a short
|
||||
`mktemp -d /mnt/storage/scratch/tmp/scrXXXXXX` TMPDIR the file ran 5 pass, 0 fail, 0 skipped, and
|
||||
Sage's own gate ran it green. The file is unchanged.
|
||||
|
||||
### Rulings and further placements (sage-3492 to sage-3496)
|
||||
|
||||
- access-boot (Mos GO mos-1464, relayed in sage-3494): `access-boot.test.mjs:17`'s `authentik` provider
|
||||
gains `issuer: "https://idp.test"`, and nothing else changes. numstat against fe4ee8c7b reads 1 1.
|
||||
It is committed alone (b316e0a55). access.test.mjs:273 uses the same fixture but never reaches
|
||||
bootConfig, so it is untouched. The file ran 4 pass, 0 fail.
|
||||
- decide-browser.test.mjs (new) ran 0 pass, 3 fail before any mutant, then 1 pass, 2 fail after the
|
||||
first fix:
|
||||
- setup's `UPDATE decisions SET question=?` hit migration 3b's `decisions_no_update` trigger, because
|
||||
decisions is append-only. The test now writes its own open credential.mint grant decision, with the
|
||||
hostile question in the INSERT. It is the same two rows host-fixtures' grantDecision writes, and
|
||||
host-fixtures.mjs is unchanged.
|
||||
- `page()` visiting the URL it was already on was a same-document hash change, not a load. So J17's
|
||||
"closed elsewhere" step never re-read the bus, and the redirect test's second visit never redrew
|
||||
after signing out. `page()` now loads about:blank first, as editor-browser.test.mjs:216 does.
|
||||
- The file then ran whole at 3 pass, 0 fail (9e1601a20).
|
||||
- decide-sso J16 (sage-3492): the startServer refusal stays. The one config that starts without send
|
||||
also lacks a decision transport, since startServer refuses a transport without `--send`. That config,
|
||||
`{ decisionWrite: null, send: null }`, is now in the J16 loop and gets `decide: false` and the
|
||||
read-only routes. Webby rules in the manifest round.
|
||||
- J19 killer (new test in decide-sso.test.mjs): an access document with one granted user (alice). The
|
||||
listener has `--send`, a decision transport and a user transport. The owner's config says
|
||||
`decide: true`. Alice's says `user: true`, `send: true` and `decide: false`. Her POSTs to both
|
||||
decision steps get 403 `owner-only`, and the transport sees no call.
|
||||
- J18 is equivalent alone, because a granted session never reaches decisionHTTP. At serve.mjs:694 a
|
||||
session with `user !== undefined` meets `userRoute` before the decision branch. userRoute admits only
|
||||
`/api/chat*` and GETs of `/api/config` and the user files, never `/api/decisions/*`, so the 403
|
||||
`owner-only` comes before `ssoSession` is read. The `session.user === undefined` guard is a second
|
||||
layer behind that. The J19 test's owner-only POSTs pin the first layer.
|
||||
- J11c is equivalent. `s.human !== b.human` at broker.mjs:5604 can't hold for a console cap:
|
||||
- bindConsole (broker.mjs:1459) refuses `record.human !== b.human` with `human-required`.
|
||||
- Its cap carries `human: b.human` for its own business, and #cap freezes the session (:1094).
|
||||
- At resolve, `b` is `this.#business(s.business)` (:5324), the same business.
|
||||
- reloadBusiness refuses a document whose human differs (:517).
|
||||
So for any session with `s.console` set, the two humans are equal. Webby rules on it in the
|
||||
manifest round.
|
||||
- Mutants, part 2, on the tip test files (decide-sso 5/0, decide-browser 3/0 as the baseline).
|
||||
Every restore matched its pre-mutant sha256.
|
||||
- J16a: KILLED by decide-sso J16.
|
||||
- J16b: KILLED by decide-browser J16.
|
||||
- J17a: KILLED by decide-browser J17 and the redirect test.
|
||||
- J17b: KILLED by decide-browser J17.
|
||||
- J19: KILLED by decide-sso J19. granted-user stays 19/0 under it.
|
||||
- J18: SURVIVED decide-sso 5/0 and granted-user 19/0. It is equivalent alone, for the reason above.
|
||||
- Old webui stubs (Mos GO mos-1465, relayed in sage-3497): library-cli.test.mjs:17 and
|
||||
thread-claims.test.mjs:58 build a loader-hook stub of bus.mjs with no `consoleCall` export, and cli.mjs
|
||||
now imports it. Each busSource gains `export const consoleCall=()=>{throw Error('consoleCall outside --sso')};`
|
||||
in the neighbours' throwing form, and nothing else changes. numstat against fe4ee8c7b is 1 1 for each.
|
||||
Alone they ran 1/0 and 4/0. No mos-1316 item for compactions-launch: the whole cli rerun is the evidence.
|
||||
@@ -1585,3 +1585,13 @@ are never rewritten or removed; corrections are new entries.
|
||||
2026-10-23 | Huey (cabd45ca) | Row 272 round 2, sage-3354/3357/3358/3361 | Rebased onto 5fdfd7275 on huey/row272-5fdfd7275, preserving 219/295 and approved old-test hunks; rev3510 in-progress. New fallback test ran RED first in Sage's slot: expected legacy failure, 3 guards pass; slot returned. Bounded fallback and extra guards/mutants prepared for Sage's full gate; no post-implementation run or green claim.
|
||||
|
||||
2026-10-23 | Huey (cabd45ca) | Row 272 round 3, mos-1455 / sage-3435 | Added empty role authority arrays to new CLI fixture and guarded null old at all three chat render sites; browser tests byte-identical. Same 17-path manifest.r3, no local execution or queue writes. Follow-up candidate awaits Scrooge delta review and Sage gate; gate run 1 remains RED.
|
||||
|
||||
2026-10-23 | Sage (1ef1e4f8) | Rows 272 and 307 landings, row 306 design, row 252 rebase check | 272 landed d33989230 and 307 landed d243f6b25, both on full five-suite gates with mutants killed. Row 306 design r2 approved by Dewey (c31197), build going under mos-1463. Row 252 rebase 3e6de9807 on fe4ee8c7b checked and Scrooge given the slot (sage-3488).
|
||||
2026-10-23 | Sage (1ef1e4f8) | Rows 291 and 306 landings, row 308 launch | 291 (PRD 1.16, #1796) landed 4874d1e83 and 306 (#1813) landed 1676ad0de..2d0318a44 by temp-index replay, patch-ids equal, both on all-suite gates (mos-1455, plugins 0 fail, 306 mutants M1-M3 killed). 306 N1/N2 in DEFERRED 9c8877bdf. Row 308 (PRD 1.17, #1815) briefed and launched to Gosalyn; slot passed to them for claim, push and in-review. Scrooge told to rebase 252 on 9c8877bdf. Mos told (sage-3515, sage-3520).
|
||||
2026-10-23T17:29:46Z | Gyro (Codex gpt-6.1-sol, sage-3542) | 571 REQ-LIB-5/Q239 Connections design amendment | Proposed W8 plus parent/W4 alignment; Mos build order kept distinct from import acceptance. Static docs checks only, no repo Node/tests/live action. Fenton review, Sage landing.
|
||||
2026-10-23T17:32:37Z | Gyro (Codex gpt-6.1-sol, sage-3544) | 571 Connections N1/N2 | W7 opening-order cross-references and human-view comment/deletion exclusion clarified. Static docs checks only; no repo Node/tests/live action. Delta to Fenton, Sage lands.
|
||||
2026-10-23T17:48:43Z | Scrooge (629b6cd3) | Row 252 Console inbox Approve and Deny (#1753) | Rebased onto 306 landing as 580037105 (range-diff all =), slot run bus 907/0 webui 410/0 cli 943/0, in-review revs 3608/3609, Webby r1 APPROVE, J1-J19 specs to Sage; Sage landed 45ea3fa0d (done rev 3616). Part 1 mutant results were never in BUILD.md; they went to Sage by T3 (scrooge-0252-mutant-specs).
|
||||
2026-10-23 | Sage (1ef1e4f8) | Rows 308 and 252 landings, 571 Connections design amendment, Vikunja 597 | 308 (PRD 1.17, #1815) landed 30e6bb680 and 252 (#1753) landed 45ea3fa0d (replay of 580037105 onto 30e6bb680, range-diff all =), each after a full gate on the landed tree (252 also J1-J19, J11c and J18 equivalent); Gyro's 571 amendment (Fenton APPROVE) landed e8bb13df8; Vikunja 570, 435 and 597 done, canonical webui esbuild 0.28.2; queue revs 3589-3616 committed 59f013247
|
||||
2026-10-23 | Sage (1ef1e4f8) | Vikunja 571 W build rows; rows 13, 42, 257 and 289 check | Filed the design's ten W rows as queue rows 309-318 (revs 3617-3626, owners set to unassigned 3627-3636, queue commit 293b42fee pushed); Vikunja 571 done (comment 994). Row 13's candidate fd72d2689 is on refactor, gate is Monday's row 7 ledger run; 42 paused under mos-1184; 257 post-v1; 289 waits on 214 and 288. Slot released 17:56Z.
|
||||
2026-10-23 | Fethry (Codex gpt-6.1-sol, 14f80e3c) | Row 225 C2-10b (#1726), Q245 handoff | Recovered Morgana's 9a131e956 by fast-forward on fethry/row225 in the assigned T3 worktree. Static review and contract confirmation in progress; all Node/tests require Sage CLEAR. No acceptance claim.
|
||||
2026-10-23 | Fethry (14f80e3c) | Row225 T1 lane A sage-3641/3647 (#1726) | Continued Morgana handoff, fixed nested status limits and wrong-project revert receipt after RED, kept invalid-mapping diagnosis visible with RED/GREEN. Renderer9/0, routes13/0, browser9/0, full library81/0, channel-proof2/0; isolated mutants14/14, restored SHA256 checks and clean worktree sources. Old-test approval mos1510 preserved80/66 and3/1. Slot returned with no processes around19:29Z. Dewey source-review packet prepared; full webui/build and integration gate remain pending.
|
||||
@@ -187,8 +187,10 @@ canon Markdown chapter takes its position by that rule or a human's committed or
|
||||
import preserves its chapter ID and position. Human reordering commits the manifest.
|
||||
library_manuscript and next_chapter use this order, never archived paths. Each
|
||||
answer/page names format, owned location/ID and captured commit. DOCX wikilinks stay clickable
|
||||
in the Console editor; no graph shows their current links yet. A Console Connections view
|
||||
and its tests are later work, waiting for Jason's J-b answer in PRD 1.17. Obsidian's archive
|
||||
in the Console editor, and no graph shows them yet. Under PRD 1.17 REQ-LIB-5 and Q239,
|
||||
the Console's Connections view lists the current links and backlinks of each story file
|
||||
the user may see, in both formats, with each one's scope and format. W8 owns that view
|
||||
and its tests. Obsidian's archive
|
||||
graph is historical, not a live DOCX graph. No graph implementation is in these W rows. New Story chooses universe/book or playground and gets
|
||||
its place in that manifest from its first DOCX commit, without an MD copy.
|
||||
|
||||
@@ -242,8 +244,8 @@ follow stable identities without an agent rewriting story links.
|
||||
Obsidian's old Markdown graph is historical after conversion. It does not track later DOCX
|
||||
edits, and it is not a parallel writing surface. The format map names current files and
|
||||
clickable editor links resolve across formats; it is not a graph view. No graph shows DOCX
|
||||
links yet. The later Connections view waits for Jason's J-b answer; it and its tests are
|
||||
outside the current W3/W7 scope. No Markdown export or Obsidian graph parity is promised. `.doc`/`.qxd` imports remain separate D23 work.
|
||||
links yet. W8 supplies REQ-LIB-5's Console Connections view: current links and backlinks
|
||||
of each story file the user may see, in both formats, with each one's scope and format. No Markdown export or Obsidian graph parity is promised. `.doc`/`.qxd` imports remain separate D23 work.
|
||||
|
||||
D12. Q235–Q237 withdraw the superseded-notice proposal and its open-Q36 boundary. Current
|
||||
Case 2 chapter reads after conversion use W4b's committed DOCX reader/citations. Agent
|
||||
@@ -579,12 +581,19 @@ runs Jason's layout agent nor automatically grants it access or sends book text
|
||||
|
||||
All rows follow BRIEF-TEMPLATE. They are not queue entries. S0 M1–M14 remain binding throughout W2/W6; source/target
|
||||
changes return to security review. W7 adds the policy conversion/routing row. S0 and the original W4 design have reviewed verdicts; this policy revision goes to Fenton.
|
||||
Their implementation gates remain separate. No code row W1/W2/W6/W3a/W3b/W3/W4b/W5/W7 enters the queue
|
||||
Their implementation gates remain separate. No code row W1/W2/W6/W3a/W3b/W3/W4b/W5/W7/W8 enters the queue
|
||||
before S0 PASS (recorded for this baseline, with M1–M14 still binding). Each also observes its explicit dependencies, source ownership, the CSP gate
|
||||
and the MVP gate-slot priority. Q177 permits chaining reviewed candidates, not overlapping
|
||||
owners. Sage assigns model-only seats. Each implementation reviewer is Opus 5.5 and did not
|
||||
author the code. Fenton reviews this design and can review code only when not its author.
|
||||
|
||||
Build order (mos-1470, Vikunja 571 comment 961): W7 first supplies reviewed conversion/format
|
||||
routing code with production import still closed, then W8 lands the Connections view, then
|
||||
W7's human opening step may open the first real chapter import. W8 is after W3/W4b and
|
||||
W7's closed routing candidate, before that W7 opening step. This is Mos's build-order rule,
|
||||
not a new REQ-LIB-8 condition or an addition to import acceptance. No converted real chapter
|
||||
exists without the view. O2 code remains after 10-27 and never ahead of MVP rows.
|
||||
|
||||
G1. Future code acceptance runs each touched test file independently and affected package
|
||||
suites on Sage's slot after MVP priority, plus required repository checks. Source builds need
|
||||
pinned tools, reproducible hashes, license/source manifests and independent review. Integration browser
|
||||
@@ -1258,6 +1267,7 @@ Independent conversion/parser/authorization review, writing/library/bus/harness/
|
||||
pinned-copy and sandbox closure tests, plus W4 A19/A20/A33–A35 and G1. Source archive, off-host acknowledged DOCX and
|
||||
format-map snapshot must match the new DOCX publication before completion. No real import
|
||||
opens before all D12 gates. The October 27 Markdown and supporting-doc fixtures still pass.
|
||||
The human opening step follows W8's landing (mos-1470, build order, not an acceptance condition).
|
||||
|
||||
### Handoffs
|
||||
|
||||
@@ -1265,6 +1275,83 @@ Owner sends commit/blob and fixture publication/crash evidence directly to the r
|
||||
Sage through T3. Reviewer sends verdict to owner/Sage. Copy Mos for the later first-real-book
|
||||
go or any proposed policy change, never ask an agent to execute that go.
|
||||
|
||||
## W8 Console Connections view for Markdown and DOCX story files
|
||||
|
||||
### Problem
|
||||
|
||||
PRD 1.17 REQ-LIB-5 at 30e6bb680, approved through Q239, requires the Console to list
|
||||
current links and backlinks of every story file the user may see, in both formats, with
|
||||
scope and format. Clickable editor wikilinks and Obsidian's historical archive graph do
|
||||
not supply this view.
|
||||
|
||||
### Owner and reviewer
|
||||
|
||||
- Owner: Sage assigns the seat, using Codex gpt-6.1-sol for cross-format lookup and authorization.
|
||||
- Reviewer: an independent Opus 5.5 seat assigned by Sage, not the author.
|
||||
- After: W3, W4b and W7's reviewed closed conversion/format-routing candidate; serial handoff
|
||||
from W7 for shared library/WebUI files and from C2-11a/11b and C2-10b for shared UI paths.
|
||||
- Before: W7's human opening step for the first real chapter import, under mos-1470. This
|
||||
orders builds, not REQ-LIB-8 acceptance, and does not change its four opening conditions.
|
||||
Post-10-27 only, with no gate slot ahead of MVP rows.
|
||||
|
||||
### Files owned
|
||||
|
||||
New: `packages/library/src/connections.mjs`, `packages/library/tests/connections.test.mjs`,
|
||||
`packages/webui/src/connections-http.mjs`,
|
||||
`packages/webui/src/public/{writing-connections.js,writing-connections.css}`,
|
||||
`packages/webui/tests/{writing-connections.test.mjs,writing-connections-browser.test.mjs}`.
|
||||
Existing or handed off from W7/W3: `packages/library/src/{index.mjs,links.mjs}`,
|
||||
`packages/webui/src/{serve.mjs,bus.mjs}`,
|
||||
`packages/webui/src/public/{index.html,writing-pane.js,writing-pane.css}`,
|
||||
`packages/webui/README.md`.
|
||||
|
||||
### What ships
|
||||
|
||||
A Console Connections control beside story navigation opens a keyboard-accessible list
|
||||
with Links and Backlinks sections for the selected story. Each item shows its title,
|
||||
scope and format, and opens the current authorized story through the existing resolver.
|
||||
It works for Markdown, DOCX and a partly converted book. It uses committed link metadata
|
||||
and W7's stable identities/format routing, never unsaved editor buffers or archive content.
|
||||
The response names the captured versions; after a committed save or conversion publication,
|
||||
a refresh uses the current authorized snapshot. An in-flight stale result cannot replace
|
||||
that refresh. An empty section says there are no visible links; it does not reveal hidden
|
||||
counts or titles. Unresolved links remain visibly unresolved and cannot open guessed paths.
|
||||
|
||||
A human-only Console read route uses existing authenticated project/universe/source access
|
||||
and exclusions. Authorize both endpoints of every displayed edge before returning titles,
|
||||
paths or counts. Backlinks cannot reveal another business, a denied universe, excluded
|
||||
story or archived source. Links inside comments or tracked-deletion text are not current
|
||||
story links, so the human Connections view never shows them and never depends on an agent
|
||||
setting. Final-view story links use the same committed extraction rules as W4b. Archive links are historical
|
||||
and excluded from this current-story view. No new agent grant, tool or conversation gate.
|
||||
|
||||
`connections.test.mjs` covers forward/backlinks across both formats, mixed-book identity
|
||||
preservation through conversion, current committed saves, scope/format labels, exclusions,
|
||||
archive/old-path refusal, unresolved targets and denial without metadata leaks. The HTTP/UI
|
||||
suite in `writing-connections.test.mjs` covers authentication, access revocation, response
|
||||
version binding, stale refresh rejection and refusal rendering. The browser fixture suite
|
||||
covers keyboard/focus, Links/Backlinks empty states, labels, cross-format navigation and
|
||||
refresh after save/publication. Fixtures only, never Melanie's text or a live stack.
|
||||
|
||||
### Out of scope
|
||||
|
||||
A node graph, Obsidian graph parity, editing links or story text, agent tools, private-book
|
||||
conversion, changes to REQ-LIB-8 acceptance, Q234's header, mos-1363 or S0 M1–M14.
|
||||
|
||||
### Gate
|
||||
|
||||
Independent Opus 5.5 review of access filtering and the human view, the named fixture suites
|
||||
and G1 on Sage's slot. Evidence shows both formats and mixed conversion state without
|
||||
archive or denied-source leakage. Sage records W8 landing before W7's first-real-import
|
||||
opening step per mos-1470; no import acceptance test or PRD condition is added here.
|
||||
|
||||
### Handoffs
|
||||
|
||||
Owner sends pushed commit/blob and fixture evidence directly to the reviewer and Sage via
|
||||
T3. Reviewer sends verdict to owner and Sage. Sage orders W8 landing before the W7 human
|
||||
opening step, and hands the shared files back before further W7 edits. Copy Mos for the
|
||||
first-real-book go or any proposed policy change.
|
||||
|
||||
## Engineering choices from mos-1368
|
||||
|
||||
This table resolves the map's engineering prompts; these are design decisions, not questions
|
||||
@@ -1282,7 +1369,7 @@ Later mos-1372/1375 override A32/A33's per-document/dedicated-session assumption
|
||||
| Q7 / A32/A33 | mos-1372 D9: ordinary Case 2 access in any thread/room, no per-document grant/share/dedicated session; existing supporting writes continue; marked for PRD 1.17 approval |
|
||||
| Q8 / A36 | W4b/W7: preserve Case 2 find/get/search/manuscript/universe tools via host committed-reader adapters, not fewer tools or raw ZIP access |
|
||||
| Q9 / A73 / C2 | W7: D10 manifest order, typed next_chapter, paragraph cursors bound to snapshot/access; both W4 byte cap and harness REPLY_CAP apply, never cut paragraphs or invent line equivalents |
|
||||
| Q10 / A22 | W3/W7 keep clickable cross-format editor links; no DOCX graph yet. Connections view/tests are later work, waiting on Jason's J-b answer; Obsidian archive graph is historical |
|
||||
| Q10 / A22 | W3/W7 keep clickable cross-format editor links; W8 supplies current links/backlinks for visible story files in both formats with scope/format (REQ-LIB-5, Q239); no DOCX graph yet; Obsidian archive graph is historical |
|
||||
| Q11 / A37 | W7: Console archive saves refuse; sync flags later archive edits or recreated old paths and excludes them from current canon; no remote-push refusal/protected-pattern guarantee |
|
||||
| Q12 / A21 | W7: reviewed markdown-it AST + first-party DOCX adapter; no new runtime converter; input cap 1 MiB default, W4 ZIP/XML validation, construct/token/extractor fidelity before archiving |
|
||||
| Q13 | W7 survey: synthetic construct corpus and aggregate-only count capability; no seat reads real text or claims a corpus census happened |
|
||||
@@ -1317,7 +1404,9 @@ renderer does not enable it. No change is imposed on the October27 release.
|
||||
|
||||
Alignment note: sage-3121 checks this revision against PRD 1.17 d6,
|
||||
SHA-256 `886b93c571f87bfbb2f27ee3113b6800a32d8f89196d95ace33566031bee380a`.
|
||||
Connections graph/tests wait for J-b; new non-old-path Markdown stays canon until import;
|
||||
That historical d6 alignment is superseded for Connections by landed PRD 1.17 at 30e6bb680:
|
||||
REQ-LIB-5/Q239 require W8's list view, ordered before real import under mos-1470.
|
||||
New non-old-path Markdown stays canon until import;
|
||||
archive folder is human-set in the library mapping with no default.
|
||||
|
||||
## Current verification and remaining gates
|
||||
@@ -1332,4 +1421,5 @@ append-only logs. No build, browser run, conversion, queue entry or live change
|
||||
Jason's format and CSP choices are settled by Q234–Q237. No question repeats Q1 or Q36.
|
||||
Before real conversion: Sage's Case 2 PRD amendment (Vikunja 570) needs Jason's approval;
|
||||
W4b/W7, Hermes-retired and post-10-27 gates must pass; Jason must explicitly give the first real Melanie-book
|
||||
conversion go. These are later authorization gates, not requests to convert anything now.
|
||||
conversion go. W8 lands before the human opening step under mos-1470 as build order, not
|
||||
an acceptance condition. These are later authorization gates, not requests to convert anything now.
|
||||
@@ -66,7 +66,11 @@ A Markdown file recreated at a converted old path is unmapped, neither canon nor
|
||||
excluded from lookups and flagged to the human. A new Markdown story at a different path in
|
||||
a converted book stays canon until import, flagged and offered for human import; no automatic
|
||||
conversion. Existing playground scope rules remain. Clickable DOCX editor links stay; no
|
||||
DOCX graph exists yet. A Connections graph and its tests wait for Jason's J-b answer.
|
||||
DOCX graph exists yet. PRD 1.17 REQ-LIB-5 and Q239 require the Console's Connections view
|
||||
to list the current links and backlinks of each story file the user may see, in both
|
||||
formats, with each one's scope and format. Parent design W8 owns the view and its tests.
|
||||
Mos-1470 orders its landing before W7's first-real-import opening step as build order,
|
||||
not an additional REQ-LIB-8 acceptance condition.
|
||||
|
||||
Every conversion runs the pinned extractor before archiving and refuses unsupported output.
|
||||
An independently reviewed importer preserves every wiki token and front-matter key.
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
# PRD 1.17 brief: Case 2 story files are DOCX
|
||||
|
||||
Sage, 2026-10-23, for mos-1366 item 1, mos-1467 and mos-1470. This follows
|
||||
`docs/plans/BRIEF-TEMPLATE.md`. Gitea #1815, Vikunja 570.
|
||||
|
||||
## PRD 1.17 Case 2 story files are DOCX (Q235 to Q237, Q239)
|
||||
|
||||
### Problem
|
||||
|
||||
Jason's Q235 to Q237 make Case 2 story files DOCX, with Markdown kept for notes
|
||||
and docs. PRD 1.16 still says every story file is Markdown in the user's
|
||||
repository, seen in Obsidian. The 1.17 text is approved: Jason approved d8 at
|
||||
435a7458d in Q239 with O2, which adds the Console Connections view (mark J-b).
|
||||
d9 carries that view in Mos's mos-1443 R3 text. Webby approved d9 in rounds 7
|
||||
and 8 (webby-0214, webby-0217), and Mos passed the J-b check in mos-1470.
|
||||
|
||||
The approved text is `agents/sage/work/prd-1-17/DRAFT-d9.md` at 4607e15b8, blob
|
||||
sha256 02f28decad7f946f. Its base is PRD 1.16, `docs/prd/mosaic-stack.md` blob
|
||||
a6db9b4a at 482e865ac (row 291).
|
||||
|
||||
### Owner and reviewer
|
||||
|
||||
- Owner: Gosalyn.
|
||||
- Reviewer: Webby.
|
||||
- After: row 291 (PRD 1.16).
|
||||
|
||||
### Files owned
|
||||
|
||||
The four files in DRAFT-d9.md's "Files the row would own", as it lists them:
|
||||
- `docs/prd/mosaic-stack.md`.
|
||||
- `packages/tasks/requirements.json`: version 1.17, the titles of REQ-LIB-1,
|
||||
REQ-LIB-2 and REQ-LIB-4, and the new ids REQ-LIB-8 and REQ-LIB-9 after
|
||||
REQ-LIB-7 and before REQ-INST-1.
|
||||
- `packages/tasks/tests/requirements.test.mjs`: the version pin 1.17, the count
|
||||
87 (:21), and the duplicate-id message `requirements[87].id: REQ-ROLE-1 twice`
|
||||
(:77).
|
||||
- `packages/bus/tests/requirements.test.mjs`: the list length 87 (:48).
|
||||
|
||||
### What ships
|
||||
|
||||
- Every "Replace", "Add, after", "becomes" and "New" instruction in DRAFT-d9.md's
|
||||
PRD sections, applied to the 1.16 text word for word. Each quoted old text
|
||||
occurs once in a6db9b4a, except "The Console shows each cite's scope.", which
|
||||
d9 scopes to REQ-LIB-2. Webby checked those counts in round 6.
|
||||
- The 1.17 header, Status line, source lines and notes as d9 writes them.
|
||||
- requirements.json as d9's requirements.json note says: REQ-LIB-1, REQ-LIB-2 and
|
||||
REQ-LIB-4 take the new titles, REQ-LIB-5 and REQ-LIB-6 keep theirs, and
|
||||
REQ-LIB-8 and REQ-LIB-9 are added with the titles d9 gives, so the count is 87.
|
||||
REQ-LIB-4's title is 117 characters, under the 120 limit in `requirements.mjs`
|
||||
(mos-1443 R2).
|
||||
- Nothing from d9's review sections goes into the PRD. That covers "Settled
|
||||
points", the "d2 changes" through "d9 changes" lists, "What d5 adds", "Marked
|
||||
for Jason" and the impact map notes.
|
||||
|
||||
### Out of scope
|
||||
|
||||
- The build rows for Vikunja 570 and 571, which Sage files after the landing.
|
||||
- The queue changes in the impact map (A24, A57 to A59), which go through
|
||||
`scripts/mosaic queue` (C9).
|
||||
- Gyro's design edit R3.4 at 767bb62c7.
|
||||
- Mos's build-order call (mos-1470): the Connections view lands before the first
|
||||
real chapter import opens. That belongs to Gyro's 571 rows, not the PRD.
|
||||
|
||||
### Gate
|
||||
|
||||
- Webby checks the candidate's PRD diff against DRAFT-d9.md, one instruction at a
|
||||
time, and checks that nothing else changed.
|
||||
- No new Jason question. Q239 approved the text, and a change beyond d9 would
|
||||
need a new version and his approval.
|
||||
- On Sage's gate:
|
||||
- tasks, run whole;
|
||||
- bus, run whole, because the broker loads requirements.json;
|
||||
- cli `stack-copy.test.mjs`;
|
||||
- every `scripts/test-*.sh`, under `timeout -k 10`.
|
||||
- Mos gets the landing commit (mos-1470).
|
||||
|
||||
### Handoffs
|
||||
|
||||
Every seat hands off directly (DECISIONS Q210, mos-1221). When the owner pushes a
|
||||
round or the reviewer posts a verdict, that seat messages the next seat's T3
|
||||
thread and Sage's with `mcp__t3__t3_send_message`. Mos has one step here, which
|
||||
is receiving the landing commit.
|
||||
@@ -664,3 +664,17 @@ collection never checks it again and the count reads as known with 0. The row 30
|
||||
behavior as it stands, so the move didn't change it. Bound to a follow-up row on row 270's
|
||||
store-unreadable path. The fix keeps the unreadable state until the header reads clean, or re-checks the
|
||||
header on every collection. Either way it's an old-test change and goes to Mos.
|
||||
|
||||
## Row306 N1: the revoke Set doesn't survive a broker restart
|
||||
|
||||
Morgana, row 306 BUILD.md (#1813, landed 2d0318a44; Dewey agrees, dewey-0918). `#accessRevoked` lives in
|
||||
memory. After a broker restart, recover() rebinds an earlier host's run, and if that run makes a bus call
|
||||
before the launcher's SIGTERM, it answers `not-holder` and the run exits 22, as every revoked run did before
|
||||
306. Seeding the Set at a rebind needs a mark only `#revokeLost` writes; `reason` and `by` on the ended
|
||||
claim aren't one (design D1's alternative). Bound to the next row that changes the broker's recover() path.
|
||||
|
||||
## Row306 N2: a pending limit stop answers before the revoke
|
||||
|
||||
Morgana, row 306 BUILD.md (#1813, landed 2d0318a44). A revoked run that also has a pending limit stop gets
|
||||
`#limitStop`'s `not-holder` on `message.receive` and `state`, because that check runs before `#agent`. It's
|
||||
rare and the run still stops. Bound to the next row that changes `#limitStop` or the order of those checks.
|
||||
+15
-4
@@ -33,7 +33,7 @@ Gaps found while working go to `docs/plans/DEFERRED.md`, not here.
|
||||
|
||||
<!-- mosaic-queue:begin -->
|
||||
|
||||
Generated from `docs/plans/queue.json` revision 3588 by `queue render`. Do not edit between the markers; change the queue with `scripts/mosaic queue`.
|
||||
Generated from `docs/plans/queue.json` revision 3636 by `queue render`. Do not edit between the markers; change the queue with `scripts/mosaic queue`.
|
||||
|
||||
| # | Piece | Owner | Issues | State | After | Gate | Brief | Note |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
@@ -288,7 +288,7 @@ Generated from `docs/plans/queue.json` revision 3588 by `queue render`. Do not e
|
||||
| 249 | row 235 follow-up: the grant undo records hostLineLeft when install never returned, since the remote add can outlive an abort or timeout (mos-1166) | gizmoduck; reviewers duckworth | #1751 | done | — | Duckworth approves the manifest. On Sage's gate the bus suite and the whole touched test files are green, and a mutant that drops the new catch branch is killed. (sage) | `docs/plans/2026-10-20_host-credentials.md` § Machine grant row b follow-up: the undo can't prove the remote add has ended | LANDED 9de5a57ab on refactor, pushed with 7b9737953 (DEFERRED N1). Range-diff: 8a04f4aa4..05595794b vs 8ca064158..9de5a57ab, same 3 paths, patch-id 99551b122e66 on both. Gate sage-2026 14:53Z: grant-executor whole 39/0, bus 598/0, no stub left, C1 (drop :1025) killed by G8 and both G23. Duckworth approve c30070. |
|
||||
| 250 | K12 (cohort.test.mjs) reads cgroup.events after cgroup.kill under load: print the shim's reason, then fix the cause at the source (Vikunja #450) | gizmoduck; reviewers filbert | #1755 | done | 197 done | reviewer approves the manifest; conversation and control-board suites whole on Sage's slot (sage) | `docs/plans/2026-10-21_k12-cohort-events.md` § Brief: K12 reads cgroup.events after cgroup.kill under load | LANDED 1b6158ce2 on refactor 19:42Z: candidate c1a858975 on 3b0aef995, manifest eca0b8e2, Filbert APPROVE rev 2957 (#1755 c30130). patch-id 29786caa = candidate; blob diff empty; tree 59f1e4781 = merge-tree. Gate on Sage slot sage-2109 (gizmoduck-0150): P1/P2/M1 as predicted, conversation whole 3x 183/183 plus concurrent pair, control-board 124/124. No drift on paths since base. |
|
||||
| 251 | T27 (host-run.test.mjs:453) lists no identities right after ssh-add -t 1: print timing and agent state, then fix the cause at the source (Vikunja #453) | darkwing; reviewers dewey | #1756 | done | 197 done | reviewer approves the manifest; bus suite whole on Sage's slot (sage) | `docs/plans/2026-10-21_t27-ssh-add-lifetime.md` § Brief: T27 lists no identities right after ssh-add -t 1 | LANDED d37210288 on b79ad5f2c: candidate 27f01ef63 manifest f2bdd684, patch-id 440d2442c976 equal, blob diff empty, tree matches merge-tree. Dewey r2 approve rev 2996 (c30168). Gate: bus suite whole in a clean worktree, 627/627 at 21:30:33Z on Sage's slot. Overlap check vs 194/198/244/253/254 branches: none. DEFERRED sleep-orphan entry follows as a doc commit. |
|
||||
| 252 | Console inbox Approve and Deny for grant requests (#435, J2) | scrooge; reviewers webby | — | in-progress | — | Webby approves DESIGN.md then manifest; webui, bus, cli suites and every test-*.sh green on Sage's gate; DESIGN mutants killed; REQ-WEB-2 PRD amendment landed first (sage) | `docs/plans/2026-10-21_console-inbox-approve.md` § Gate | mos-1193. Chained on row 196's candidate (Q177): design starts now on Gander's row 196 build; code rebases onto 196's landing. Vikunja #435. |
|
||||
| 252 | Console inbox Approve and Deny for grant requests (#435, J2) | scrooge; reviewers webby | #1753 | done | — | Webby approves DESIGN.md then manifest; webui, bus, cli suites and every test-*.sh green on Sage's gate; DESIGN mutants killed; REQ-WEB-2 PRD amendment landed first (sage) | `docs/plans/2026-10-21_console-inbox-approve.md` § Gate | Landed 45ea3fa0d (replay of Scrooge 580037105 onto 30e6bb680, range-diff all =, 10 commits). Webby APPROVE c31229 rev 3612. Sage gate on 45ea3fa0d: every package suite 0 fail 0 skipped (bus 907, cli 943, webui 410), every scripts/test-*.sh rc 0, J1-J19 all killed except J11c and J18 (equivalent per BUILD.md), all restores match. Old-test numstat 1 1 vs fe4ee8c7b held. |
|
||||
| 253 | F27: case2-unit.sh and case1-accept.sh move to --tester-socket and refuse --tester-port with stack-release's migration wording; no .53/.54 copy with 196 until this lands (mos-1198 item 4) | gander; reviewers duckworth | #1758 | done | 196 done | reviewer approves DESIGN.md then the manifest; cli and webui suites whole and every scripts/test-*.sh on Sage's slot; mutants per DESIGN.md; static check covers scripts and tests (sage) | `docs/plans/2026-10-21_tester-socket-scripts.md` § Brief: case2-unit.sh and case1-accept.sh move to --tester-socket (F27) | Landed 48e450ce8 on refactor (fast-forward from aca16404c, 22 commits; landed sha = candidate, so range-diff and patch-id are identical by construction). Manifest 591020a1 (7 paths) rechecked against the commit: 0 mismatches. Gate: run 5 whole, cli 55 files, webui 58 files, all 10 scripts/test-*.sh green; M1-M40 killed 40/40. Duckworth APPROVE round 1, Gitea #1758 comment 30696. |
|
||||
| 254 | Library sync follow-up: client timeout, STATUS codes, README (222 deferrals, #1759) | megavolt; reviewers dewey | #1759 | done | 196 done | Dewey approves the manifest; bus, library and webui suites whole and every scripts/test-*.sh green on Sage's slot; the timeout and STATUS mutants killed (sage) | `docs/plans/2026-10-21_library-sync-followup.md` § Gate | Landed 331597709 (candidate b31300d79 blobs and modes on 41b0cf755; patch-id 96216216 equal, range-diff differs only in the message) plus doc eb9672c91 (Dewey N1 README sentence closed; N2 four 502 codes to DEFERRED, binding the Console library routes row). Merged-tree rerun on Sage's slot 23:44-23:55Z: library 77/0, bus 628/0, webui 305/0 with 1 skip, cli 749/0. Megavolt's gate megavolt-0102 covers scripts and both mutants. |
|
||||
| 255 | Bundled Pocket ID for users with no OIDC provider, design (Q203, #1760) | launchpad; reviewers webby | — | queued | 252 done | Webby approves DESIGN.md; design only, build rows follow after Sage checks it against Q203, O6, REQ-WEB-2 and REQ-INST-1 (sage) | `docs/plans/2026-10-21_bundled-pocket-id.md` § Gate | Vikunja 458, Gitea #1760, mos-1202 item 2. REQ-INST-2 lands in PRD 1.10 as post-v1 (mos-1204). Design only: no install, no download, no .53/.54, dragon-lin keeps Authentik. |
|
||||
@@ -327,7 +327,7 @@ Generated from `docs/plans/queue.json` revision 3588 by `queue render`. Do not e
|
||||
| 288 | Case 2 C2-02 agent writes, the notice, revert and her Console saves | honker; reviewers webby | #1793 | briefed | 215 done, 282 done, 283 done, 284 done, 285 done, 286 done | Webby approves the manifest. Library, bus and harness suites and every scripts/test-*.sh green on Sage's gate, mutants killed. A search of the run output for the fixture tokens finds nothing. (sage) | `docs/plans/2026-10-20_case2-rows.md` § C2-02 agent writes, the notice, revert and her Console saves | — |
|
||||
| 289 | Case 2 C2-11b Console library pages and her saves (Haiku subagent, decision 129) | researcher; reviewers filbert | #1794 | briefed | 214 done, 288 done | Filbert approves the manifest. The webui suite and every scripts/test-*.sh are green on Sage's gate. Grep for hash pins on bus.js and serve.mjs before in-review. (sage) | `docs/plans/2026-10-20_case2-rows.md` § C2-11b Console library pages and her saves | — |
|
||||
| 290 | Case 2 C2-12b the setup sheet rewrite for free chat, supporting folders and saves | louie; reviewers webby | #1795 | briefed | 217 done, 218 done, 285 done, 291 done | Doc only. Webby approves it against the ruling. Before landing, grep packages/*/tests and scripts/test-*.sh to confirm no test reads the file. (sage) | `docs/plans/2026-10-20_case2-rows.md` § C2-12b the setup sheet rewrite for free chat, supporting folders and saves | — |
|
||||
| 291 | PRD 1.16 library.write routes under REQ-LIB-6 (mos-1328) | gosalyn; reviewers webby | #1796 | in-review, round 1, request posted | 282 done | Webby approves the text. Jason says yes to the exact text (Mos asks him, mos-1328 step 3); no landing before that. requirements.test.mjs and every scripts/test-*.sh that reads the PRD or requirements.json are green on Sage's gate. Mos gets the landing commit. (sage) | `docs/plans/2026-10-22_prd-1-16-brief.md` § PRD 1.16 library.write routes under REQ-LIB-6 (mos-1328) | — |
|
||||
| 291 | PRD 1.16 library.write routes under REQ-LIB-6 (mos-1328) | gosalyn; reviewers webby | #1796 | done | 282 done | Webby approves the text. Jason says yes to the exact text (Mos asks him, mos-1328 step 3); no landing before that. requirements.test.mjs and every scripts/test-*.sh that reads the PRD or requirements.json are green on Sage's gate. Mos gets the landing commit. (sage) | `docs/plans/2026-10-22_prd-1-16-brief.md` § PRD 1.16 library.write routes under REQ-LIB-6 (mos-1328) | Landed 4874d1e83 on e909ef51a: 482e865ac replayed, patch-id equal (cef7de74), range-diff =. Webby APPROVE c30848 on 482e865ac; Jason approved the text in Q229. Gate 16:15Z on the tip tree: every package suite but queue, 0 fail 0 skipped (tasks 100, bus 891, cli 941, plugins 119, webui 392, business 231), every scripts/test-*.sh rc 0 (queue-root and row 244 skips only). PRD 1.16. 1.17 is row 308. |
|
||||
| 292 | stack-release.sh config_checks runs the target loader on any config (row 270 rollback hazard) | gizmoduck; reviewers duckworth | #1797 | done | 203 done, 270 done, 271 done | Duckworth approves the manifest. The touched test files run whole, the cli suite and every scripts/test-*.sh are green on Sage's gate, and the mutants are killed. (sage) | `docs/plans/2026-10-22_config-checks-any-key-brief.md` § stack-release.sh config_checks runs the target loader on any config (row 270 rollback hazard) | Landed 6aab979e6 (cherry-pick of c902a767d..90be6cccd, range-diff all =, patch-id a45c9ba4 equal). Tested head 0d0021454: stack-release.test 224/224, cli suite r2 red only compactions-launch:229 session-invalid 22 (idle-stop race, Vikunja 588, row 302), r3 rerun 910/910 under mos-1411, ten shells green, M1-M9 killed. Duckworth APPROVE rev 3433 on 2fa7ae17. |
|
||||
| 293 | 574: maintenance-free test fixture commits (Vikunja 574) | gander; reviewers filbert | #1805 | done | — | Filbert approves. The four whole files, then the seat and cli suites, are green on Sage's gate. (sage) | `docs/plans/2026-10-23_mvp-readiness-rows.md` § Brief: 574, maintenance-free test fixture commits (Vikunja 574) | LANDED e51d11640 03:55Z 10-23 (cherry-pick of gander b23783f39..a9cae2bd6 onto 464010fbe; range-diff 6/6 equal, range patch-id equal). Filbert APPROVE c30982 cdda41f5; run 2 4 files 153/0, seat 202/0, cli 905/0, 312 flagged/0 maintenance children. N1: lifecycle.test needs TMPDIR of 50 bytes or less. Residual: queue store.mjs, discord git.mjs, harness tools.mjs unflagged. #1805 closed c31013, P19 574 c888. |
|
||||
| 294 | FED R6: Console granted-user sign-in, user-cli transport, peer links | launchpad; reviewers duckworth | #1800 | done | — | Duckworth approves the manifest. The webui, cli and bus suites and every scripts/test-*.sh are green on Sage's gate, and the mutants are killed. (sage) | `docs/plans/2026-10-23_mvp-readiness-rows.md` § Brief: FED R6, Console granted-user sign-in | landed d3059c2c3 on refactor 07:04Z: cherry-pick of c902a767d..24b745447 onto 09d0d6faf, range-diff 11 =, patch-id 8371405a equal. Duckworth approve c31053 rev 3469 on a1ff5d67, C1/C2 met. Run 4 on 8616b9a4f from npm ci: webui 365, cli 909, bus 873, 10 scripts, M1-M11 killed. Merged tree: stack-release-external 25, stack-upgrade 21, stack-release 223/224 (R9 transient, row 1810) then 224/224 rerun under mos-1422. Follow-ups rows 300, 301. Closes #1800. |
|
||||
@@ -342,8 +342,19 @@ Generated from `docs/plans/queue.json` revision 3588 by `queue render`. Do not e
|
||||
| 303 | R9 shows its output when rehearse makes no directory (Vikunja 589) | launchpad; reviewers duckworth | #1810 | done | 294 done | Duckworth approves the diff; stack-release.test.mjs whole and green on Sage's gate, in a gap (sage) | `docs/plans/2026-10-23_r9-guard-row.md` § Brief: R9 shows its output when rehearse makes no directory (Vikunja 589) | Landed e551cd846 from launchpad 88ffecaf7, patch-id 559c802b equal, test blob e936808b matches the manifest. Gate: Duckworth approve c31079; Sage gate on c13c337e1 plus the test blob, stack-release.test.mjs whole 224/0 rc 0 in 595 s, alnum mktemp TMPDIR, default networks 6 before and 6 after. No overlap with in-review 272, 304, 305. |
|
||||
| 304 | claude-session test builds the memory slug the way the CLI does (Vikunja 590) | rocko; reviewers dewey | #1811 | done | — | Dewey approves the diff; claude-session.test.mjs whole and green 3x (mktemp, underscore, space TMPDIRs) on Sage's gate, in a gap; old-regex mutant red at :298 (sage) | `docs/plans/2026-10-23_gate-env-rows.md` § Brief: claude-session test builds the memory slug the way the CLI does (Vikunja 590) | Landed a863015a5 from rocko 5e8354ebb, range-diff equal, patch-id 808fa765. Gate: Dewey approve c31129 rev 3533; Sage gate on e551cd846 with file 7690a4a9, claude 2.1.309: claude-session.test.mjs whole 10/0 under mktemp, underscore and space TMPDIRs; old-regex mutant under underscore 9/1 at :298. Gates may drop the alnum TMPDIR rule (mos-1432 ends here). |
|
||||
| 305 | Shell suites remove the compose network they create (Vikunja 591) | gizmoduck; reviewers filbert | #1812 | done | — | Filbert approves the diff; test-release.sh and test-task.sh whole and green on Sage's gate, in a gap, project network absent after each run; dropped-rm mutant red (sage) | `docs/plans/2026-10-23_gate-env-rows.md` § Brief: shell suites remove the compose network they create (Vikunja 591) | Landed 353d65f57..d52d9f1f2 from gizmoduck 541dee2b7..7e8218a2e, range-diff all equal, on top of filbert 2c289f6f0. Gate: Filbert approve c31127 rev 3534; Sage gate on e551cd846 with task 7d6fbf67, release b29850ce: test-task 92/0, test-release 15/0, network check OK; mutants a and b red in both, c a known survivor; own mutant networks removed, none left. Gates stop the manual network rm (mos-1438 ends here). |
|
||||
| 306 | A revoked run's late bus call stops it instead of exiting 22 (295 N1) | morgana; reviewers dewey | #1813 | briefed | 272 done | Dewey approves the design, then the manifest; bus, harness and cli suites and every scripts/test-*.sh green on Sage's gate (sage) | `docs/plans/2026-10-23_gate-env-rows.md` § Brief: a revoked run's late bus call stops it instead of exiting 22 (295 N1) | — |
|
||||
| 306 | A revoked run's late bus call stops it instead of exiting 22 (295 N1) | morgana; reviewers dewey | #1813 | done | 272 done | Dewey approves the design, then the manifest; bus, harness and cli suites and every scripts/test-*.sh green on Sage's gate (sage) | `docs/plans/2026-10-23_gate-env-rows.md` § Brief: a revoked run's late bus call stops it instead of exiting 22 (295 N1) | Landed 2d0318a44 on 4874d1e83: 33d3844a0..683833205 replayed, 4 patch-ids equal (a1960f36 55fadbc3 af1a3d88 35cf81a3), range-diff all =. Dewey APPROVE c31206 rev 3596 on 683833205. access-revoke.test numstat 7 7 (mos-1463). Sage gate 16:33Z: every package suite 0 fail 0 skipped (bus 894, cli 942, plugins 119, webui 392, business 231, harness 151), every scripts/test-*.sh rc 0, M1-M3 each killed on every named file, restores equal. N1/N2 to DEFERRED next. |
|
||||
| 307 | Row 270's pi compaction reading moves behind the harness kind (REQ-PLUG-2, Vikunja 598) | gizmoduck; reviewers duckworth | #1814 | done | — | Duckworth approves the design, then the manifest; bus, cli, plugins (0 failures), webui and business suites, every scripts/test-*.sh green and the mutants killed on Sage's gate (sage) | `docs/plans/2026-10-23_harness-kind-compactions.md` § Brief: row 270's pi compaction reading moves behind the harness kind (Vikunja 598) | LANDED d243f6b25: 6 row commits replayed onto 8dc132bec, every non-log patch-id equal, candidate paths = 6fdfe3790 (manifest 17c9f8d9). Duckworth APPROVE rev 3586 c31189 round 1, C2 met. Sage gate: bus, cli 0 skipped, plugins fully green incl harness.test.mjs:192, webui, business, seat, every scripts/test-*.sh; M1-M4 killed. P19 598 commented. DEFERRED: 307 N1 store-unreadable not sticky. N3 doc-only BUILD.md red list one short, next BUILD.md change. |
|
||||
| 308 | PRD 1.17 Case 2 story files are DOCX (Q235 to Q237, Q239) | gosalyn; reviewers webby | #1815 | done | 291 done | Webby checks the PRD diff against DRAFT-d9.md at 4607e15b8 one instruction at a time and that nothing else changed. No new Jason question (Q239 approved the text). tasks whole, bus whole, cli stack-copy.test and every scripts/test-*.sh green on Sage's gate. Mos gets the landing commit (mos-1470). (sage) | `docs/plans/2026-10-23_prd-1-17-brief.md` § PRD 1.17 Case 2 story files are DOCX (Q235 to Q237, Q239) | Landed 30e6bb680: Gosalyn 45fe7b3ce replayed onto 7defb58e9, patch-id 4658c831 equal, range-diff =, four blobs equal. Webby r1 APPROVE c31224 rev 3606, d9 at 4607e15b8 applied word for word. Sage gate 17:19Z: every package suite 0 fail 0 skipped (tasks 100, bus 894, cli 942, plugins 119, webui 392), every scripts/test-*.sh rc 0. Mos gets the sha (mos-1470). 570/571 build rows next. |
|
||||
| 309 | 571 W1: reviewed local thesaurus data (post-10-27) | unassigned | — | queued | — | Independent Opus 5.5 reviewer, not the author, approves the manifest; the brief section's Gate and G1 pass on Sage's slot: touched test files whole, affected package suites green, named mutants killed. Post-10-27; MVP rows keep slot priority (sage) | `docs/plans/2026-10-21_q195-writing-editor.md` § W1 reviewed local thesaurus data | — |
|
||||
| 310 | 571 W2: WordCraft source import and reproducible restricted web build (post-10-27) | unassigned | — | queued | — | Independent Opus 5.5 reviewer, not the author, approves the manifest; the brief section's Gate and G1 pass on Sage's slot: touched test files whole, affected package suites green, named mutants killed. Post-10-27; MVP rows keep slot priority (sage) | `docs/plans/2026-10-21_q195-writing-editor.md` § W2 WordCraft source import and reproducible restricted web build | — |
|
||||
| 311 | 571 W3a: bus pins and human-only editor settings (post-10-27) | unassigned | — | queued | — | Independent Opus 5.5 reviewer, not the author, approves the manifest; the brief section's Gate and G1 pass on Sage's slot: touched test files whole, affected package suites green, named mutants killed. Post-10-27; MVP rows keep slot priority (sage) | `docs/plans/2026-10-21_q195-writing-editor.md` § W3a bus pins and human-only editor settings | — |
|
||||
| 312 | 571 W3b: human DOCX store and instant commits (post-10-27) | unassigned | — | queued | 311 done | Independent Opus 5.5 reviewer, not the author, approves the manifest; the brief section's Gate and G1 pass on Sage's slot: touched test files whole, affected package suites green, named mutants killed. Post-10-27; MVP rows keep slot priority (sage) | `docs/plans/2026-10-21_q195-writing-editor.md` § W3b human DOCX store and instant commits | — |
|
||||
| 313 | 571 W6: owned browser bridge and editor-only route (post-10-27) | unassigned | — | queued | 309 done, 310 done, 312 done | Independent Opus 5.5 reviewer, not the author, approves the manifest; the brief section's Gate and G1 pass on Sage's slot: touched test files whole, affected package suites green, named mutants killed. Post-10-27; MVP rows keep slot priority (sage) | `docs/plans/2026-10-21_q195-writing-editor.md` § W6 owned browser bridge and editor-only route | — |
|
||||
| 314 | 571 W3: full editor pane, navigation, pins and right-click synonyms (post-10-27) | unassigned | — | queued | 311 done, 312 done, 313 done | Independent Opus 5.5 reviewer, not the author, approves the manifest; the brief section's Gate and G1 pass on Sage's slot: touched test files whole, affected package suites green, named mutants killed. Post-10-27; MVP rows keep slot priority (sage) | `docs/plans/2026-10-21_q195-writing-editor.md` § W3 full editor pane, navigation, pins and right-click synonyms | — |
|
||||
| 315 | 571 W4b: committed reader, citation resolver and typed tools (post-10-27) | unassigned | — | queued | 314 done | Independent Opus 5.5 reviewer, not the author, approves the manifest; the brief section's Gate and G1 pass on Sage's slot: touched test files whole, affected package suites green, named mutants killed. Post-10-27; MVP rows keep slot priority (sage) | `docs/plans/2026-10-21_q195-writing-editor.md` § W4b committed reader, citation resolver and typed tools | — |
|
||||
| 316 | 571 W5: read-only flags, citations and chat suggestions (post-10-27) | unassigned | — | queued | 315 done | Independent Opus 5.5 reviewer, not the author, approves the manifest; the brief section's Gate and G1 pass on Sage's slot: touched test files whole, affected package suites green, named mutants killed. Post-10-27; MVP rows keep slot priority (sage) | `docs/plans/2026-10-21_q195-writing-editor.md` § W5 read-only flags, citations and chat suggestions | — |
|
||||
| 317 | 571 W7: human one-way chapter import and Case 2 format routing, production import closed; the first real import opens only after W8 lands (post-10-27, mos-1470) | unassigned | — | queued | 314 done, 315 done | Independent Opus 5.5 reviewer, not the author, approves the manifest; the brief section's Gate and G1 pass on Sage's slot: touched test files whole, affected package suites green, named mutants killed. Post-10-27; MVP rows keep slot priority (sage) | `docs/plans/2026-10-21_q195-writing-editor.md` § W7 human one-way chapter import and Case 2 format routing | — |
|
||||
| 318 | 571 W8: Console Connections view for Markdown and DOCX story files, before W7's first real import (post-10-27, mos-1470) | unassigned | — | queued | 314 done, 315 done, 317 done | Independent Opus 5.5 reviewer, not the author, approves the manifest; the brief section's Gate and G1 pass on Sage's slot: touched test files whole, affected package suites green, named mutants killed. Post-10-27; MVP rows keep slot priority (sage) | `docs/plans/2026-10-21_q195-writing-editor.md` § W8 Console Connections view for Markdown and DOCX story files | fenton-0017 carry: connections.test.mjs must test that links inside comments and tracked deletions are excluded. W8 follows W7's closed routing candidate and lands before W7's first real import opens (mos-1470) |
|
||||
|
||||
<!-- mosaic-queue:end -->
|
||||
|
||||
|
||||
+1828
-23
File diff suppressed because it is too large.
Load diff
+399
-44
@@ -1,6 +1,6 @@
|
||||
# PRD: Mosaic Stack
|
||||
|
||||
- Status: approved, version 1.15. Jason approved draft 0.4 unchanged as
|
||||
- Status: approved, version 1.17. Jason approved draft 0.4 unchanged as
|
||||
1.0 on 2026-10-05 (lead decision 61). They approved version 1.1, the
|
||||
Organization requirements, in decision 03130d08-ddce-480d-a601-e59f64744fc3
|
||||
on 2026-10-14. They approved version 1.2, the chief of staff, the
|
||||
@@ -44,7 +44,44 @@
|
||||
as 1.11 (mos-1233, mos-1238, mos-1241, vikunja:19/464). Version 1.15
|
||||
rewrites REQ-LIB-6 to Jason's Q223 and Q226 rulings and adds supporting
|
||||
folders to REQ-LIB-1 and REQ-LIB-2. Mos ordered it in mos-1320 item 8,
|
||||
and Jason gets a report.
|
||||
and Jason gets a report. Version 1.16 routes the new action
|
||||
`library.write` under REQ-LIB-6 (REQ-WAIT-3). A change to the hard waits
|
||||
needs Jason's approval under REQ-WAIT-2, so Mos puts the text to him as
|
||||
written, and it lands only after his yes (mos-1328, mos-1329). Version
|
||||
1.17 records Jason's rulings Q235 to Q237 of 2026-10-23: Case 2 story
|
||||
files are DOCX, Markdown stays for agent files and documentation, and a
|
||||
human-started import converts a Markdown story file one way. It also
|
||||
adds REQ-LIB-9, the Console's DOCX editor, from Jason's rulings Q195,
|
||||
Q226 and Q234. It changes what Case 2 requirements allow, so Mos puts
|
||||
the text to Jason as written, and it lands only after his yes (mos-1366,
|
||||
Vikunja 570).
|
||||
- Version 1.17 source: Jason's Q235, answering Q36: 'How about we see a
|
||||
markdown file, we convert the markdown file to docx, then archive or
|
||||
mark the markdown file as converted. The new standard for files in the
|
||||
creating writing use case is to use docx to handle versioning and
|
||||
WYSIWYG. We eliminate the potential for confusion based on the files.
|
||||
Agents must understand which files are what format and where they live.
|
||||
The system must allow for import and conversion. We will not run the
|
||||
systems in parallel. There will be an irreversible conversion of the
|
||||
files.' His Q236 says: 'For creative writing chapters, we need to
|
||||
utilize docx as the standard. Markdown is acceptable for agent files,
|
||||
instructions, PRDs, documentation, etc. The creative writing files
|
||||
should be docx for familiarity for the user.' His Q237 says 'Q38: It is
|
||||
correct for now (subject to future change)', which confirms Mos's
|
||||
reading P1 to P6. REQ-LIB-9 rests on his Q195 request for 'a full
|
||||
WYSIWYG editor within Mosaic Stack', his Q226 answer 'F41: We want to
|
||||
move editing into the WYSIWYG in the WebUI. All changes are instantly
|
||||
committed and available to the agents.' and his Q234 answer 'Q37: yes'
|
||||
to the exact security header for the editor's frame. The storage follows
|
||||
the O2 design D10 to D12 as rewritten under Vikunja 571, at b99ca86b9 on
|
||||
`refactor`.
|
||||
- Version 1.16 source: Webby's review webby-0164 B2, from Scrooge's row
|
||||
285. Version 1.15 lets creative agents write in supporting folders, but
|
||||
the write action stayed a hard wait under REQ-WAIT-3, and REQ-WAIT-2
|
||||
refuses every role file that grants one. Mos ruled in mos-1328 and
|
||||
mos-1329 that the routing is its own version. The bounds come from
|
||||
REQ-LIB-6 and the Case 2 design's ruling after r11, f6e3e7f20 on
|
||||
`gosalyn/case2-design`.
|
||||
- Version 1.15 source: Jason's Q223, answering Q29: "The agents are not
|
||||
allowed to write the prose into the writing projects. Agents are
|
||||
allowed to CRUD character sheets, info summaries, cross-link info, and
|
||||
@@ -706,6 +743,14 @@ Added in version 1.5 (Q167).
|
||||
`host.sudo` was added as a hard wait and routes under REQ-CRED-4 since
|
||||
version 1.8.
|
||||
|
||||
`library.write` was added as a hard wait and routes under REQ-LIB-6
|
||||
since version 1.16. It is granted within-role to the six creative roles
|
||||
only, and only for Markdown files under the supporting folders a human
|
||||
marks. It never writes a story file. A write also needs the writing
|
||||
agent's own live Gitea grant on the library project. Each write is one
|
||||
commit by that agent's own Gitea account with a trailer naming the
|
||||
agent, and the user sees a notice for it and can revert it.
|
||||
|
||||
### Messages
|
||||
|
||||
- **REQ-MSG-1.** Messages are addressed to a role. They are append-only
|
||||
@@ -1178,7 +1223,8 @@ design `docs/plans/2026-10-21_t1-sessions.md`, 2c843d190 on `huey/t1-sessions-de
|
||||
Added in version 1.12 (Q176 Case 2, Q211). Drafted from the Case 2
|
||||
design r11, fb20a61b4 on `gosalyn/case2-design`, approved by Webby in
|
||||
82f50d127, with the rulings recorded after r11 up to 624212842. The
|
||||
library is the user's own writing repository.
|
||||
library is the user's own writing repository plus the stack's writing
|
||||
store, which holds the DOCX story files (REQ-LIB-8, version 1.17).
|
||||
|
||||
- **REQ-LIB-1.** A library project maps the user's writing repository
|
||||
onto universes, books, entity types such as character and place, the
|
||||
@@ -1187,9 +1233,12 @@ library is the user's own writing repository.
|
||||
human changes it, and an agent's organization write that changes it
|
||||
is refused. So
|
||||
`universe.book.{character,place,...}` reads as universe, book folder,
|
||||
type folder. (Design 1.1 and M9. Q176 Case 2 "Data is stored in
|
||||
little-endian organizational scheme". Version 1.15: supporting
|
||||
folders.)
|
||||
type folder. The mapping also names one archive folder, set by the
|
||||
human, where converted Markdown story files go. A book's DOCX story
|
||||
files are in the stack's writing store, under the same universe and book
|
||||
(REQ-LIB-8). (Design 1.1 and M9. Q176 Case 2 "Data is stored in
|
||||
little-endian organizational scheme". Version 1.15: supporting folders.
|
||||
Version 1.17: the archive folder and the writing store.)
|
||||
- **REQ-LIB-2.** Playgrounds are never confused with canon. A playground
|
||||
has one of three levels, set by where its prefix sits. A book-level
|
||||
prefix lies inside one of its universe's book folders, and its files
|
||||
@@ -1204,18 +1253,34 @@ library is the user's own writing repository.
|
||||
its own universe, when two prefixes overlap, when a draft has books or
|
||||
no prefix, and when a hybrid names a draft as a source. Supporting
|
||||
prefixes, the folders agents may write in (REQ-LIB-6), follow the same
|
||||
placement rules. A file's scope comes from its path alone, prefixes
|
||||
first: a Markdown file under a supporting prefix is supporting, one
|
||||
under a playground prefix at any level is playground, any other
|
||||
Markdown file in a book folder is canon, and everything else is
|
||||
unmapped and never returned. A folder in both lists is supporting.
|
||||
Lookups return canon unless the caller asks for playground or
|
||||
supporting. A citation marked as canon must name a canon file, so an
|
||||
agent can't cite a playground or supporting file as canon. The Console
|
||||
shows each cite's scope. (Design 1.2, 5.2 and 7.4, the playground
|
||||
ruling, 51fdfb7e2, and the ruling after r11. Q176 Case 2, the
|
||||
playground items, TARGET.md:92-94. Version 1.14: the levels and the
|
||||
draft. Version 1.15: supporting.)
|
||||
placement rules. A Markdown file's scope comes from its path and from
|
||||
past imports, prefixes first: a Markdown file under the archive folder
|
||||
is archived, one under a supporting prefix is supporting, a Markdown
|
||||
file at a converted file's old path is unmapped under REQ-LIB-8 but
|
||||
flagged in the format map, one under a playground prefix at any level is
|
||||
playground, any other Markdown file in a book folder is canon, and
|
||||
everything else is unmapped and never returned. A folder in both lists
|
||||
is supporting. The archive folder follows the same placement rules and
|
||||
may not overlap another prefix or a book folder. An archived file keeps
|
||||
the path it had under the archive folder, and its universe and book are
|
||||
those of that old path. A DOCX document in the writing store keeps its
|
||||
source's scope: the universe, the book if there is one, and canon or
|
||||
playground. Its source is the Markdown file it was converted from or,
|
||||
for one the human starts in the editor, the universe and book or the
|
||||
playground the human picks (REQ-LIB-8). A playground DOCX follows the
|
||||
playground rules and is never returned as canon. It stays playground
|
||||
after its draft universe is made real. In version 1.17 no promotion or
|
||||
mapping change makes a playground DOCX canon. A later version of this
|
||||
PRD says how one becomes canon. Lookups return canon unless the caller
|
||||
asks for playground, supporting or archived. Every answer marks an
|
||||
archived file as archived and names the DOCX that replaced it. A
|
||||
citation marked as canon must name a canon file, so an agent can't cite
|
||||
a playground, supporting or archived file as canon. The Console shows
|
||||
each cite's scope and format, and whether a cited Markdown file was
|
||||
converted. (Design 1.2, 5.2 and 7.4, the playground ruling, 51fdfb7e2,
|
||||
and the ruling after r11. Q176 Case 2, the playground items,
|
||||
TARGET.md:92-94. Version 1.14: the levels and the draft. Version 1.15:
|
||||
supporting. Version 1.17: archived scope and DOCX scope.)
|
||||
- **REQ-LIB-3.** Universes stay separate. Every lookup names one universe,
|
||||
and its results never leave it. A draft universe (REQ-LIB-2) counts as
|
||||
a universe here. It has no canon, so a lookup in a draft asks for
|
||||
@@ -1231,23 +1296,62 @@ library is the user's own writing repository.
|
||||
A pin doesn't stop the change. The continuity agent reads the human's other
|
||||
constraints and cites them. (Design 1.4 and 3. Q176 Case 2, the
|
||||
crossover items.)
|
||||
- **REQ-LIB-4.** Git holds every change. The user commits and pushes with
|
||||
their own tools, today Obsidian with obsidian-git. The bus keeps a
|
||||
- **REQ-LIB-4.** Git holds every change. The user commits and pushes
|
||||
Markdown with their own tools, today Obsidian with obsidian-git. A
|
||||
converted story file's current text is no longer in that repository,
|
||||
which keeps only its archived Markdown (REQ-LIB-8). The bus keeps a
|
||||
mirror of the remote, fetched with a read-only token every 60 seconds
|
||||
and before any lookup when the last fetch is older than that. It only
|
||||
fast-forwards. A force-push is held as `library-diverged` until a human
|
||||
accepts it. Agents read only the mirror's served commit and never hold
|
||||
a copy of their own, so they see the user's push within about a minute.
|
||||
Bus writes and pushes come in later rows (C2-02, C2-03b). (Design D5,
|
||||
D6, 7.1, 7.2 and 7.5. Q176 Case 2 "Git is used for all changes -- local
|
||||
and remote" and the sync items.)
|
||||
accepts it. Agents read the user's repository only at the mirror's
|
||||
served commit, except a story file during its import under REQ-LIB-8.
|
||||
They read a DOCX story file only at a committed version in the writing
|
||||
store, under REQ-LIB-5. They never hold a copy of their own, so they see
|
||||
the user's Markdown push within about a minute and a DOCX save at their
|
||||
next lookup after the editor reports it as committed. Bus writes and
|
||||
pushes come in later rows (C2-02, C2-03b). A DOCX story file is saved in
|
||||
the Console's editor, and each accepted save is one commit by the human
|
||||
in the stack's writing store (REQ-LIB-9). Each writing-store commit is
|
||||
also pushed to a remote off the stack's host, never by force-push. The
|
||||
remote is a setting only a human changes, and it starts unset. A
|
||||
repository on the stack's host never counts as that remote. A missing
|
||||
remote or a failed push never undoes a save, and the user sees each push
|
||||
that is pending or failed. Only the stack's host pushes to that remote,
|
||||
and no agent can reach it with any credential. Agents read the local
|
||||
commit. (Design D5, D6, 7.1, 7.2 and 7.5. Q176 Case 2 "Git is used for
|
||||
all changes -- local and remote" and the sync items. Version 1.17, with
|
||||
Q222 for the remote setting.)
|
||||
- **REQ-LIB-5.** Agents check the library through typed lookup tools:
|
||||
find, get, search, manuscript and universe. Each answer names the
|
||||
commit it read. Get returns a file's links out and links in, so the
|
||||
connections are visible to agents. The user sees them in Obsidian's
|
||||
graph and backlinks. (Design 3 and 7.1. Q176 Case 2 "The agents have
|
||||
tools to check character, place, and other data", the visualization
|
||||
item and "Connections are always visible".)
|
||||
find, get, search, manuscript and universe. Each answer names the commit
|
||||
it read. Each answer also names the file's format and where it lives:
|
||||
its path, or its document id in the writing store. A DOCX story file is
|
||||
read from its latest committed save, never from unsaved text. A lookup
|
||||
that starts after the editor reports a save as committed returns that
|
||||
save or a later one, even while its push to the remote is pending or has
|
||||
failed, and the answer names the version. Get, search and manuscript
|
||||
read a DOCX story file as its extracted text with DOCX locators, never
|
||||
as lines. That text is the file with its tracked changes accepted. An
|
||||
agent reads a story file's comments, or its text with tracked deletions
|
||||
shown, only after a human turns on the matching setting. Both settings
|
||||
are off by default, and only a human changes them. The reader in this
|
||||
version can't read some things a DOCX story file can hold, such as a web
|
||||
link, a text box, a field or hidden text. The editor warns the human
|
||||
when an edit adds one, and the human can still save it. Until a later
|
||||
save takes it out, lookups give agents none of the text of the part that
|
||||
holds it, whether that is the chapter's body, a note or a comment. The
|
||||
manuscript lookup follows the book's chapter order across both formats
|
||||
(O2 design D10), and the next chapter it names is never an archived
|
||||
file. Links out and in resolve across both formats. The universe lookup
|
||||
returns the format map (REQ-LIB-8). Get returns a file's links out and
|
||||
links in, so the connections are visible to agents. The user sees a
|
||||
Markdown file's links in Obsidian's graph and backlinks. A DOCX story
|
||||
file's wikilinks stay clickable in the Console's editor (O2 design D11),
|
||||
and no graph shows them yet. The Console's Connections view lists the
|
||||
current links and backlinks of each story file the user may see, in both
|
||||
formats, with each one's scope and format. (Design 3 and 7.1. Q176 Case
|
||||
2 "The agents have tools to check character, place, and other data", the
|
||||
visualization item and "Connections are always visible". Version 1.17,
|
||||
with Q222 for the two settings and Q239 for the Connections view.)
|
||||
- **REQ-LIB-6.** The creative roles are ideas, research, proofreader,
|
||||
fact-checker and continuity, plus a companion role that the user's own
|
||||
named agents run as. Agents never write the story. A creative agent may
|
||||
@@ -1255,22 +1359,37 @@ library is the user's own writing repository.
|
||||
folders a human marks (REQ-LIB-1), such as character sheets, summaries,
|
||||
cross-link notes and research notes. Every other path in the user's
|
||||
repository is read-only to it, chapters and unmarked folders included,
|
||||
and the broker refuses such a write before any git call. Each agent
|
||||
write is one commit by that agent's own Gitea account, with a trailer
|
||||
naming the agent. The user sees a notice for it and can revert it. Its
|
||||
tools are the lookups, a message to the human and the two write tools,
|
||||
and research and companion also fetch web pages through the broker.
|
||||
Agents talk with the user in free text. A reply may cite lines of the
|
||||
repository at a commit or pages the agent fetched, and the broker
|
||||
checks every citation before it stores the message. A setting,
|
||||
`requireCitation`, makes every reply carry a citation, except the
|
||||
runner's fixed notices for no answer, a failed turn, no answer passing
|
||||
the citation check and an answer too long to send. Only the human
|
||||
changes it, and it is off by default. The user sees only stored
|
||||
and the broker refuses such a write before any git call. The writing
|
||||
store and the archive folder are read-only to a creative agent as well,
|
||||
and the broker's path check treats the archive folder as story. No agent
|
||||
creates, edits, deletes, converts, archives or restores a story file in
|
||||
any format, and no agent writes a DOCX. No creative agent starts or
|
||||
undoes a conversion, and none asks for one through a tool or a decision
|
||||
it raises, as REQ-LIB-8 says. An agent may still suggest a conversion to
|
||||
the human in chat. Each creative role's contract states which files are
|
||||
DOCX and which are Markdown, and cites a DOCX story file by its locator,
|
||||
never by line. Each agent write is one commit by that agent's own Gitea
|
||||
account, with a trailer naming the agent. The user sees a notice for it
|
||||
and can revert it. Its tools are the lookups, a message to the human and
|
||||
the two write tools, and research and companion also fetch web pages
|
||||
through the broker. The write tools need the action `library.write`,
|
||||
which routes under this requirement within the bounds REQ-WAIT-3 names
|
||||
(version 1.16). Agents talk with the user in free text. A reply may cite
|
||||
lines of a Markdown file at a commit, a place in a committed DOCX story
|
||||
file, or pages the agent fetched, and the broker checks every citation
|
||||
before it stores the message. A DOCX citation never calls a paragraph a
|
||||
line. It names the document id, the committed version and a DOCX
|
||||
locator. A citation that names an archived file as current is refused.
|
||||
The `requireCitation` setting below applies to Markdown and DOCX
|
||||
citations alike, and so does the rule for a citation marked as canon. A
|
||||
setting, `requireCitation`, makes every reply carry a citation, except
|
||||
the runner's fixed notices for no answer, a failed turn, no answer
|
||||
passing the citation check and an answer too long to send. Only the
|
||||
human changes it, and it is off by default. The user sees only stored
|
||||
messages, on every channel. (Design 4, 5.2 and the ruling after r11.
|
||||
Q223 and Q226. Q180 for Bean and Chet. Q176 Case 2, the agent list,
|
||||
"User sets strict guardrails for agent capabilities" and TARGET.md:101
|
||||
"Agents NEVER write prose for the user". Version 1.15.)
|
||||
"Agents NEVER write prose for the user". Version 1.15. Version 1.17.)
|
||||
- **REQ-LIB-7.** The user talks to several creative agents in one chat. A
|
||||
room holds one thread per creative agent in a project. A message goes
|
||||
to every agent in the room, or only to the agents named by @tags at its
|
||||
@@ -1278,6 +1397,110 @@ library is the user's own writing repository.
|
||||
the threads as one timeline, and each agent sees only its own thread.
|
||||
(Design D4 and 6, row C2-09b. Q176 Case 2 "converse with N agents in
|
||||
one chat session with @tagged messages".)
|
||||
- **REQ-LIB-8.** Story files become DOCX. DOCX is the standard for chapters and
|
||||
the other story text in a Case 2 writing project, canon and playground alike. A
|
||||
story file becomes DOCX through a human's import (below), or when the human
|
||||
starts it in the editor. From then on DOCX is its only working format, edited in
|
||||
the Console's editor (REQ-LIB-9). A Markdown story file stays Markdown until its
|
||||
import. Files in a type folder (REQ-LIB-1), such as character and place notes,
|
||||
stay Markdown. So do supporting files, agent files, instructions, PRDs and
|
||||
documentation, including the character sheets, summaries and cross-links agents
|
||||
keep under REQ-LIB-6.
|
||||
- A converted story file's current text leaves the user's Gitea-mirrored
|
||||
repository. Its DOCX lives in the stack's writing store, on the stack's host,
|
||||
and not in the repository the user pushes or opens in Obsidian. Only its
|
||||
archived Markdown stays there.
|
||||
- An import converts one Markdown story file, canon or playground, outside every
|
||||
type folder (REQ-LIB-1), to a DOCX document in the writing store. It refuses
|
||||
an unmapped, supporting, archived or type-folder file, and a file that is
|
||||
already converted. Each import has its own fidelity report, the human's
|
||||
confirmation of that report, a manifest naming the source file and its commit,
|
||||
and one commit in the store. The DOCX keeps every wiki link of the source as
|
||||
written, and a lost link to another library file fails the fidelity report. A
|
||||
web link becomes plain text that keeps its label and address, and the fidelity
|
||||
report lists it for the human to confirm. A web link that can't be kept safely
|
||||
as plain text refuses the import.
|
||||
- The human can also start a new story file in the editor, in a universe and
|
||||
book or a playground the human picks. It is a DOCX document in the writing
|
||||
store from its first commit, with no Markdown copy, and it opens under the
|
||||
same gate as the import.
|
||||
- The same import marks the Markdown file converted, naming the document, and
|
||||
moves it to the archive folder under its old path (REQ-LIB-1, REQ-LIB-2).
|
||||
The mark and the move are one commit authored by the human in the user's
|
||||
repository. A new human-only bus step (Vikunja 571) on the C2-02 write
|
||||
plumbing writes it, and C2-03b pushes it. The move keeps the bytes and the
|
||||
git history, so it isn't `data.delete`.
|
||||
- The store commit comes first, and the writing store's remote must confirm it
|
||||
holds that commit. Then come the archive commit and its push, then publication
|
||||
to the lookups. Until publication the Markdown at its old path keeps its canon
|
||||
or playground scope. Agents read that file at the commit the import started
|
||||
from, even after the mirror's served commit reaches the archive commit or a
|
||||
later one. No lookup returns the file's archived copy before publication, even
|
||||
one that asks for archived files. A refusal or failure before the archive push
|
||||
leaves the Markdown unmoved and no DOCX that a lookup returns. A failure after
|
||||
the archive push leaves a pending import that the human sees and can resume,
|
||||
never a claim that nothing moved. An archive push whose result is unknown
|
||||
counts as a failure after the archive push until the stack reads the result
|
||||
back from the user's remote.
|
||||
- Each stage of an import writes a logged event. The import's record on the
|
||||
stack's host names the source file's path, commit and blob and the new
|
||||
document id, and each event points to that record.
|
||||
- After a conversion, a Markdown file at the converted file's old path is
|
||||
neither canon nor playground. Lookups leave it out, the format map flags it,
|
||||
and the human is told.
|
||||
- A new Markdown story file in a book folder that holds converted files stays
|
||||
canon until its import, unless it sits at a converted file's old path or under
|
||||
a playground prefix. The Console flags it and offers the import. Nothing
|
||||
converts it on its own.
|
||||
- A hybrid's exclusion that covers a converted file's old path also covers its
|
||||
DOCX document (REQ-LIB-3). An exclusion of a whole book folder also covers
|
||||
every DOCX document in that book, including one started in the editor. An
|
||||
exclusion can also name a DOCX document by its id.
|
||||
- Only a human starts an import or a new story file, from the CLI or a Console
|
||||
session signed in as that human. Both are human verbs outside the agent action
|
||||
vocabulary. Neither is added to `ACTIONS` in the business vocabulary or to the
|
||||
broker's always-gated list, including the import's action, `library.convert`.
|
||||
No role holds them, no agent can request them, and the hard-wait list in
|
||||
REQ-WAIT-1 doesn't change. In an organization with several humans, who may
|
||||
start them is a setting only a human changes, and the default is the owner
|
||||
only.
|
||||
- Conversion is one way, with no parallel run. Neither the Console nor any agent
|
||||
edits a converted story file as Markdown, and no DOCX edit syncs back to
|
||||
Markdown. The Console's Markdown save refuses every file under the archive
|
||||
folder. The user's own tools can still change the archived Markdown, and no
|
||||
such change reaches the DOCX. The old Markdown stays in git history, and
|
||||
nothing rewrites history. A promotion into a book folder (C2-19) runs the
|
||||
import for a Markdown story file or is refused. A promotion of a playground
|
||||
DOCX is refused in version 1.17.
|
||||
- Agents get a format map: for each mapped folder and story file, its format,
|
||||
scope and where it lives, archived files, flagged files and pending imports
|
||||
included.
|
||||
- The import and new story files ship closed. They open only after four things.
|
||||
The editor ships. The human has set the writing store's remote, and the stack
|
||||
has checked that it can push there. Agents can read committed DOCX story files
|
||||
through the lookups and cite them (REQ-LIB-5, REQ-LIB-6). Any earlier agent
|
||||
system that writes the user's files has stopped, which for Case 2 is the
|
||||
Hermes retirement (#423 step 5). So the import itself never cuts agents off
|
||||
from a chapter, the chapter's current text never lives only on the stack's
|
||||
host, and no second system writes the story. The first import of a real user's
|
||||
books waits for Jason's go.
|
||||
(Q235, Q236, Q237: P1 to P6. Q222 for the setting. O2 design D10 to D12.
|
||||
Version 1.17.)
|
||||
- **REQ-LIB-9.** The Console's DOCX editor. The human edits a DOCX story file in
|
||||
the Console's editor, in a split pane with the agent chat alongside it. The
|
||||
human can pin an agent chat to a document. The human can select a word,
|
||||
right-click it, and choose a synonym from a thesaurus. Only a human saves. Saves
|
||||
happen on their own while the human types (Q226), at intervals only a human
|
||||
changes, and each accepted save is one commit with the human as author, pushed
|
||||
as REQ-LIB-4 says. A save made against an older version than the current one is
|
||||
refused. Agents never write a DOCX. Versioning is the editor's tracked changes
|
||||
plus one git commit per save. The editor's code is vendored and pinned, with a
|
||||
hash per file and the licenses that its independent security review accepted. At
|
||||
runtime the editor loads only files that the stack itself serves, and it
|
||||
requests nothing from any other host. The editor's frame sends exactly the
|
||||
content security policy Jason approved in Q234, and the WebUI shell's own header
|
||||
is unchanged. REQ-PROJ-3's project docs editor is unchanged. (Q195, Q226, Q234,
|
||||
Q236. O2 design D3, D4, D6, D8, D10, D13, D14, D16 and D22. Version 1.17.)
|
||||
|
||||
### Installer
|
||||
|
||||
@@ -1750,6 +1973,118 @@ latest-by date and a hard target (Q176).
|
||||
ruling after r11 and in the Q226 briefs of
|
||||
`docs/plans/2026-10-20_case2-rows.md`. Sage files the rows under
|
||||
Vikunja 416. This amendment adds the requirements only.
|
||||
- Version 1.16:
|
||||
- REQ-WAIT-3 gains one paragraph, the `library.write` routing and its
|
||||
bounds. REQ-LIB-6 gains one sentence naming the action. No other
|
||||
requirement text changes.
|
||||
- `packages/tasks/requirements.json` changes its version to 1.16 and
|
||||
nothing else. The titles stay and the id count stays 85.
|
||||
- The commit that adds `library.write` to `ROUTED` in the business
|
||||
vocabulary and the broker is C2-08b, row 285. It lands only after this
|
||||
version.
|
||||
- Version 1.17:
|
||||
- Jason confirmed the reading 'for now (subject to future change)' (Q237). The
|
||||
rulings stand until he revises them.
|
||||
- The 10-27 Case 2 release ships on Markdown as built (P6). The 1.11 line 'The
|
||||
Case 2 MVP for 10-27 is the Markdown library (#416). The WYSIWYG editor (Q195,
|
||||
Q196) is an add-on that doesn't gate it.' still holds. Conversion opens after
|
||||
10-27, and only once REQ-LIB-8's four conditions are met. The editor ships,
|
||||
the writing store's remote is set and the stack has checked that it can push
|
||||
there, agents can read and cite committed DOCX story files through the
|
||||
lookups, and Hermes is retired, which is #423 step 5.
|
||||
- The 1.12 note says five bus write and Console editor rows, C2-02, C2-03b,
|
||||
C2-11a, C2-11b and C2-19, don't gate 10-27. Jason's Q226 F42 later moved
|
||||
C2-02, C2-03b and C2-11b into the 10-27 slice. The Case 2 design brings C2-11a
|
||||
in with them, because C2-11b needs it. C2-19 stays outside the slice. Mos's
|
||||
reading of F42 is that C2-02 and C2-03b now gate 10-27, because design 9.2
|
||||
puts them in 'the smallest slice that lets her start'. C2-11a and C2-11b are
|
||||
slice rows that still don't gate 10-27, because the editor is the Q195 add-on.
|
||||
The DOCX change in 1.17 leaves this slice as it is, and C2-11b's Markdown
|
||||
editor never edits a converted story file.
|
||||
- Q236 narrows Q176's editor choice to DOCX for story files (REQ-LIB-9). The
|
||||
1.12 note that the Case 2 design keeps Obsidian now holds only for Markdown
|
||||
files, including story files not yet imported. A DOCX story file is edited
|
||||
only in the Console's editor under REQ-LIB-9.
|
||||
- This replaces two parts of the O2 design at 25c09f19f. The superseded-notice
|
||||
proposal from Fenton's F1 in D12 is withdrawn, and the
|
||||
keep-Markdown-at-its-path model of D11 is replaced. Gyro's rewrite of the O2
|
||||
design for Vikunja 571, landed on `refactor` at b99ca86b9, carries the
|
||||
details, and where it differs from this text, this text holds:
|
||||
- the import and archive steps, the mark, and the new bus step;
|
||||
- links from supporting files to a moved chapter;
|
||||
- the DOCX reader;
|
||||
- the user's unpushed or later changes to an archived file or at its old path,
|
||||
and pushing and closing the file in Obsidian before each import;
|
||||
- the writing store's remote in W4 section 7.3, which replaces the no-remote
|
||||
and no-backup rule that W4 section 7.4 held before the rewrite, at
|
||||
062646487;
|
||||
- import events counted by a bus restore, and recovery when a bus restore or a
|
||||
restore of the whole host predates an import;
|
||||
- manifest order for the manuscript lookup and its next chapter;
|
||||
- `library.convert` kept out of `ACTIONS`, out of the hard-wait note and out
|
||||
of the pinned `GATED_ONLY` list in packages/business/src/vocabulary.mjs.
|
||||
- Agents read a converted story file through the Case 2 lookups under the same
|
||||
project and universe access as Markdown canon, in any thread or room. W4's
|
||||
earlier O2-only conversations, per-document grants and per-send sharing don't
|
||||
gate these lookups. The 571 rewrite replaced them in W4 sections 7.1 and 7.2.
|
||||
The creative tool list in REQ-LIB-6 doesn't change.
|
||||
- The six creative role contracts row 213 landed say 'Every item cites the
|
||||
lines of the user's material it is about'. A build row under 571 changes that
|
||||
line for DOCX story files (REQ-LIB-6).
|
||||
- A new Markdown file in a book folder is still canon in 1.17. The 1.17
|
||||
exception is a file at a converted file's old path, which REQ-LIB-2 makes
|
||||
unmapped.
|
||||
- Story files convert whether canon or playground. Type-folder and supporting
|
||||
files stay Markdown.
|
||||
- Measured 2026-10-23 at about 01:21Z: the Case 2 user's library repository
|
||||
tracks 213 files, 203 of them Markdown, and none is a .docx or .doc. It has no
|
||||
untracked files. The user's .doc files (Q196) are outside it. So the landed
|
||||
code has no DOCX there to report as unreadable at 10-27.
|
||||
- Text replaced in 1.17, kept here as in earlier notes:
|
||||
- Creative library lead, the 1.16 sentence: "The library is the user's own
|
||||
writing repository."
|
||||
- REQ-LIB-2, the 1.16 sentences: "A file's scope comes from its path alone,
|
||||
prefixes first: a Markdown file under a supporting prefix is supporting,
|
||||
one under a playground prefix at any level is playground, any other
|
||||
Markdown file in a book folder is canon, and everything else is unmapped
|
||||
and never returned. A folder in both lists is supporting." "Lookups return
|
||||
canon unless the caller asks for playground or supporting." "so an agent
|
||||
can't cite a playground or supporting file as canon" "The Console shows
|
||||
each cite's scope."
|
||||
- REQ-LIB-4, the 1.16 sentences: "The user commits and pushes with their own
|
||||
tools, today Obsidian with obsidian-git." "Agents read only the mirror's
|
||||
served commit and never hold a copy of their own, so they see the user's
|
||||
push within about a minute."
|
||||
- REQ-LIB-5, the 1.16 sentence: "The user sees them in Obsidian's graph and
|
||||
backlinks." A converted chapter's connections show in Obsidian only as they
|
||||
stood at conversion, and the Console's Connections view shows their
|
||||
current links.
|
||||
- REQ-LIB-6, the 1.16 sentence: "A reply may cite lines of the repository at
|
||||
a commit or pages the agent fetched, and the broker checks every citation
|
||||
before it stores the message."
|
||||
- REQ-LIB-1 only gains sentences.
|
||||
- REQ-LIB-3's text and REQ-LIB-7 are unchanged. REQ-LIB-8 adds one form of
|
||||
exclusion REQ-LIB-3 doesn't have: naming a DOCX document by its id. A path
|
||||
exclusion also covers DOCX documents, through a converted file's old path or a
|
||||
whole book folder. An archived file and a DOCX document keep a universe, and a
|
||||
book where their source has one, so every lookup still names one universe.
|
||||
REQ-PROJ-3, the Console editor for a project's spec and docs, is unchanged.
|
||||
C2-11b opens the library's Markdown files in that same editor.
|
||||
- In `packages/tasks/requirements.json` the titles of REQ-LIB-1, REQ-LIB-2 and
|
||||
REQ-LIB-4 change, and those of REQ-LIB-5 and REQ-LIB-6 stay. REQ-LIB-1 becomes
|
||||
'A human-set library maps the user's repository onto universes, books, types,
|
||||
playgrounds, supporting and archive folders'. REQ-LIB-2 becomes 'Scope comes
|
||||
from the path or a DOCX's source, lookups default to canon, and only canon
|
||||
files are ever cited as canon'. REQ-LIB-4 becomes 'Git holds every change. The
|
||||
bus fast-forwards a read-only mirror every 60 seconds, the one place agents
|
||||
read Markdown'. REQ-LIB-8 and REQ-LIB-9 add two ids, so the count goes from 85
|
||||
to 87. REQ-LIB-8 is titled 'Case 2 story files become DOCX by a human-only
|
||||
one-way import or in the editor; Markdown stays for notes and docs', and
|
||||
REQ-LIB-9 'The Console's DOCX editor: only a human saves, each save is one
|
||||
commit, and the editor code is vendored and pinned'.
|
||||
- Open points O1 to O4 of draft 1 were ruled by Mos in mos-1367 B1 to B4.
|
||||
- Sage files the build rows under Vikunja 570 and 571 after the rewrite is
|
||||
approved. This amendment adds the requirements only.
|
||||
|
||||
## Risks and open questions
|
||||
|
||||
@@ -1788,6 +2123,26 @@ latest-by date and a hard target (Q176).
|
||||
seat sandbox with its own network namespace closes it. Until then the
|
||||
host's own audit log is the check after the fact (row 210 design section
|
||||
6).
|
||||
- A DOCX file is a zip archive, so git can't show a line diff of a chapter.
|
||||
Review of a story change goes through the editor and the committed reader,
|
||||
not `git diff`. (Version 1.17.)
|
||||
- A converted chapter's DOCX is not in Obsidian's graph. Obsidian shows the
|
||||
chapter only through its archived Markdown, and no DOCX edit reaches that file's
|
||||
links. The DOCX's current links show in the Console's editor and its
|
||||
Connections view, and no graph shows them yet. (Version 1.17.)
|
||||
- Conversion can't be undone in place. Front matter, wiki link forms and
|
||||
unsupported blocks may not survive it, and the mirror can't refuse the user's
|
||||
push to an archived file. The controls are the fidelity report, the human's
|
||||
confirmation, an untouched original on refusal, and the kept archive.
|
||||
(Version 1.17.)
|
||||
- A restore of the stack's bus alone from a backup taken before an import drops
|
||||
the import's logged events, while the archive commit and the DOCX stay. A
|
||||
restore of the stack's whole host from such a backup also takes the writing
|
||||
store and the host's import records back to before the import. The archive
|
||||
commit stays in the user's Gitea repository and the DOCX stays on the writing
|
||||
store's remote, but the host keeps no record of the import. A bus restore counts
|
||||
import events, and the import's recovery covers both cases (Vikunja 571).
|
||||
(Version 1.17.)
|
||||
|
||||
## Milestones
|
||||
|
||||
|
||||
+140
-24
@@ -137,6 +137,9 @@ export const TESTER_VERBS = Object.freeze(['message.send', 'message.receive', 'm
|
||||
// collaborator grant, so a viewer gets access-refused on each.
|
||||
export const USER_VERBS = Object.freeze(['project.list', 'thread.create', 'thread.list', 'thread.open', 'thread.send', 'thread.messages', 'names',
|
||||
'thread.share', 'thread.unshare', 'thread.shares']);
|
||||
// Row 252 (#1753, design sections 2-3): the only verbs a Console owner cap reaches. Every other verb
|
||||
// refuses it human-required before its own checks, and these refuse every other cap.
|
||||
export const CONSOLE_VERBS = Object.freeze(['decision.preview.console', 'decision.resolve.console']);
|
||||
// Row 275 (193b1b, #1780, row 193 design 4.3 and 9): the user verbs a viewer grant reaches. They
|
||||
// read, so a live grant at any level covers them. thread.create, thread.open and thread.send need a
|
||||
// collaborator grant on the project and instance, so a viewer gets access-refused on each.
|
||||
@@ -1456,6 +1459,26 @@ export class Broker {
|
||||
if (!this.#userGrants(s).length) fail('access-revoked');
|
||||
return this.#cap(s);
|
||||
}
|
||||
// Row 252 (#1753, design section 2): the trusted Console transport invokes this only after
|
||||
// verifyPrincipal checked the console-cli wrapper, its webui `serve` parent and the signed-in owner.
|
||||
// The cap is the business human's with via 'console' and the owner subject. request() lets it reach
|
||||
// CONSOLE_VERBS only, and #human refuses it, so no cli verb accepts it.
|
||||
bindConsole(record) {
|
||||
keys(record, ['business', 'human', 'subject'], ['business', 'human', 'subject']);
|
||||
const b = this.#business(record.business);
|
||||
const x = record.subject;
|
||||
if (record.human !== b.human || !object(x) || Object.keys(x).length !== 3 ||
|
||||
!['provider', 'iss', 'sub'].every((k) => typeof x[k] === 'string' && x[k].length > 0 && x[k].length <= 512))
|
||||
fail('human-required');
|
||||
return this.#cap({
|
||||
business: record.business,
|
||||
human: b.human,
|
||||
via: 'console',
|
||||
console: Object.freeze({ provider: x.provider, iss: x.iss, sub: x.sub }),
|
||||
role: null,
|
||||
run: null,
|
||||
});
|
||||
}
|
||||
bindReader({ business }) {
|
||||
this.#business(business);
|
||||
return this.#cap({ business, reader: true, role: null, run: null, human: false });
|
||||
@@ -1504,10 +1527,61 @@ export class Broker {
|
||||
const raise = this.#raised(business, decision);
|
||||
if (d?.action !== 'credential.mint' || d.route_to !== 'human' || !raise?.grant) return null;
|
||||
const r = this.#closed(decision);
|
||||
if (r?.op !== 'resolved' || r.choice !== raise.approvalChoice || r.via !== 'cli' || r.by !== this.#business(business).human)
|
||||
return null;
|
||||
if (r?.op !== 'resolved' || r.choice !== raise.approvalChoice || r.by !== this.#business(business).human) return null;
|
||||
// Row 252 (#1753, design section 3, J14): a console close counts only with its own human.input,
|
||||
// which only the broker writes (recordEvent reserves the kind).
|
||||
if (!(r.via === 'console' ? this.#consoleInput(business, decision, r) : r.via === 'cli')) return null;
|
||||
return raise.grant;
|
||||
}
|
||||
// Row 252: the console answer's human.input for close row r. Same decision, same seq, same choice,
|
||||
// no role or run, and a three-string owner subject.
|
||||
#consoleInput(business, decision, r) {
|
||||
const e = this.#store.get(
|
||||
`SELECT body FROM events WHERE business=? AND kind='human.input' AND subject=? AND actor_role IS NULL AND actor_run IS NULL
|
||||
AND json_extract(body,'$.via')='console' AND json_extract(body,'$.decisionSeq')=? ORDER BY seq LIMIT 1`,
|
||||
business,
|
||||
decision,
|
||||
r.seq,
|
||||
);
|
||||
const x = e && JSON.parse(e.body);
|
||||
return (
|
||||
!!x &&
|
||||
x.kind === 'answer' &&
|
||||
x.decision === decision &&
|
||||
x.op === 'resolved' &&
|
||||
x.choice === r.choice &&
|
||||
object(x.subject) &&
|
||||
['provider', 'iss', 'sub'].every((k) => typeof x.subject[k] === 'string' && x.subject[k].length > 0)
|
||||
);
|
||||
}
|
||||
// Row 252 (design section 1): a Console-eligible grant request, or null. Open is the caller's
|
||||
// check. Eligible is route_to human, action credential.mint, a raise with a validated grant binding
|
||||
// and exactly two distinct option keys, one of them approvalChoice. Approve is that key and deny is
|
||||
// the other. The summary carries only the binding's method, agent, host and target projects. The
|
||||
// digest binds the id, business, options, approval key and binding, so any change reads stale.
|
||||
#consoleResolution(d) {
|
||||
if (d.route_to !== 'human' || d.action !== 'credential.mint') return null;
|
||||
const raise = this.#raised(d.business, d.id);
|
||||
if (!object(raise?.grant) || typeof raise.grant.method !== 'string') return null;
|
||||
const options = JSON.parse(d.options);
|
||||
if (options.length !== 2 || options[0].key === options[1].key) return null;
|
||||
const approve = options.find((o) => o.key === raise.approvalChoice);
|
||||
if (!approve) return null;
|
||||
const deny = options.find((o) => o.key !== raise.approvalChoice);
|
||||
const g = raise.grant;
|
||||
const grant = {
|
||||
method: g.method,
|
||||
...(typeof g.agent === 'string' ? { agent: g.agent } : {}),
|
||||
...(typeof g.host === 'string' ? { host: g.host } : {}),
|
||||
...(Array.isArray(g.target?.projects) ? { projects: g.target.projects.filter((p) => typeof p === 'string') } : {}),
|
||||
};
|
||||
return {
|
||||
approve: { key: approve.key, text: approve.text },
|
||||
deny: { key: deny.key, text: deny.text },
|
||||
grant,
|
||||
digest: sha256(JSON.stringify([d.id, d.business, options, raise.approvalChoice, raise.grant])),
|
||||
};
|
||||
}
|
||||
// r6 X1: the executor's own spend. The caller owns the transaction. The consume record is the only
|
||||
// guarded body with `decision` (#436b section 7), so #spent counts it.
|
||||
#consumeGrant(business, decision, method) {
|
||||
@@ -4551,6 +4625,9 @@ export class Broker {
|
||||
grants = this.#userGrants(s, doc);
|
||||
if (!grants.length) fail('access-revoked');
|
||||
}
|
||||
// Row 252 (design section 2, N4): a console cap reaches the two console verbs only, and nothing
|
||||
// else reaches them. decision.resolve stays off the list.
|
||||
if (!!s.console !== CONSOLE_VERBS.includes(request.verb)) fail('human-required');
|
||||
const args = request.args ?? {};
|
||||
if (!object(args)) fail('invalid-request');
|
||||
this.#secretCheck(args);
|
||||
@@ -5081,6 +5158,7 @@ export class Broker {
|
||||
const s = this.#session(cap);
|
||||
try {
|
||||
if (s.user) fail('access-refused');
|
||||
if (s.console) fail('human-required');
|
||||
this.#processingWork();
|
||||
keys(request, ['verb', 'args'], ['verb']);
|
||||
if (!TASK_VERBS.includes(request.verb)) fail('unknown-verb');
|
||||
@@ -5119,6 +5197,7 @@ export class Broker {
|
||||
let args;
|
||||
try {
|
||||
if (s.user) fail('access-refused');
|
||||
if (s.console) fail('human-required');
|
||||
keys(request, ['verb', 'args'], ['verb']);
|
||||
this.#processingWork();
|
||||
if (!verb) fail('unknown-verb');
|
||||
@@ -5178,6 +5257,7 @@ export class Broker {
|
||||
let a, entry, timeout, bound;
|
||||
try {
|
||||
if (s.user) fail('access-refused');
|
||||
if (s.console) fail('human-required');
|
||||
this.#processingWork();
|
||||
keys(request, ['verb', 'args'], ['verb']);
|
||||
if (!HOST_VERBS.includes(request.verb)) fail('unknown-verb');
|
||||
@@ -5501,15 +5581,38 @@ export class Broker {
|
||||
}
|
||||
return this.#decisionView(this.#decision(s, did));
|
||||
}
|
||||
// Row 252 (#1753, design section 3): the Console's read of one grant request before its
|
||||
// confirmation. It returns the two answers, a safe grant summary and the digest the answer must
|
||||
// carry. Anything not eligible refuses, so the browser never decides eligibility (J1).
|
||||
case 'decision.preview.console': {
|
||||
keys(a, ['id'], ['id']);
|
||||
identifier(a.id);
|
||||
if (!s.console || s.human !== b.human) fail('human-required');
|
||||
const d = this.#decision(s, a.id);
|
||||
if (this.#closed(d.id)) fail('decision-closed');
|
||||
const c = this.#consoleResolution(d);
|
||||
if (!c) fail('decision-not-eligible');
|
||||
return { id: d.id, business: d.business, question: d.question, ...c };
|
||||
}
|
||||
case 'decision.resolve.console':
|
||||
case 'decision.resolve':
|
||||
case 'decision.seen':
|
||||
case 'decision.withdraw': {
|
||||
keys(a, ['id', 'choice', 'note'], ['id']);
|
||||
const viaConsole = verb === 'decision.resolve.console';
|
||||
if (viaConsole) keys(a, ['id', 'choice', 'digest'], ['id', 'choice', 'digest']);
|
||||
else keys(a, ['id', 'choice', 'note'], ['id']);
|
||||
identifier(a.id);
|
||||
if (a.note !== undefined) string(a.note);
|
||||
const d = this.#decision(s, a.id);
|
||||
if (this.#closed(d.id)) fail('decision-closed');
|
||||
if (verb === 'decision.withdraw') {
|
||||
// Row 252 (design section 3): the Console answer rechecks eligibility, the digest and the choice
|
||||
// in this transaction. It answers one of the two keys, never a key the browser names (J2).
|
||||
if (viaConsole) {
|
||||
if (!s.console || s.human !== b.human) fail('human-required');
|
||||
const c = this.#consoleResolution(d);
|
||||
if (!c) fail('decision-not-eligible');
|
||||
if (a.digest !== c.digest || ![c.approve.key, c.deny.key].includes(a.choice)) fail('decision-stale');
|
||||
} else if (verb === 'decision.withdraw') {
|
||||
if (s.human) {
|
||||
this.#human(s);
|
||||
} else {
|
||||
@@ -5521,32 +5624,39 @@ export class Broker {
|
||||
this.#agent(s);
|
||||
if (s.role !== d.route_to) fail('not-resolver');
|
||||
}
|
||||
const op = verb === 'decision.resolve' ? 'resolved' : verb === 'decision.seen' ? 'seen' : 'withdrawn';
|
||||
const op = verb === 'decision.resolve' || viaConsole ? 'resolved' : verb === 'decision.seen' ? 'seen' : 'withdrawn';
|
||||
if (op === 'resolved' && !JSON.parse(d.options).some((o) => o.key === a.choice))
|
||||
fail('invalid-choice');
|
||||
this.#store.run(
|
||||
'INSERT INTO decision_events(decision,at,op,by,choice,note,via) VALUES(?,?,?,?,?,?,?)',
|
||||
d.id,
|
||||
this.#now(),
|
||||
op,
|
||||
by,
|
||||
op === 'resolved' ? a.choice : null,
|
||||
a.note ?? null,
|
||||
s.human ? 'cli' : 'broker',
|
||||
const seq = Number(
|
||||
this.#store.run(
|
||||
'INSERT INTO decision_events(decision,at,op,by,choice,note,via) VALUES(?,?,?,?,?,?,?)',
|
||||
d.id,
|
||||
this.#now(),
|
||||
op,
|
||||
by,
|
||||
op === 'resolved' ? a.choice : null,
|
||||
a.note ?? null,
|
||||
s.console ? 'console' : s.human ? 'cli' : 'broker',
|
||||
).lastInsertRowid,
|
||||
);
|
||||
// Row 234 (#1740, r6 X1): the human's cli approve of a grant mint starts the executor once this
|
||||
// transaction commits. It rechecks all of this itself, so a rollback starts nothing.
|
||||
const grant = op === 'resolved' ? this.#approvedGrant(s.business, d.id) : null;
|
||||
if (grant?.method === 'host-enroll') setImmediate(() => this.#runEnrollment(s.business, d.id));
|
||||
if (grant?.method === 'host') setImmediate(() => this.#runHostGrant(s.business, d.id));
|
||||
if (grant?.method === 'gitea') setImmediate(() => this.#startGitea(s.business, d.id));
|
||||
// Row 252 (N2): the human.input comes before #approvedGrant, which needs a console answer's
|
||||
// record to start the executor. Its body names the owner subject and the close's seq.
|
||||
if (s.human)
|
||||
this.#event(
|
||||
s,
|
||||
'human.input',
|
||||
{ kind: 'answer', decision: d.id, op, choice: a.choice ?? null },
|
||||
s.console
|
||||
? { kind: 'answer', decision: d.id, op, choice: a.choice, via: 'console', subject: s.console, decisionSeq: seq }
|
||||
: { kind: 'answer', decision: d.id, op, choice: a.choice ?? null },
|
||||
d.id,
|
||||
);
|
||||
// Row 234 (#1740, r6 X1): the human's cli approve of a grant mint starts the executor once this
|
||||
// transaction commits. It rechecks all of this itself, so a rollback starts nothing. Row 252: a
|
||||
// Console approve does too. A deny closes the decision with the other key and starts nothing.
|
||||
const grant = op === 'resolved' ? this.#approvedGrant(s.business, d.id) : null;
|
||||
if (grant?.method === 'host-enroll') setImmediate(() => this.#runEnrollment(s.business, d.id));
|
||||
if (grant?.method === 'host') setImmediate(() => this.#runHostGrant(s.business, d.id));
|
||||
if (grant?.method === 'gitea') setImmediate(() => this.#startGitea(s.business, d.id));
|
||||
// Row 115 (#1609): a close by anyone but the raising run tells the raising role, routed like message.send's.
|
||||
// Row 133 (#1627): no messaging check here. decision.raise refused a route that can't message the
|
||||
// raiser, definitions change only with a pinned copy and arbiters only through the business
|
||||
@@ -5573,7 +5683,7 @@ export class Broker {
|
||||
this.#now(),
|
||||
s.business,
|
||||
s.human ? 'human' : s.role,
|
||||
s.human ? 'human-cli' : s.run,
|
||||
s.console ? 'human-console' : s.human ? 'human-cli' : s.run,
|
||||
d.raised_by_role,
|
||||
'DECISION',
|
||||
null,
|
||||
@@ -5583,7 +5693,8 @@ export class Broker {
|
||||
);
|
||||
this.#route(s.business, mid, d.raised_by_role, session);
|
||||
}
|
||||
return grant ? { id: d.id, op, grant: 'started' } : { id: d.id, op };
|
||||
const answer = viaConsole ? { id: d.id, op, choice: a.choice } : { id: d.id, op };
|
||||
return grant ? { ...answer, grant: 'started' } : answer;
|
||||
}
|
||||
case 'message.send': {
|
||||
keys(a, ['to', 'body', 'class', 'in_reply_to', 'corrects', 'decision'], ['to', 'body']);
|
||||
@@ -5939,7 +6050,12 @@ export class Broker {
|
||||
s.business,
|
||||
s.human || s.reader ? 'human' : s.role,
|
||||
)
|
||||
.map((d) => this.#decisionView(d));
|
||||
.map((d) => {
|
||||
// Row 252: a grant request the Console can answer carries its two answers. The Console
|
||||
// shows buttons from this, and the answer path rechecks it at the bus.
|
||||
const c = s.human || s.reader ? this.#consoleResolution(d) : null;
|
||||
return c ? { ...this.#decisionView(d), console: c } : this.#decisionView(d);
|
||||
});
|
||||
if (verb === 'agents') {
|
||||
const claims = this.#store.all(
|
||||
"SELECT * FROM role_claims c WHERE business=? AND op='claim' AND seq=(SELECT max(seq) FROM role_claims WHERE business=c.business AND role=c.role) ORDER BY role",
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
import { connect } from 'node:net';
|
||||
import { BusError, PROJECT_SAVE_VERB, PROJECT_SAVE_REQUEST_MAX } from './broker.mjs';
|
||||
export class Client {
|
||||
constructor({ path, cap, human, tester, user, timeout = 5000 }) {
|
||||
constructor({ path, cap, human, tester, user, console: owner, timeout = 5000 }) {
|
||||
this.path = path;
|
||||
this.cap = cap;
|
||||
this.human = human;
|
||||
this.tester = tester;
|
||||
this.user = user;
|
||||
this.console = owner;
|
||||
this.timeout = timeout;
|
||||
}
|
||||
call(verb, args = {}) {
|
||||
const request =
|
||||
JSON.stringify({
|
||||
...(this.human ? { human: this.human } : this.tester ? { tester: this.tester } : this.user ? { user: this.user } : { cap: this.cap }),
|
||||
...(this.human ? { human: this.human } : this.tester ? { tester: this.tester } : this.user ? { user: this.user } : this.console ? { console: this.console } : { cap: this.cap }),
|
||||
verb,
|
||||
args,
|
||||
}) + '\n';
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
// Row 252 (#1753, design section 2): the Console owner's transport shim, spawned only by the webui
|
||||
// `cli.mjs serve` process for one preview or one answer. Not a second product CLI. The Console sets
|
||||
// the nonce, the business and the signed-in (provider, iss, sub) in the spawn environment, and the
|
||||
// bus reads them back from this process's initial environment. Nothing respawns here, so the
|
||||
// Console stays the direct parent. Input is a verb and its args only: a body that names a business,
|
||||
// a subject or any other key is refused, never merged.
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { Client } from './client.mjs';
|
||||
import { readProcess } from './human.mjs';
|
||||
import { CONSOLE_VERBS } from './broker.mjs';
|
||||
const env = process.env;
|
||||
try {
|
||||
if (!/^[a-f0-9]{64}$/.test(env.MOSAIC_BUS_CONSOLE_NONCE ?? '')) throw Object.assign(Error(), { code: 'human-required' });
|
||||
const request = JSON.parse(readFileSync(0, 'utf8'));
|
||||
if (
|
||||
!request ||
|
||||
typeof request !== 'object' ||
|
||||
Array.isArray(request) ||
|
||||
Object.keys(request).some((k) => !['verb', 'args'].includes(k)) ||
|
||||
!CONSOLE_VERBS.includes(request.verb)
|
||||
)
|
||||
throw Error();
|
||||
const me = readProcess(process.pid);
|
||||
const client = new Client({
|
||||
path: process.argv[2],
|
||||
console: {
|
||||
business: env.MOSAIC_BUS_CONSOLE_BUSINESS,
|
||||
provider: env.MOSAIC_BUS_CONSOLE_PROVIDER,
|
||||
iss: env.MOSAIC_BUS_CONSOLE_ISS,
|
||||
sub: env.MOSAIC_BUS_CONSOLE_SUB,
|
||||
pid: me.pid,
|
||||
startTime: me.startTime,
|
||||
nonce: env.MOSAIC_BUS_CONSOLE_NONCE,
|
||||
},
|
||||
});
|
||||
const result = await client.call(request.verb, request.args ?? {});
|
||||
process.stdout.write(JSON.stringify(result) + '\n');
|
||||
} catch (e) {
|
||||
process.stderr.write((/^[a-z-]{1,64}$/.test(e.code ?? '') ? e.code : 'invalid-request') + '\n');
|
||||
process.exitCode = 2;
|
||||
}
|
||||
@@ -10,6 +10,10 @@ const MARKERS = [
|
||||
'CODEX_THREAD_ID',
|
||||
'PI_AGENT_DIR',
|
||||
];
|
||||
// Row 252 (#1753, Webby N5): the Console wrapper's nonce and the subject its spawn bound. The
|
||||
// verifier reads each from the wrapper's initial environment, never from its proof alone.
|
||||
export const CONSOLE_ENV = Object.freeze(['MOSAIC_BUS_CONSOLE_NONCE', 'MOSAIC_BUS_CONSOLE_BUSINESS', 'MOSAIC_BUS_CONSOLE_PROVIDER', 'MOSAIC_BUS_CONSOLE_ISS', 'MOSAIC_BUS_CONSOLE_SUB']);
|
||||
const NONCE_KEYS = ['MOSAIC_BUS_CLI_NONCE', 'MOSAIC_BUS_USER_NONCE', ...CONSOLE_ENV];
|
||||
const refuse = () => {
|
||||
throw new BusError('human-required');
|
||||
};
|
||||
@@ -31,7 +35,7 @@ export function readProcess(pid, { readFile = readFileSync, stat = lstatSync } =
|
||||
for (const entry of environment.split('\0')) {
|
||||
const i = entry.indexOf('=');
|
||||
const key = entry.slice(0, i);
|
||||
if (['MOSAIC_BUS_CLI_NONCE', 'MOSAIC_BUS_USER_NONCE'].includes(key) || MARKERS.includes(key)) env[key] = entry.slice(i + 1);
|
||||
if (NONCE_KEYS.includes(key) || MARKERS.includes(key)) env[key] = entry.slice(i + 1);
|
||||
}
|
||||
return {
|
||||
pid,
|
||||
|
||||
@@ -5,8 +5,8 @@ import { verifyTester, testerNonce } from './tester.mjs';
|
||||
|
||||
// Trusted transport API. Identity is held only by this connection's transient session.
|
||||
// User mapping and live grant authorization belong to R3, not to this verifier.
|
||||
export function verifyPrincipal(request, { peer, paths, businesses, launches = [], readProcess = defaultRead, readTesterNonce = testerNonce }) {
|
||||
const kinds = ['human', 'tester', 'user'].filter(k => request?.[k]);
|
||||
export function verifyPrincipal(request, { peer, paths, businesses, launches = [], readProcess = defaultRead, readTesterNonce = testerNonce, consoleOwners = [] }) {
|
||||
const kinds = ['human', 'tester', 'user', 'console'].filter(k => request?.[k]);
|
||||
if (kinds.length !== 1 || request.cap) throw new BusError('invalid-envelope');
|
||||
const kind = kinds[0], proof = request[kind];
|
||||
const error = kind === 'tester' ? 'tester-required' : 'human-required';
|
||||
@@ -16,6 +16,7 @@ export function verifyPrincipal(request, { peer, paths, businesses, launches = [
|
||||
const { business } = verifyTester(proof, { cliPath: paths.tester, launches, readProcess, readNonce: readTesterNonce });
|
||||
return { kind: 'tester', business, id: 'tester' };
|
||||
}
|
||||
if (kind === 'console') return verifyConsole(proof, { peer, paths, businesses, launches, readProcess, consoleOwners });
|
||||
let checked = proof, parent;
|
||||
if (kind === 'user') {
|
||||
if (!proof || typeof proof.user !== 'string' || !proof.user ||
|
||||
@@ -42,3 +43,38 @@ export function verifyPrincipal(request, { peer, paths, businesses, launches = [
|
||||
if (!id) throw new BusError('unknown-business');
|
||||
return { kind: 'owner', business, id };
|
||||
}
|
||||
|
||||
// Row 252 (#1753, design section 2): the Console owner. The same-tree console-cli.mjs wrapper, its own
|
||||
// nonce namespace and the human walk, with the exact same-tree webui `cli.mjs serve` as its direct
|
||||
// parent, read again after the walk as the user kind does. Business and (provider, iss, sub) must be
|
||||
// the wrapper's initial spawn environment and one of the checked console.sso subjects the runtime
|
||||
// was started with (Webby N1: every configured subject is an owner). The Console's mapping is trusted
|
||||
// as row 196 permits; the bus does not exchange an ID token itself.
|
||||
const SUBJECT_KEYS = ['provider', 'iss', 'sub'];
|
||||
const SUBJECT_ENV = { business: 'MOSAIC_BUS_CONSOLE_BUSINESS', provider: 'MOSAIC_BUS_CONSOLE_PROVIDER', iss: 'MOSAIC_BUS_CONSOLE_ISS', sub: 'MOSAIC_BUS_CONSOLE_SUB' };
|
||||
function verifyConsole(proof, { peer, paths, businesses, launches, readProcess, consoleOwners }) {
|
||||
const refuse = () => { throw new BusError('human-required'); };
|
||||
if (!proof || typeof proof !== 'object' ||
|
||||
Object.keys(proof).some(k => !['pid', 'startTime', 'nonce', 'business', ...SUBJECT_KEYS].includes(k)) ||
|
||||
SUBJECT_KEYS.some(k => typeof proof[k] !== 'string' || !proof[k] || proof[k].length > 512)) refuse();
|
||||
if (typeof paths.consoleCli !== 'string' || typeof paths.console !== 'string') refuse();
|
||||
const { provider, iss, sub, ...checked } = proof;
|
||||
let child, parent;
|
||||
try {
|
||||
child = readProcess(proof.pid);
|
||||
parent = readProcess(child.ppid);
|
||||
if (parent.uid !== peer.uid || parent.argv[1] !== resolve(paths.console) || parent.argv[2] !== 'serve') refuse();
|
||||
for (const [key, name] of Object.entries(SUBJECT_ENV)) if (child.env?.[name] !== proof[key]) refuse();
|
||||
} catch { refuse(); }
|
||||
const { business } = verifyHuman(checked, { cliPath: paths.consoleCli, launches, readProcess, nonceKey: 'MOSAIC_BUS_CONSOLE_NONCE' });
|
||||
try {
|
||||
const again = readProcess(proof.pid), up = readProcess(parent.pid);
|
||||
if (again.ppid !== parent.pid || again.startTime !== child.startTime || up.startTime !== parent.startTime ||
|
||||
up.ppid !== parent.ppid || up.uid !== parent.uid || up.argv[1] !== parent.argv[1] || up.argv[2] !== 'serve') refuse();
|
||||
for (const [key, name] of Object.entries(SUBJECT_ENV)) if (again.env?.[name] !== proof[key]) refuse();
|
||||
} catch { refuse(); }
|
||||
if (!Array.isArray(consoleOwners) || !consoleOwners.some(o => o && o.provider === provider && o.iss === iss && o.sub === sub)) refuse();
|
||||
const id = businesses[business]?.human;
|
||||
if (!id) throw new BusError('unknown-business');
|
||||
return { kind: 'console', business, id, via: 'console', subject: { provider, iss, sub } };
|
||||
}
|
||||
@@ -106,7 +106,15 @@ export async function startBroker({
|
||||
// Without it no user binds. R6 and R8 pass it; the live boot config doesn't yet. FED R4 (#1801):
|
||||
// intervalMs, the revocation timer's period (design 3.7, 30 s), in-process only like librarySync's.
|
||||
access = null,
|
||||
// Row 252 (#1753, design section 2): the checked console.sso subjects, [{provider, iss, sub}], each an
|
||||
// owner of the business (Webby N1). The boot config carries them; no socket verb sets them. Empty, no
|
||||
// Console owner binds and the terminal owner is unchanged.
|
||||
consoleOwners = [],
|
||||
}) {
|
||||
if (!Array.isArray(consoleOwners) || consoleOwners.length > 512 || consoleOwners.some((o) => o === null || typeof o !== 'object' || Array.isArray(o) ||
|
||||
Object.keys(o).length !== 3 || ['provider', 'iss', 'sub'].some((k) => typeof o[k] !== 'string' || !o[k] || o[k].length > 512)))
|
||||
throw new BusError('invalid-host-request');
|
||||
const owners = Object.freeze(consoleOwners.map((o) => Object.freeze({ provider: o.provider, iss: o.iss, sub: o.sub })));
|
||||
if (access !== null && (typeof access?.file !== 'string' || access.context === null || typeof access.context !== 'object'
|
||||
|| (Object.hasOwn(access, 'intervalMs') && !(Number.isSafeInteger(access.intervalMs) && access.intervalMs > 0))))
|
||||
throw new BusError('invalid-host-request');
|
||||
@@ -408,6 +416,7 @@ export async function startBroker({
|
||||
tester: fileURLToPath(new URL('./tester-cli.mjs', import.meta.url)),
|
||||
user: fileURLToPath(new URL('./user-cli.mjs', import.meta.url)),
|
||||
console: fileURLToPath(new URL('../../webui/src/cli.mjs', import.meta.url)),
|
||||
consoleCli: fileURLToPath(new URL('./console-cli.mjs', import.meta.url)),
|
||||
};
|
||||
const path = join(store.directory, 'broker.sock');
|
||||
// The existing host executor owns SSH and its key lifecycle. Combine its revocation
|
||||
@@ -439,6 +448,11 @@ export async function startBroker({
|
||||
const p = verifyPrincipal({ user: proof }, { peer, paths: principalPaths, businesses, launches: launchRecords });
|
||||
return broker.bindUser({ business: p.business, user: p.id });
|
||||
},
|
||||
// Row 252 (#1753): a fresh proof per connection, a cap for the Console verbs only.
|
||||
authenticateConsole: (proof, peer) => {
|
||||
const p = verifyPrincipal({ console: proof }, { peer, paths: principalPaths, businesses, launches: launchRecords, consoleOwners: owners });
|
||||
return broker.bindConsole({ business: p.business, human: p.id, subject: p.subject });
|
||||
},
|
||||
});
|
||||
// Row 235 (r6 X3): the remote undo of interrupted host grants, once the bus is up, so a start doesn't
|
||||
// wait on the network.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createServer } from 'node:net';
|
||||
import { lstatSync, chmodSync, unlinkSync } from 'node:fs';
|
||||
import { BusError, TASK_VERBS, WEB_VERBS, HOST_VERBS, HOSTS_VERBS, GRANTS_VERBS, PROJECT_FILE_VERBS, LIBRARY_VERBS, PROJECT_SAVE_VERB, PROJECT_SAVE_REQUEST_MAX } from './broker.mjs';
|
||||
import { BusError, TASK_VERBS, WEB_VERBS, HOST_VERBS, HOSTS_VERBS, GRANTS_VERBS, PROJECT_FILE_VERBS, LIBRARY_VERBS, PROJECT_SAVE_VERB, PROJECT_SAVE_REQUEST_MAX, CONSOLE_VERBS } from './broker.mjs';
|
||||
import { inspectInterpreter } from './interpreter.mjs';
|
||||
import { createPeerReader } from './peercred.mjs';
|
||||
const LIMIT = 65536;
|
||||
@@ -13,8 +13,9 @@ const SAVE_VERB_AT_START = new RegExp(`"verb":"${PROJECT_SAVE_VERB.replaceAll('.
|
||||
// the web verbs reach it, and without one they refuse web-not-configured (or web-not-granted).
|
||||
// `host` (row 210) is the trusted host.run executor (host-run.mjs), or null: host.run then refuses
|
||||
// host-not-configured.
|
||||
// A request carries exactly one of cap, human (row S4) and tester (row 110) proof.
|
||||
export async function serve({ broker, path, authenticateHuman = null, authenticateTester = null, authenticateUser = null, peerReader = null, timeout = 5000, tasks = null, web = null, host = null }) {
|
||||
// A request carries exactly one of cap, human (row S4), tester (row 110), user (FED R3) and console
|
||||
// (row 252) proof.
|
||||
export async function serve({ broker, path, authenticateHuman = null, authenticateTester = null, authenticateUser = null, authenticateConsole = null, peerReader = null, timeout = 5000, tasks = null, web = null, host = null }) {
|
||||
try {
|
||||
lstatSync(path);
|
||||
throw new BusError('socket-exists');
|
||||
@@ -64,15 +65,17 @@ export async function serve({ broker, path, authenticateHuman = null, authentica
|
||||
!r ||
|
||||
Array.isArray(r) ||
|
||||
typeof r !== 'object' ||
|
||||
Object.keys(r).some((k) => !['cap', 'human', 'tester', 'user', 'verb', 'args'].includes(k)) ||
|
||||
Object.keys(r).some((k) => !['cap', 'human', 'tester', 'user', 'console', 'verb', 'args'].includes(k)) ||
|
||||
typeof r.verb !== 'string' ||
|
||||
[r.cap, r.human, r.tester, r.user].filter(Boolean).length !== 1
|
||||
[r.cap, r.human, r.tester, r.user, r.console].filter(Boolean).length !== 1
|
||||
)
|
||||
throw new BusError('invalid-envelope');
|
||||
let cap = r.cap;
|
||||
const kind = r.human ? 'human' : r.tester ? 'tester' : r.user ? 'user' : null;
|
||||
const kind = r.human ? 'human' : r.tester ? 'tester' : r.user ? 'user' : r.console ? 'console' : null;
|
||||
// Row 252 (#1753): a Console owner proof reaches its two verbs only, refused before any proof check.
|
||||
if (kind === 'console' && !CONSOLE_VERBS.includes(r.verb)) throw new BusError('human-required');
|
||||
if (kind) {
|
||||
const authenticate = kind === 'human' ? authenticateHuman : kind === 'tester' ? authenticateTester : authenticateUser;
|
||||
const authenticate = kind === 'human' ? authenticateHuman : kind === 'tester' ? authenticateTester : kind === 'user' ? authenticateUser : authenticateConsole;
|
||||
if (!authenticate) throw new BusError(kind === 'tester' ? 'tester-required' : 'human-required');
|
||||
socket.pause();
|
||||
let peer;
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
// bus.mjs for six library-* STATUS entries; no proof or transport change.
|
||||
// Row 236 (#1742) re-pins human-cli.mjs for the same 130 s wait on the grants verbs; no proof or
|
||||
// transport change.
|
||||
// Row 252 (#1753, Webby N5) re-pins human.mjs, whose readProcess also keeps the five
|
||||
// MOSAIC_BUS_CONSOLE_* keys for the Console wrapper's proof, and webui bus.mjs for consoleCall,
|
||||
// which shares humanCall's spawn as transport(). The human proof and its spawn are unchanged.
|
||||
// Row 225 (C2-10b) re-pins webui bus.mjs for one STATUS entry, library-revert-not-agent: 409; no proof
|
||||
// or transport change.
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { createHash } from "node:crypto";
|
||||
@@ -15,7 +20,7 @@ import { provedRuntime } from "../../cli/tests/channel-fixture.mjs";
|
||||
import { Client } from "../src/client.mjs";
|
||||
|
||||
const baselines = {
|
||||
"packages/bus/src/human.mjs": "0c6d96abe4607cba0b02b0638a2fc217ff8135bac9a47761a0ef015fbe9d3079",
|
||||
"packages/bus/src/human.mjs": "bb13c146717cdc46d75d157177e400edac4d3e10f14fe511027a25fd44cec885",
|
||||
"packages/bus/src/human-cli.mjs": "271b9781d73cf31cc562a56180e3ebcd725b5fde148a83347a201fdef2fc28af",
|
||||
"packages/cli/src/transport.mjs": "5129c44b4d9f642e825344df65c9bfb4bac4fc8d6b25343b42d39853dbd40774",
|
||||
// Row 165 (#1662): seven STATUS entries for the role instance routes (organization-instance-exists,
|
||||
@@ -26,7 +31,7 @@ const baselines = {
|
||||
// Row 194 (#1692, brief item 7, sage-1610 a): organization-tracker-required 400 and
|
||||
// organization-tracker-bot-taken 409; no proof or transport change.
|
||||
// Row 301 (#1808, mos-1449): the user transport moved from user-bus.mjs into bus.mjs; humanCall unchanged.
|
||||
"packages/webui/src/bus.mjs": "39fcb27c82e917ef05e1a7a650d522c9f3c656bf8dbade87b8ddb3661b67ad6c",
|
||||
"packages/webui/src/bus.mjs": "9f33e9ca4feb7265ae33fd3ddf0ead0b75375d07ecbe9d8e55c618d29edea658",
|
||||
};
|
||||
const repoFile = path => new URL("../../../" + path, import.meta.url);
|
||||
|
||||
|
||||
@@ -0,0 +1,318 @@
|
||||
// Row 252 (#1753, Gander's design approved by Webby at 5d8f0f4b5, N1-N5): the broker side of the
|
||||
// Console's Approve and Deny for a grant request. A console cap, made by bindConsole after the
|
||||
// transport checked the wrapper and the signed-in owner, reaches only decision.preview.console and
|
||||
// decision.resolve.console, and no other cap reaches those. The answer records via 'console' and a
|
||||
// human.input that names the owner, written before the grant check (N2), and only that record lets
|
||||
// an approve start the executor (J13, J14). Q188: no agent caller answers. The grant uses row 234's
|
||||
// host-enroll raise with a fake keyscan and fake enroll and check steps, so nothing connects anywhere.
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import { mkdtempSync, readFileSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { Broker, CONSOLE_VERBS } from '../src/broker.mjs';
|
||||
import { Client } from '../src/client.mjs';
|
||||
import { serve } from '../src/server.mjs';
|
||||
import { Store } from '../src/store.mjs';
|
||||
import { hostGrant, fingerprint } from '../src/host-grant.mjs';
|
||||
import { grantDecision } from './host-fixtures.mjs';
|
||||
|
||||
const options = [{ key: 'yes', text: 'Yes, enroll it' }, { key: 'no', text: 'No' }];
|
||||
const SUBJECT = { provider: 'fake-oidc', iss: 'https://idp.test', sub: 'owner-1' };
|
||||
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
const keyLine = (dir, name) => {
|
||||
execFileSync('ssh-keygen', ['-q', '-t', 'ed25519', '-N', '', '-C', 'x', '-f', join(dir, name)]);
|
||||
return readFileSync(join(dir, name + '.pub'), 'utf8').trim().split(' ').slice(0, 2).join(' ');
|
||||
};
|
||||
const refusesSync = (fn, code) => assert.throws(fn, (e) => (assert.equal(e.code, code), true));
|
||||
|
||||
function setup(t) {
|
||||
const root = mkdtempSync(join(tmpdir(), 'c252-'));
|
||||
const store = new Store(root);
|
||||
t.after(() => {
|
||||
store.close();
|
||||
rmSync(root, { recursive: true, force: true });
|
||||
});
|
||||
const hostKeys = [keyLine(root, 'hk1'), keyLine(root, 'hk2')];
|
||||
const configDir = join(root, 'config');
|
||||
const real = hostGrant({ configDir, runRoot: join(configDir, 'secrets', 'run'), scan: async () => hostKeys });
|
||||
const enrolls = [];
|
||||
const hg = {
|
||||
...real,
|
||||
enroll: async (...args) => (enrolls.push(args), real.enroll(...args)),
|
||||
check: async (...args) => ({ installerFingerprint: args[2].installer_fingerprint, exit: 0 }),
|
||||
};
|
||||
const business = {
|
||||
id: 'demo',
|
||||
human: 'jason',
|
||||
arbiters: { technical: 'pm', delivery: 'pm' },
|
||||
roles: {
|
||||
chief: { definition: 'chief-of-staff', authority: { withinRole: ['message.send'], crossRole: [] } },
|
||||
pm: { definition: 'pm', authority: { withinRole: ['message.send'], crossRole: [] } },
|
||||
},
|
||||
vars: { 'bus.tester': true },
|
||||
};
|
||||
const make = () => new Broker({ store, businesses: { demo: business }, hostGrant: hg });
|
||||
const broker = make();
|
||||
const caps = {};
|
||||
for (const role of ['chief', 'pm']) {
|
||||
caps[role] = broker.bindLaunch({ business: 'demo', role, run: role + '-run', harness: 'pi', address: role });
|
||||
broker.request(caps[role], { verb: 'role.claim' });
|
||||
}
|
||||
caps.human = broker.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true });
|
||||
caps.tester = broker.bindTester({ business: 'demo' });
|
||||
caps.reader = broker.bindReader({ business: 'demo' });
|
||||
caps.console = broker.bindConsole({ business: 'demo', human: 'jason', subject: SUBJECT });
|
||||
const grant = { method: 'host-enroll', host: 'web1', address: '192.0.2.10', port: 22, user: 'jarvis', sudo: true, fingerprints: hostKeys.map(fingerprint) };
|
||||
const call = (who, verb, args = {}) => broker.request(caps[who], { verb, args });
|
||||
const raise = (extra = {}) =>
|
||||
call('chief', 'decision.raise', { action: 'credential.mint', question: 'Enroll web1?', options, recommendation: 'yes', blocking: false, grant, ...extra });
|
||||
const events = () =>
|
||||
store
|
||||
.all("SELECT seq, kind, actor_role, actor_run, subject, body FROM events WHERE business='demo' ORDER BY seq")
|
||||
// The row's subject is `about`, since a console answer's body has its own `subject`. The row's kind
|
||||
// is `event`, set after the body, since an answer's body has its own `kind`.
|
||||
.map((e) => ({ seq: e.seq, kind: e.kind, actor_role: e.actor_role, actor_run: e.actor_run, about: e.subject, ...JSON.parse(e.body), event: e.kind }));
|
||||
const grantEvents = (decision) => events().filter((e) => e.actor_run === 'grant' && (e.decision === decision || e.grantDecision === decision));
|
||||
const settle = async (decision) => {
|
||||
for (let i = 0; i < 250; i++) {
|
||||
if (grantEvents(decision).some((e) => ['grant.host.enrolled', 'grant.failed'].includes(e.action))) return;
|
||||
await sleep(20);
|
||||
}
|
||||
throw new Error('enrollment did not end');
|
||||
};
|
||||
const closes = (decision) => store.all('SELECT seq, op, by, choice, via FROM decision_events WHERE decision=? ORDER BY seq', decision);
|
||||
return { store, broker, make, caps, call, raise, events, grantEvents, settle, closes, enrolls, grant };
|
||||
}
|
||||
|
||||
test('N4: the console verbs are exactly the preview and the console resolve, and decision.resolve is not one', () => {
|
||||
assert.deepEqual([...CONSOLE_VERBS], ['decision.preview.console', 'decision.resolve.console']);
|
||||
assert.equal(CONSOLE_VERBS.includes('decision.resolve'), false);
|
||||
assert.ok(Object.isFrozen(CONSOLE_VERBS));
|
||||
});
|
||||
|
||||
test('bindConsole takes only the business human and a three-string owner subject', (t) => {
|
||||
const f = setup(t);
|
||||
const bind = (record) => () => f.broker.bindConsole(record);
|
||||
refusesSync(bind({ business: 'demo', human: 'someone', subject: SUBJECT }), 'human-required');
|
||||
refusesSync(bind({ business: 'demo', human: 'jason', subject: { ...SUBJECT, name: 'Jason' } }), 'human-required');
|
||||
refusesSync(bind({ business: 'demo', human: 'jason', subject: { provider: 'p', iss: 'i' } }), 'human-required');
|
||||
refusesSync(bind({ business: 'demo', human: 'jason', subject: { ...SUBJECT, sub: '' } }), 'human-required');
|
||||
refusesSync(bind({ business: 'demo', human: 'jason', subject: { ...SUBJECT, sub: 'x'.repeat(513) } }), 'human-required');
|
||||
refusesSync(bind({ business: 'demo', human: 'jason', subject: { ...SUBJECT, sub: 7 } }), 'human-required');
|
||||
refusesSync(bind({ business: 'demo', human: 'jason', subject: 'owner-1' }), 'human-required');
|
||||
assert.throws(bind({ business: 'demo', human: 'jason', subject: SUBJECT, via: 'cli' }));
|
||||
assert.throws(bind({ business: 'demo', human: 'jason' }));
|
||||
assert.throws(bind({ business: 'other', human: 'jason', subject: SUBJECT }));
|
||||
assert.deepEqual(f.broker.identity(f.caps.console), { business: 'demo', role: null, run: null, human: 'jason' });
|
||||
});
|
||||
|
||||
test('J1, Q188: only a console cap reaches the console verbs, and a console cap reaches nothing else', async (t) => {
|
||||
const f = setup(t);
|
||||
const d = await f.raise();
|
||||
const preview = f.call('console', 'decision.preview.console', { id: d.id });
|
||||
const args = { id: d.id, choice: 'yes', digest: preview.digest };
|
||||
// Agents, the cli human, the tester and the reader are refused before the verb runs.
|
||||
for (const who of ['chief', 'pm', 'human', 'tester', 'reader']) {
|
||||
refusesSync(() => f.call(who, 'decision.preview.console', { id: d.id }), 'human-required');
|
||||
refusesSync(() => f.call(who, 'decision.resolve.console', args), 'human-required');
|
||||
}
|
||||
// N4: the console cap answers nothing through decision.resolve, and reaches no other verb.
|
||||
for (const [verb, a] of [
|
||||
['decision.resolve', { id: d.id, choice: 'yes' }],
|
||||
['decision.seen', { id: d.id }],
|
||||
['decision.withdraw', { id: d.id }],
|
||||
['decision.raise', { action: 'credential.mint', question: 'q', options, recommendation: 'yes', blocking: false, grant: f.grant }],
|
||||
['inbox', {}],
|
||||
['message.send', { to: 'chief', body: 'hi' }],
|
||||
['role.claim', {}],
|
||||
])
|
||||
refusesSync(() => f.call('console', verb, a), 'human-required');
|
||||
assert.deepEqual(f.closes(d.id), []);
|
||||
assert.equal(f.enrolls.length, 0);
|
||||
});
|
||||
|
||||
test('preview: the two real answers, a grant summary and the digest, for an open grant request only', async (t) => {
|
||||
const f = setup(t);
|
||||
const d = await f.raise();
|
||||
const p = f.call('console', 'decision.preview.console', { id: d.id });
|
||||
assert.equal(p.id, d.id);
|
||||
assert.equal(p.business, 'demo');
|
||||
assert.match(p.question, /^Enroll web1\?/);
|
||||
assert.deepEqual(p.approve, { key: 'yes', text: 'Yes, enroll it' });
|
||||
assert.deepEqual(p.deny, { key: 'no', text: 'No' });
|
||||
assert.deepEqual(p.grant, { method: 'host-enroll', host: 'web1' });
|
||||
assert.match(p.digest, /^[a-f0-9]{64}$/);
|
||||
// Read twice, the digest is the same; a preview writes nothing.
|
||||
assert.equal(f.call('console', 'decision.preview.console', { id: d.id }).digest, p.digest);
|
||||
assert.deepEqual(f.closes(d.id), []);
|
||||
refusesSync(() => f.call('console', 'decision.preview.console', { id: d.id, choice: 'yes' }), 'invalid-request');
|
||||
refusesSync(() => f.call('console', 'decision.preview.console', { id: 'no-such-decision' }), 'decision-not-found');
|
||||
// The inbox row says the same, for the human and the reader. The agent-facing views do not.
|
||||
for (const who of ['human', 'reader']) {
|
||||
const row = f.call(who, 'inbox').find((r) => r.id === d.id);
|
||||
assert.deepEqual(row.console, { approve: p.approve, deny: p.deny, grant: p.grant, digest: p.digest });
|
||||
}
|
||||
});
|
||||
|
||||
test('J1, J2: a decision that is not an eligible grant request refuses both console verbs', async (t) => {
|
||||
const f = setup(t);
|
||||
const grant = { method: 'host', agent: 'pm', host: 'web1', commands: ['uptime'], rotateBy: '2099-01-01' };
|
||||
const ineligible = [
|
||||
grantDecision(f.store, { action: 'deploy', grant, close: null }),
|
||||
grantDecision(f.store, { route: 'pm', grant, close: null }),
|
||||
grantDecision(f.store, { grant: undefined, close: null }),
|
||||
];
|
||||
for (const id of ineligible) {
|
||||
refusesSync(() => f.call('console', 'decision.preview.console', { id }), 'decision-not-eligible');
|
||||
refusesSync(() => f.call('console', 'decision.resolve.console', { id, choice: 'yes', digest: '0'.repeat(64) }), 'decision-not-eligible');
|
||||
assert.equal(f.call('human', 'inbox').find((r) => r.id === id)?.console, undefined);
|
||||
}
|
||||
});
|
||||
|
||||
test('N2, J13: a Console approve records via console and the owner, before the executor starts, and the grant runs once', async (t) => {
|
||||
const f = setup(t);
|
||||
const d = await f.raise();
|
||||
const { digest } = f.call('console', 'decision.preview.console', { id: d.id });
|
||||
const r = f.call('console', 'decision.resolve.console', { id: d.id, choice: 'yes', digest });
|
||||
assert.deepEqual(r, { id: d.id, op: 'resolved', choice: 'yes', grant: 'started' });
|
||||
const [close] = f.closes(d.id);
|
||||
assert.deepEqual({ ...close, seq: undefined }, { seq: undefined, op: 'resolved', by: 'jason', choice: 'yes', via: 'console' });
|
||||
const input = f.events().filter((e) => e.event === 'human.input' && e.about === d.id);
|
||||
assert.equal(input.length, 1);
|
||||
assert.deepEqual(
|
||||
{ ...input[0], seq: undefined },
|
||||
{ seq: undefined, kind: 'answer', actor_role: null, actor_run: null, about: d.id, decision: d.id, op: 'resolved', choice: 'yes', via: 'console', subject: SUBJECT, decisionSeq: close.seq, event: 'human.input' },
|
||||
);
|
||||
await f.settle(d.id);
|
||||
assert.equal(f.enrolls.length, 1);
|
||||
const spend = f.grantEvents(d.id).find((e) => e.operation === 'grant.host-enroll');
|
||||
assert.ok(spend && input[0].seq < spend.seq, 'the human.input precedes the executor spend');
|
||||
assert.ok(f.grantEvents(d.id).some((e) => e.action === 'grant.host.enrolled'));
|
||||
// N3: the close notice to the raiser comes from the human through the Console.
|
||||
const notices = f.store.all("SELECT from_run, body FROM messages WHERE business='demo' AND decision=? AND class='DECISION' AND from_role='human'", d.id);
|
||||
assert.equal(notices.length, 1);
|
||||
const [notice] = notices;
|
||||
assert.equal(notice.from_run, 'human-console');
|
||||
assert.match(notice.body, /resolved by jason: yes \(Yes, enroll it\)/);
|
||||
// A second answer of either kind finds it closed, and nothing starts again.
|
||||
refusesSync(() => f.call('console', 'decision.resolve.console', { id: d.id, choice: 'yes', digest }), 'decision-closed');
|
||||
refusesSync(() => f.call('console', 'decision.preview.console', { id: d.id }), 'decision-closed');
|
||||
refusesSync(() => f.call('human', 'decision.resolve', { id: d.id, choice: 'yes' }), 'decision-closed');
|
||||
await sleep(50);
|
||||
assert.equal(f.enrolls.length, 1);
|
||||
assert.equal(f.closes(d.id).length, 1);
|
||||
});
|
||||
|
||||
test('J15: a Console deny closes with the other key and starts nothing', async (t) => {
|
||||
const f = setup(t);
|
||||
const d = await f.raise();
|
||||
const { digest } = f.call('console', 'decision.preview.console', { id: d.id });
|
||||
const r = f.call('console', 'decision.resolve.console', { id: d.id, choice: 'no', digest });
|
||||
assert.deepEqual(r, { id: d.id, op: 'resolved', choice: 'no' });
|
||||
assert.deepEqual(f.closes(d.id).map((c) => [c.op, c.choice, c.via]), [['resolved', 'no', 'console']]);
|
||||
await sleep(100);
|
||||
assert.equal(f.enrolls.length, 0);
|
||||
assert.deepEqual(f.grantEvents(d.id), []);
|
||||
assert.deepEqual(f.make().reconcileGrants(), []);
|
||||
});
|
||||
|
||||
test('J2: approve and deny come from approvalChoice and the options, not a fixed yes and no', async (t) => {
|
||||
const f = setup(t);
|
||||
// Deny listed first, so a build that takes options[0] as approve fails too.
|
||||
const keyed = { options: [{ key: 'stop', text: 'Stop' }, { key: 'go', text: 'Go ahead' }], approvalChoice: 'go', recommendation: 'go' };
|
||||
const denied = await f.raise({ ...keyed, question: 'Enroll web1? (deny)' });
|
||||
const p = f.call('console', 'decision.preview.console', { id: denied.id });
|
||||
assert.deepEqual([p.approve, p.deny], [{ key: 'go', text: 'Go ahead' }, { key: 'stop', text: 'Stop' }]);
|
||||
for (const choice of ['yes', 'no']) refusesSync(() => f.call('console', 'decision.resolve.console', { id: denied.id, choice, digest: p.digest }), 'decision-stale');
|
||||
assert.deepEqual(f.call('console', 'decision.resolve.console', { id: denied.id, choice: 'stop', digest: p.digest }), { id: denied.id, op: 'resolved', choice: 'stop' });
|
||||
await sleep(100);
|
||||
assert.equal(f.enrolls.length, 0);
|
||||
const approved = await f.raise({ ...keyed, question: 'Enroll web1? (approve)' });
|
||||
const { digest } = f.call('console', 'decision.preview.console', { id: approved.id });
|
||||
assert.deepEqual(f.call('console', 'decision.resolve.console', { id: approved.id, choice: 'go', digest }), { id: approved.id, op: 'resolved', choice: 'go', grant: 'started' });
|
||||
await f.settle(approved.id);
|
||||
assert.equal(f.enrolls.length, 1);
|
||||
});
|
||||
|
||||
test('J11: a stale digest or a key outside the two refuses decision-stale and writes nothing', async (t) => {
|
||||
const f = setup(t);
|
||||
const d = await f.raise();
|
||||
const { digest } = f.call('console', 'decision.preview.console', { id: d.id });
|
||||
refusesSync(() => f.call('console', 'decision.resolve.console', { id: d.id, choice: 'yes', digest: 'f'.repeat(64) }), 'decision-stale');
|
||||
refusesSync(() => f.call('console', 'decision.resolve.console', { id: d.id, choice: 'maybe', digest }), 'decision-stale');
|
||||
refusesSync(() => f.call('console', 'decision.resolve.console', { id: d.id, choice: 'yes' }), 'invalid-request');
|
||||
refusesSync(() => f.call('console', 'decision.resolve.console', { id: d.id, choice: 'yes', digest, note: 'x' }), 'invalid-request');
|
||||
// Another decision's digest does not answer this one.
|
||||
const other = await f.raise({ question: 'Enroll web1 again?' });
|
||||
const od = f.call('console', 'decision.preview.console', { id: other.id }).digest;
|
||||
assert.notEqual(od, digest);
|
||||
refusesSync(() => f.call('console', 'decision.resolve.console', { id: d.id, choice: 'yes', digest: od }), 'decision-stale');
|
||||
assert.deepEqual(f.closes(d.id), []);
|
||||
assert.equal(f.events().filter((e) => e.event === 'human.input').length, 0);
|
||||
// A refusal is recorded, as for every verb.
|
||||
assert.ok(f.events().some((e) => e.event === 'action.refused' && e.code === 'decision-stale'));
|
||||
// The decision closed by the cli meanwhile: the console answer finds it closed.
|
||||
f.call('human', 'decision.resolve', { id: d.id, choice: 'no' });
|
||||
refusesSync(() => f.call('console', 'decision.resolve.console', { id: d.id, choice: 'yes', digest }), 'decision-closed');
|
||||
});
|
||||
|
||||
test('J14: a via console close with no matching human.input approves nothing', (t) => {
|
||||
const f = setup(t);
|
||||
const grant = { method: 'host-enroll', host: 'web2', address: '192.0.2.11', port: 22, user: 'jarvis', sudo: true, fingerprints: [] };
|
||||
const cli = grantDecision(f.store, { grant });
|
||||
const bare = grantDecision(f.store, { grant: { ...grant, host: 'web3' }, close: { op: 'resolved', by: 'jason', choice: 'yes', via: 'console' } });
|
||||
const wrong = grantDecision(f.store, { grant: { ...grant, host: 'web4' }, close: { op: 'resolved', by: 'jason', choice: 'yes', via: 'console' } });
|
||||
const good = grantDecision(f.store, { grant: { ...grant, host: 'web5' }, close: { op: 'resolved', by: 'jason', choice: 'yes', via: 'console' } });
|
||||
const seqOf = (id) => f.store.get('SELECT seq FROM decision_events WHERE decision=?', id).seq;
|
||||
const input = (id, body, role = null) =>
|
||||
f.store.run(
|
||||
"INSERT INTO events(id,at,business,kind,actor_role,actor_run,subject,body) VALUES(?,?,?,'human.input',?,?,?,?)",
|
||||
'e-' + id + '-' + Math.random(), '2026-10-22T00:00:00.000Z', 'demo', role, role && role + '-run', id, JSON.stringify(body),
|
||||
);
|
||||
const answer = (id) => ({ kind: 'answer', decision: id, op: 'resolved', choice: 'yes', via: 'console', subject: SUBJECT, decisionSeq: seqOf(id) });
|
||||
// `bare` has no human.input at all. `wrong` has records that each break one part: another seq, choice, empty subject, an agent actor.
|
||||
input(wrong, { ...answer(wrong), decisionSeq: seqOf(wrong) + 1000 });
|
||||
input(wrong, { ...answer(wrong), choice: 'no' });
|
||||
input(wrong, { ...answer(wrong), subject: { ...SUBJECT, sub: '' } });
|
||||
input(wrong, answer(wrong), 'chief');
|
||||
input(good, answer(good));
|
||||
// reconcileGrants ends every approved, unspent host-enroll: exactly the cli one and the good console one.
|
||||
assert.deepEqual(f.make().reconcileGrants().sort(), [cli, good].sort());
|
||||
assert.equal(f.enrolls.length, 0);
|
||||
assert.equal(f.store.get("SELECT count(*) AS n FROM events WHERE business='demo' AND actor_run='grant' AND json_extract(body,'$.decision') IN (?,?)", bare, wrong).n, 0);
|
||||
});
|
||||
|
||||
test('recordEvent keeps human.input reserved, so no agent forges a console answer', async (t) => {
|
||||
const f = setup(t);
|
||||
const d = await f.raise();
|
||||
const forged = { kind: 'human.input', subject: d.id, body: { kind: 'answer', decision: d.id, op: 'resolved', choice: 'yes', via: 'console', subject: SUBJECT, decisionSeq: 1 } };
|
||||
for (const who of ['chief', 'pm']) refusesSync(() => f.broker.recordEvent(f.caps[who], forged), 'reserved-event');
|
||||
refusesSync(() => f.broker.recordEvent(f.caps.console, forged), 'agent-required');
|
||||
assert.equal(f.events().filter((e) => e.event === 'human.input').length, 0);
|
||||
});
|
||||
|
||||
// J7: the socket transport binds a console proof's cap for its one call only. The reply and a refusal
|
||||
// both release it, so the owner cap can't outlive the request that proved it.
|
||||
test('J7: a console proof over the socket binds a cap for its one call and the reply releases it', async (t) => {
|
||||
const f = setup(t);
|
||||
const d = await f.raise();
|
||||
const dir = mkdtempSync(join(tmpdir(), 'c252s-'));
|
||||
const bound = [];
|
||||
const server = await serve({
|
||||
broker: f.broker,
|
||||
path: join(dir, 'bus.sock'),
|
||||
authenticateConsole: () => (bound.push(f.broker.bindConsole({ business: 'demo', human: 'jason', subject: SUBJECT })), bound.at(-1)),
|
||||
});
|
||||
t.after(async () => {
|
||||
await server.close();
|
||||
rmSync(dir, { recursive: true, force: true });
|
||||
});
|
||||
const client = new Client({ path: join(dir, 'bus.sock'), console: { fixture: true } });
|
||||
const preview = await client.call('decision.preview.console', { id: d.id });
|
||||
assert.equal(preview.id, d.id);
|
||||
await assert.rejects(client.call('decision.preview.console', { id: 'nope' }), { code: 'decision-not-found' });
|
||||
assert.equal(bound.length, 2);
|
||||
for (const cap of bound) refusesSync(() => f.broker.identity(cap), 'unauthenticated');
|
||||
});
|
||||
@@ -46,3 +46,52 @@ test('human leaf identity is reread after walking the parents',()=>{
|
||||
c.readProcess=pid=>{const p=read(pid);if(pid===50&&n++>0)p.startTime='101';return p;};
|
||||
assert.throws(()=>verifyPrincipal({human:proof},c),/human-required/);
|
||||
});
|
||||
|
||||
// Row 252 (#1753, design section 2, J3-J5): the Console owner. The same-tree console-cli wrapper with
|
||||
// its own nonce, a direct same-tree `serve` parent, the subject from the wrapper's spawn environment,
|
||||
// and that subject one of the configured owners (N1).
|
||||
const owner={provider:'fake-oidc',iss:'https://idp.test',sub:'owner-1'};
|
||||
function consoleContext() {
|
||||
const c=context('user');c.paths={...paths,consoleCli:'/tree/console-cli.mjs'};c.consoleOwners=[{provider:'other',iss:'https://idp.test',sub:'owner-2'},owner];
|
||||
Object.assign(c.table.get(50),{argv:['node','/tree/console-cli.mjs'],env:{MOSAIC_BUS_CONSOLE_NONCE:nonce,MOSAIC_BUS_CONSOLE_BUSINESS:'demo',MOSAIC_BUS_CONSOLE_PROVIDER:owner.provider,MOSAIC_BUS_CONSOLE_ISS:owner.iss,MOSAIC_BUS_CONSOLE_SUB:owner.sub}});
|
||||
return c;
|
||||
}
|
||||
const consoleProof={...proof,...owner};
|
||||
test('console requires its own wrapper, nonce and serve parent, and a configured owner from the spawn env',()=>{
|
||||
assert.deepEqual(verifyPrincipal({console:consoleProof},consoleContext()),{kind:'console',business:'demo',id:'owner',via:'console',subject:owner});
|
||||
// J3: the subject is the spawn's, never the body's alone, and must be a configured owner.
|
||||
for(const change of [{sub:'owner-2'},{iss:'https://evil.test'},{provider:'other'}])
|
||||
assert.throws(()=>verifyPrincipal({console:{...consoleProof,...change}},consoleContext()),/human-required/);
|
||||
const unlisted=consoleContext();unlisted.consoleOwners=[];
|
||||
assert.throws(()=>verifyPrincipal({console:consoleProof},unlisted),/human-required/);
|
||||
for(const extra of [{name:'Jason'},{human:'owner'},{user:'owner'},{sub:''},{sub:'x'.repeat(513)}])
|
||||
assert.throws(()=>verifyPrincipal({console:{...consoleProof,...extra}},consoleContext()),/human-required/);
|
||||
// J4: the parent is the same-tree serve, direct, and not an agent.
|
||||
for(const change of [{argv:['bash']},{argv:['node','/other/console.mjs','serve']},{argv:['node',paths.console,'other']},{env:{CODEX_THREAD_ID:'agent'}},{uid:uid+1}]) {
|
||||
const c=consoleContext();Object.assign(c.table.get(40),change);
|
||||
assert.throws(()=>verifyPrincipal({console:consoleProof},c),/human-required/);
|
||||
}
|
||||
const launched=consoleContext();launched.launches=[{pid:40,startTime:'90'}];
|
||||
assert.throws(()=>verifyPrincipal({console:consoleProof},launched),/human-required/);
|
||||
// J5: another nonce namespace, or the wrapper path of another kind, refuses.
|
||||
for(const env of [{MOSAIC_BUS_CLI_NONCE:nonce},{MOSAIC_BUS_USER_NONCE:nonce}]) {
|
||||
const c=consoleContext();const t=c.table.get(50);t.env={...t.env,...env};delete t.env.MOSAIC_BUS_CONSOLE_NONCE;
|
||||
assert.throws(()=>verifyPrincipal({console:consoleProof},c),/human-required/);
|
||||
}
|
||||
for(const argv of [['node',paths.human],['node',paths.user],['node','/other/console-cli.mjs']]) {
|
||||
const c=consoleContext();c.table.get(50).argv=argv;
|
||||
assert.throws(()=>verifyPrincipal({console:consoleProof},c),/human-required/);
|
||||
}
|
||||
// The Console's own nonce does not answer as the cli human or the user.
|
||||
assert.throws(()=>verifyPrincipal({human:proof},consoleContext()),/human-required/);
|
||||
assert.throws(()=>verifyPrincipal({user:{...proof,user:'owner'}},consoleContext()),/human-required/);
|
||||
// Each piece is read again after the walk: a parent or a spawn subject that changed refuses.
|
||||
for(const [pid,mutate] of [[40,p=>{p.startTime='91';}],[50,p=>{p.env={...p.env,MOSAIC_BUS_CONSOLE_SUB:'owner-2'};}],[50,p=>{p.ppid=41;}]]) {
|
||||
const c=consoleContext(),read=c.readProcess;let n=0;
|
||||
// The last read of each pid is verifyConsole's own reread: 40 is read 3 times, 50 is read 4 times.
|
||||
c.readProcess=x=>{const p=read(x);if(x===pid&&n++===(pid===40?2:3))mutate(p);return p;};
|
||||
assert.throws(()=>verifyPrincipal({console:consoleProof},c),/human-required/);
|
||||
}
|
||||
for(const peer of [{pid:51,uid,gid:uid},{pid:50,uid:uid+1,gid:uid}])assert.throws(()=>verifyPrincipal({console:consoleProof},{...consoleContext(),peer}),/human-required/);
|
||||
assert.throws(()=>verifyPrincipal({console:consoleProof,human:proof},consoleContext()),/invalid-envelope/);
|
||||
});
|
||||
@@ -45,7 +45,7 @@ test('requirements returns the committed list to a holding role session, and no
|
||||
const pm = agent('pm');
|
||||
const list = call(b, pm, 'requirements');
|
||||
assert.deepEqual(list, loadRequirements());
|
||||
assert.equal(list.requirements.length, 85);
|
||||
assert.equal(list.requirements.length, 87);
|
||||
assert.deepEqual(call(b, agent('coder'), 'requirements'), list);
|
||||
assert.throws(() => call(b, human, 'requirements'), /agent-required/);
|
||||
assert.throws(() => call(b, reader, 'requirements'), /read-only/);
|
||||
|
||||
@@ -115,6 +115,9 @@ function accessFor(system, env, warn) {
|
||||
return { file, context };
|
||||
}
|
||||
|
||||
export const consoleOwners = (sso) =>
|
||||
sso.providers.flatMap((p) => p.subjects.map((s) => ({ provider: p.id, iss: p.issuer, sub: s.sub })));
|
||||
|
||||
// The `{op: 'boot'}` config for packages/bus/src/process.mjs, for one
|
||||
// business. The host holds a reader capability for the notifier and binds
|
||||
// launches later through bindLaunch, so `launches` starts empty.
|
||||
@@ -135,6 +138,9 @@ export function bootConfig({ system, businessId, env = process.env, warn = () =>
|
||||
if (tracker) config.trackers = { [b.id]: tracker };
|
||||
const access = accessFor(system, env, warn);
|
||||
if (access) config.access = access;
|
||||
// Row 252 (#1753, Webby N1): every console.sso subject is an owner, by provider id, issuer and sub.
|
||||
// The loader checked console.sso; no new config field names owners.
|
||||
if (system.console?.sso) config.consoleOwners = consoleOwners(system.console.sso);
|
||||
return config;
|
||||
});
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import { accessContextFor } from "../src/access.mjs";
|
||||
import { bootConfig, loadSystem } from "../src/config.mjs";
|
||||
import { fixture, tmp } from "./helpers.mjs";
|
||||
|
||||
const SSO = { sso: { providers: [{ id: "authentik", subjects: [{ sub: "jason-sub" }] }] } };
|
||||
const SSO = { sso: { providers: [{ id: "authentik", issuer: "https://idp.test", subjects: [{ sub: "jason-sub" }] }] } };
|
||||
const FEDERATION = { self: "hub", peers: [{ id: "factory", origin: "https://factory.example.test", label: "Software factory" }] };
|
||||
const DOC = {
|
||||
accessVersion: 1,
|
||||
|
||||
@@ -69,3 +69,19 @@ test("an unknown business and a broken system config refuse with exit 3", (t) =>
|
||||
assert.throws(() => bootConfig({ system: loadSystem({ env: f.env }), businessId: "nope", env: f.env }), (e) => e.exitCode === 3);
|
||||
assert.throws(() => loadSystem({ env: { ...f.env, MOSAIC_CONFIG: join(f.dataRoot, "missing.json") } }), (e) => e.exitCode === 3);
|
||||
});
|
||||
|
||||
test("Row 252 (Webby N1): every console.sso subject reaches the boot as a console owner, and no sso means no consoleOwners key", (t) => {
|
||||
const f = fixture(tmp(t));
|
||||
const system = loadSystem({ env: f.env });
|
||||
assert.equal("consoleOwners" in bootConfig({ system, businessId: "acme", env: f.env }), false);
|
||||
const sso = { providers: [
|
||||
{ id: "authentik", issuer: "https://auth.example/app/", subjects: [{ sub: "jason-sub" }, { sub: "second-sub" }] },
|
||||
{ id: "other", issuer: "https://idp.example", subjects: [{ sub: "jason-sub" }] },
|
||||
] };
|
||||
const boot = bootConfig({ system: { ...system, console: { sso } }, businessId: "acme", env: f.env });
|
||||
assert.deepEqual(boot.consoleOwners, [
|
||||
{ provider: "authentik", iss: "https://auth.example/app/", sub: "jason-sub" },
|
||||
{ provider: "authentik", iss: "https://auth.example/app/", sub: "second-sub" },
|
||||
{ provider: "other", iss: "https://idp.example", sub: "jason-sub" },
|
||||
]);
|
||||
});
|
||||
+17
-10
@@ -104,21 +104,28 @@ in an extension other than `.md`, in any case, embeds an attachment, and it is n
|
||||
a dot and up to 8 letters and digits, at least one a letter. Any other unresolved embed is R4, and so is
|
||||
an unresolved front matter value written as an embed (C2-01b N3, sage-1900).
|
||||
|
||||
## renderItems
|
||||
## renderReply
|
||||
|
||||
`renderItems(body, { scopeOf, changed })` turns a reply body into the plain text both channels show.
|
||||
It is pure. Item kinds are `fact`, `finding`, `correction` (with `from` and `to`), `question` and
|
||||
`idea`. Each cite is a path with commit, line range and quote, or a url with a quote.
|
||||
`renderReply(body, { check, changed, name })` turns a stored reply into what both channels show. It
|
||||
replaces C2-01's items renderer and is pure. A body is free text, or the design 5.2 object
|
||||
`{ "text", "citations" }` with library cites `{ path, commit, lines, quote, as? }` and web cites
|
||||
`{ url, quote }`. Any other body, a JSON object with another key or a bad cite included, renders as
|
||||
free text: the whole body, with no citations.
|
||||
|
||||
`check` is the stored check result (C2-06), `{ citations: [{ scope, agent }] }` in body order. A path
|
||||
cite's badge (`canon`, `playground` or `supporting`) and its agent-written label come only from it. A
|
||||
url cite is always `web`, and is a link only when its scheme is `https`. `changed({ path, commit }, i)`
|
||||
says whether the file's last commit is newer than the cited one. `plain` is the rendering as text:
|
||||
|
||||
```
|
||||
1. Correction: Chapter 1 says grey.
|
||||
From: "green eyes"
|
||||
To: "grey eyes"
|
||||
[canon] Book One/Characters/Mara Vell.md:9 @bbbbbbb "green eyes" (changed since)
|
||||
Mara's eyes are grey in chapter 3.
|
||||
[canon] Book One/Chapters/Chapter 03.md:41 @aaaaaaa "her grey eyes"
|
||||
[supporting] Notes/Eyes.md:9-10 @aaaaaaa "green eyes" (agent-written: acme/scribe) (changed since)
|
||||
[web] https://example.invalid/tides "spring tides"
|
||||
```
|
||||
|
||||
A body of `{ "items": [], "notice": ... }` gives `No cited answer`, `No answer` or `The turn failed`.
|
||||
Any other shape gives the fixed line `This reply could not be shown.` and none of the body's text.
|
||||
The broker's write notice, `{ "notice": "library-write", op, path, commit }`, gives the line
|
||||
`<name> wrote <path> @<commit>` or `<name> deleted <path> @<commit>`.
|
||||
|
||||
## Survey
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ export { checkMapping, TYPES } from './mapping.mjs';
|
||||
export { classify } from './scope.mjs';
|
||||
export { extractLinks, parseWikilink, resolver, formOf, isAttachment } from './links.mjs';
|
||||
export { readLibrary, listTree, readTexts, parseFile, parseFrontMatter, headCommit, MAX_BLOB, LINK_FIELDS } from './reader.mjs';
|
||||
export { renderItems, KINDS, NOTICES, UNREADABLE } from './render.mjs';
|
||||
export { renderReply, SCOPES, NOTICE_OPS } from './render.mjs';
|
||||
export { survey, formatSurvey, surveyMain } from './survey.mjs';
|
||||
export { SYNC_STATE_FILE, mirrorPath, ensureMirror, withLibraryLock, servedCommit, readSyncState, libraryStatus, readLibraryFile } from './mirror.mjs';
|
||||
export { syncCommand, sync, ASKPASS, SLOT, SYNC_INTERVAL_MS } from './sync.mjs';
|
||||
@@ -1,59 +1,72 @@
|
||||
// renderItems(body): how a stored cited reply looks (design 7.4), shared by the Console chat (C2-10b)
|
||||
// and the Discord relay (C2-18). Pure: no git, no clock. The caller passes what it knows about cites.
|
||||
// The guard (C2-06) checks limits before a reply is stored. This only refuses to show a body that
|
||||
// doesn't have the reply shape, and then it shows a fixed line, never the body's text.
|
||||
export const KINDS = Object.freeze({ fact: 'Fact', finding: 'Finding', correction: 'Correction', question: 'Question', idea: 'Idea' });
|
||||
export const NOTICES = Object.freeze({ 'no-cited-answer': 'No cited answer', 'no-answer': 'No answer', 'turn-failed': 'The turn failed' });
|
||||
export const UNREADABLE = 'This reply could not be shown.';
|
||||
// renderReply(body): how a stored reply looks (design 7.4), shared by the Console chat (C2-10b) and the
|
||||
// Discord relay (C2-18). It replaces C2-01's items renderer. Pure: no git, no clock, no DOM. The caller
|
||||
// passes what only the bus knows: the stored check result (C2-06) and whether a cited file changed.
|
||||
// The guard checks a reply before it is stored. This only decides how a body reads; it trusts nothing
|
||||
// in the body for a scope or the agent-written label.
|
||||
export const SCOPES = Object.freeze(['canon', 'playground', 'supporting', 'web']);
|
||||
export const NOTICE_OPS = Object.freeze({ write: 'wrote', delete: 'deleted' });
|
||||
const SHA = /^[0-9a-f]{40}$/;
|
||||
|
||||
const plain = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
||||
const line = n => Number.isSafeInteger(n) && n > 0;
|
||||
function cite(value, { scopeOf, changed }) {
|
||||
if (!plain(value) || typeof value.quote !== 'string') return null;
|
||||
if (Object.hasOwn(value, 'url')) {
|
||||
if (typeof value.url !== 'string' || Object.hasOwn(value, 'path')) return null;
|
||||
return { badge: 'web', url: value.url, ref: value.url, quote: value.quote, changed: false };
|
||||
}
|
||||
const { path, commit, lines } = value;
|
||||
if (typeof path !== 'string' || !SHA.test(commit ?? '') || !Array.isArray(lines) || lines.length !== 2
|
||||
|| !line(lines[0]) || !line(lines[1]) || lines[1] < lines[0]) return null;
|
||||
const badge = scopeOf?.(path);
|
||||
const ref = `${path}:${lines[0] === lines[1] ? lines[0] : `${lines[0]}-${lines[1]}`} @${commit.slice(0, 7)}`;
|
||||
return { badge: badge === 'canon' || badge === 'playground' ? badge : null, path, commit, lines: [...lines], ref,
|
||||
quote: value.quote, changed: changed?.({ path, commit }) === true };
|
||||
}
|
||||
const only = (value, keys) => Object.keys(value).every(k => keys.includes(k));
|
||||
const quoted = text => JSON.stringify(text);
|
||||
// webby-0041 N5: only an https url is ever a link. Anything else, javascript: and http: included, is text.
|
||||
function https(url) {
|
||||
try { return new URL(url).protocol === 'https:' ? url : null; } catch { return null; }
|
||||
}
|
||||
|
||||
// body: the stored message body (a JSON string or the parsed object).
|
||||
// options.scopeOf(path) -> 'canon' | 'playground' | undefined, for the scope badge.
|
||||
// options.changed({path, commit}) -> true when the file's last commit is newer than the cited one.
|
||||
// Returns { kind: 'items', items, text } | { kind: 'notice', notice, text } | { kind: 'unreadable', text }.
|
||||
export function renderItems(body, options = {}) {
|
||||
const unreadable = { kind: 'unreadable', text: UNREADABLE };
|
||||
// The design 5.2 cite shapes. null when the value isn't one, and then the body is not a cited reply.
|
||||
function cite(value) {
|
||||
if (!plain(value) || typeof value.quote !== 'string') return null;
|
||||
if (Object.hasOwn(value, 'url')) return typeof value.url === 'string' && only(value, ['url', 'quote']) ? { url: value.url, quote: value.quote } : null;
|
||||
const { path, commit, lines } = value;
|
||||
if (!only(value, ['path', 'commit', 'lines', 'quote', 'as']) || typeof path !== 'string' || !SHA.test(commit ?? '')
|
||||
|| !Array.isArray(lines) || lines.length !== 2 || !line(lines[0]) || !line(lines[1]) || lines[1] < lines[0]
|
||||
|| (Object.hasOwn(value, 'as') && value.as !== 'canon')) return null;
|
||||
return { path, commit, lines: [...lines], quote: value.quote, canon: value.as === 'canon' };
|
||||
}
|
||||
|
||||
// check: the stored entry for this cite, { scope, agent }, or undefined. A path cite takes its badge only
|
||||
// from it; a url cite is web by its shape. agent is the Mosaic-Agent trailer value, never the body's.
|
||||
function shown(c, check, changed, i) {
|
||||
if (c.url !== undefined) return { badge: 'web', url: c.url, link: https(c.url), ref: c.url, quote: c.quote, agent: null, changed: false };
|
||||
const scope = plain(check) && SCOPES.includes(check.scope) && check.scope !== 'web' ? check.scope : null;
|
||||
const agent = plain(check) && typeof check.agent === 'string' && check.agent !== '' ? check.agent : null;
|
||||
const ref = `${c.path}:${c.lines[0] === c.lines[1] ? c.lines[0] : `${c.lines[0]}-${c.lines[1]}`} @${c.commit.slice(0, 7)}`;
|
||||
return { badge: scope, path: c.path, commit: c.commit, lines: c.lines, ref, quote: c.quote, canon: c.canon, agent,
|
||||
changed: changed?.({ path: c.path, commit: c.commit }, i) === true };
|
||||
}
|
||||
|
||||
// The broker's write notice (design, writes): {"notice": "library-write", op, path, commit}, no agent text.
|
||||
function notice(value, name) {
|
||||
if (!plain(value) || value.notice !== 'library-write' || !only(value, ['notice', 'op', 'path', 'commit'])
|
||||
|| !Object.hasOwn(NOTICE_OPS, value.op) || typeof value.path !== 'string' || !SHA.test(value.commit ?? '')) return null;
|
||||
const who = typeof name === 'string' && name !== '' ? name : 'An agent';
|
||||
return { kind: 'notice', op: value.op, path: value.path, commit: value.commit,
|
||||
text: `${who} ${NOTICE_OPS[value.op]} ${value.path} @${value.commit.slice(0, 7)}` };
|
||||
}
|
||||
|
||||
// body: the stored message body, a string (or an already parsed object).
|
||||
// options.check: the stored check result, { citations: [{ scope, agent }] } in body order, or null.
|
||||
// options.changed({path, commit}, index) -> true when the file's last commit is newer than the cited one.
|
||||
// options.name: the sender's name for a notice line.
|
||||
// Returns { kind: 'text', text, plain } | { kind: 'reply', text, citations, plain } | { kind: 'notice', op, path, commit, text, plain }.
|
||||
// plain is the whole rendering as text, for a channel that shows no markup.
|
||||
export function renderReply(body, options = {}) {
|
||||
const raw = typeof body === 'string' ? body : JSON.stringify(body) ?? String(body);
|
||||
let value = body;
|
||||
if (typeof body === 'string') { try { value = JSON.parse(body); } catch { return unreadable; } }
|
||||
if (!plain(value) || !Array.isArray(value.items)) return unreadable;
|
||||
const keys = Object.keys(value);
|
||||
if (value.items.length === 0) {
|
||||
if (keys.length !== 2 || !Object.hasOwn(NOTICES, value.notice)) return unreadable;
|
||||
return { kind: 'notice', notice: value.notice, text: NOTICES[value.notice] };
|
||||
}
|
||||
if (keys.length !== 1) return unreadable;
|
||||
const items = [];
|
||||
for (const item of value.items) {
|
||||
if (!plain(item) || !Object.hasOwn(KINDS, item.kind) || typeof item.text !== 'string' || !Array.isArray(item.cites)) return unreadable;
|
||||
const correction = item.kind === 'correction';
|
||||
if (correction && (typeof item.from !== 'string' || typeof item.to !== 'string')) return unreadable;
|
||||
const cites = item.cites.map(c => cite(c, options));
|
||||
if (cites.some(c => c === null)) return unreadable;
|
||||
items.push({ kind: item.kind, label: KINDS[item.kind], text: item.text,
|
||||
...(correction ? { from: item.from, to: item.to } : {}), cites });
|
||||
}
|
||||
const text = items.map((item, i) => [
|
||||
`${i + 1}. ${item.label}: ${item.text}`,
|
||||
...(item.kind === 'correction' ? [` From: ${quoted(item.from)}`, ` To: ${quoted(item.to)}`] : []),
|
||||
...item.cites.map(c => ` ${c.badge ? `[${c.badge}] ` : ''}${c.ref} ${quoted(c.quote)}${c.changed ? ' (changed since)' : ''}`),
|
||||
].join('\n')).join('\n');
|
||||
return { kind: 'items', items, text };
|
||||
if (typeof body === 'string') { try { value = JSON.parse(body); } catch { value = undefined; } }
|
||||
const n = notice(value, options.name);
|
||||
if (n) return { ...n, plain: n.text };
|
||||
// Design 5.2: a JSON object must be {text, citations} and nothing else. Any other body is a reply whose
|
||||
// text is the whole body and which carries no citation.
|
||||
const free = { kind: 'text', text: raw, plain: raw };
|
||||
if (!plain(value) || typeof value.text !== 'string' || !Array.isArray(value.citations) || !only(value, ['text', 'citations'])) return free;
|
||||
const cites = value.citations.map(cite);
|
||||
if (cites.some(c => c === null)) return free;
|
||||
const checks = plain(options.check) && Array.isArray(options.check.citations) ? options.check.citations : [];
|
||||
const citations = cites.map((c, i) => shown(c, checks[i], options.changed, i));
|
||||
const lines = citations.map(c => ` ${c.badge ? `[${c.badge}] ` : ''}${c.ref} ${quoted(c.quote)}${c.agent ? ` (agent-written: ${c.agent})` : ''}${c.changed ? ' (changed since)' : ''}`);
|
||||
return { kind: 'reply', text: value.text, citations, plain: [value.text, ...lines].join('\n') };
|
||||
}
|
||||
@@ -1,80 +1,94 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { renderItems, UNREADABLE } from '../src/index.mjs';
|
||||
import { renderReply } from '../src/index.mjs';
|
||||
|
||||
// Row 225 (C2-10b): renderReply replaces renderItems (design 7.4, the reply schema of 5.2).
|
||||
const A = 'a'.repeat(40), B = 'b'.repeat(40);
|
||||
const cite = (path, lines, quote, commit = A) => ({ path, commit, lines, quote });
|
||||
const options = {
|
||||
scopeOf: path => path.includes('/Playground/') ? 'playground' : path.endsWith('.md') ? 'canon' : undefined,
|
||||
changed: ({ path, commit }) => path === 'Book One/Characters/Mara Vell.md' && commit === A,
|
||||
};
|
||||
const render = items => renderItems(JSON.stringify({ items }), options);
|
||||
const cite = (path, lines, quote, commit = A, extra = {}) => ({ path, commit, lines, quote, ...extra });
|
||||
const web = (url, quote = 'spring tides') => ({ url, quote });
|
||||
const reply = (text, citations) => JSON.stringify({ text, citations });
|
||||
const CITED = reply("Mara's eyes are grey in chapter 3.", [
|
||||
cite('Book One/Chapters/Chapter 03.md', [41, 41], 'her grey eyes', A, { as: 'canon' }),
|
||||
cite('Book One/Playground/What If.md', [5, 6], 'a storm', B),
|
||||
cite('Notes/Eyes.md', [9, 10], 'green eyes'),
|
||||
web('https://example.invalid/tides'),
|
||||
]);
|
||||
const CHECK = { citations: [{ scope: 'canon', agent: null }, { scope: 'playground', agent: null },
|
||||
{ scope: 'supporting', agent: 'acme/scribe' }, { scope: 'web', agent: null }] };
|
||||
const changed = ({ path, commit }) => path === 'Notes/Eyes.md' && commit === A;
|
||||
|
||||
// One snapshot per item kind: the plain text both channels show.
|
||||
const SNAPSHOTS = {
|
||||
fact: [{ kind: 'fact', text: 'Tomas is the ferryman.', cites: [cite('Book One/Characters/Tomas.md', [3, 3], 'the ferryman', B)] }],
|
||||
finding: [{ kind: 'finding', text: 'Eye colour differs.', cites: [cite('Book One/Chapters/Chapter 01.md', [41, 41], 'her grey eyes'),
|
||||
cite('Book One/Characters/Mara Vell.md', [9, 10], 'green eyes')] }],
|
||||
correction: [{ kind: 'correction', text: 'Chapter 1 says grey.', from: 'green eyes', to: 'grey eyes',
|
||||
cites: [cite('Book One/Characters/Mara Vell.md', [9, 9], 'green eyes', B)] }],
|
||||
question: [{ kind: 'question', text: 'Is the harbor north of the town?', cites: [cite('Book One/Places/Harbor Town.md', [2, 4], 'the harbor', B)] }],
|
||||
idea: [{ kind: 'idea', text: 'A storm could close the harbor.', cites: [cite('Book One/Playground/What If.md', [5, 5], 'a storm', B),
|
||||
{ url: 'https://example.invalid/tides', quote: 'spring tides' }] }],
|
||||
};
|
||||
const EXPECTED = {
|
||||
fact: '1. Fact: Tomas is the ferryman.\n [canon] Book One/Characters/Tomas.md:3 @bbbbbbb "the ferryman"',
|
||||
finding: '1. Finding: Eye colour differs.\n [canon] Book One/Chapters/Chapter 01.md:41 @aaaaaaa "her grey eyes"\n'
|
||||
+ ' [canon] Book One/Characters/Mara Vell.md:9-10 @aaaaaaa "green eyes" (changed since)',
|
||||
correction: '1. Correction: Chapter 1 says grey.\n From: "green eyes"\n To: "grey eyes"\n'
|
||||
+ ' [canon] Book One/Characters/Mara Vell.md:9 @bbbbbbb "green eyes"',
|
||||
question: '1. Question: Is the harbor north of the town?\n [canon] Book One/Places/Harbor Town.md:2-4 @bbbbbbb "the harbor"',
|
||||
idea: '1. Idea: A storm could close the harbor.\n [playground] Book One/Playground/What If.md:5 @bbbbbbb "a storm"\n'
|
||||
+ ' [web] https://example.invalid/tides "spring tides"',
|
||||
};
|
||||
|
||||
for (const kind of Object.keys(SNAPSHOTS)) {
|
||||
test(`renderItems snapshot: ${kind}`, () => {
|
||||
const out = render(SNAPSHOTS[kind]);
|
||||
assert.equal(out.kind, 'items');
|
||||
assert.equal(out.text, EXPECTED[kind]);
|
||||
assert.equal(out.items[0].kind, kind);
|
||||
});
|
||||
}
|
||||
|
||||
test('renderItems numbers several items and takes a parsed body as well as a string', () => {
|
||||
const items = [...SNAPSHOTS.fact, ...SNAPSHOTS.question];
|
||||
const out = renderItems({ items }, options);
|
||||
assert.equal(out.text, `${EXPECTED.fact}\n${EXPECTED.question.replace(/^1\./, '2.')}`);
|
||||
assert.deepEqual(out.items[1].cites[0], { badge: 'canon', path: 'Book One/Places/Harbor Town.md', commit: B, lines: [2, 4],
|
||||
ref: 'Book One/Places/Harbor Town.md:2-4 @bbbbbbb', quote: 'the harbor', changed: false });
|
||||
test('free text renders as itself with no citations', () => {
|
||||
for (const body of ['Grey, in chapter 3.', '', '"a JSON string"', '[1, 2]', '42', 'null'])
|
||||
assert.deepEqual(renderReply(body, { check: CHECK }), { kind: 'text', text: body, plain: body });
|
||||
});
|
||||
|
||||
test('without options a path cite has no badge and is never marked changed', () => {
|
||||
assert.equal(renderItems({ items: SNAPSHOTS.finding }).text,
|
||||
'1. Finding: Eye colour differs.\n Book One/Chapters/Chapter 01.md:41 @aaaaaaa "her grey eyes"\n'
|
||||
+ ' Book One/Characters/Mara Vell.md:9-10 @aaaaaaa "green eyes"');
|
||||
test('a cited reply renders its text, then each cite with the badge from the check result', () => {
|
||||
const out = renderReply(CITED, { check: CHECK, changed });
|
||||
assert.equal(out.kind, 'reply');
|
||||
assert.equal(out.text, "Mara's eyes are grey in chapter 3.");
|
||||
assert.deepEqual(out.citations.map(c => c.badge), ['canon', 'playground', 'supporting', 'web']);
|
||||
assert.equal(out.plain, "Mara's eyes are grey in chapter 3.\n"
|
||||
+ ' [canon] Book One/Chapters/Chapter 03.md:41 @aaaaaaa "her grey eyes"\n'
|
||||
+ ' [playground] Book One/Playground/What If.md:5-6 @bbbbbbb "a storm"\n'
|
||||
+ ' [supporting] Notes/Eyes.md:9-10 @aaaaaaa "green eyes" (agent-written: acme/scribe) (changed since)\n'
|
||||
+ ' [web] https://example.invalid/tides "spring tides"');
|
||||
assert.deepEqual(out.citations[0], { badge: 'canon', path: 'Book One/Chapters/Chapter 03.md', commit: A, lines: [41, 41],
|
||||
ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa', quote: 'her grey eyes', canon: true, agent: null, changed: false });
|
||||
assert.deepEqual(out.citations[3], { badge: 'web', url: 'https://example.invalid/tides', link: 'https://example.invalid/tides',
|
||||
ref: 'https://example.invalid/tides', quote: 'spring tides', agent: null, changed: false });
|
||||
});
|
||||
|
||||
const NOTICE_SNAPSHOTS = { 'no-cited-answer': 'No cited answer', 'no-answer': 'No answer', 'turn-failed': 'The turn failed' };
|
||||
for (const [notice, text] of Object.entries(NOTICE_SNAPSHOTS)) {
|
||||
test(`renderItems snapshot: notice ${notice}`, () => {
|
||||
assert.deepEqual(renderItems(JSON.stringify({ items: [], notice }), options), { kind: 'notice', notice, text });
|
||||
});
|
||||
}
|
||||
test('a parsed body renders as its string does', () => {
|
||||
assert.deepEqual(renderReply(JSON.parse(CITED), { check: CHECK, changed }), renderReply(CITED, { check: CHECK, changed }));
|
||||
});
|
||||
|
||||
test('a body without the reply shape shows a fixed line and none of its text', () => {
|
||||
const secret = 'free prose the guard would refuse';
|
||||
const bodies = [secret, JSON.stringify(secret), '{"items": [], "notice": "other"}', JSON.stringify({ items: [], notice: 'no-answer', extra: secret }),
|
||||
JSON.stringify({ items: [] }), JSON.stringify({ items: [{ kind: 'story', text: secret, cites: [] }] }),
|
||||
JSON.stringify({ items: [{ kind: 'fact', text: secret }] }), JSON.stringify({ items: SNAPSHOTS.fact, prose: secret }),
|
||||
JSON.stringify({ items: [{ kind: 'correction', text: secret, cites: [] }] }),
|
||||
JSON.stringify({ items: [{ kind: 'fact', text: secret, cites: [cite('a.md', [2, 1], 'q')] }] }),
|
||||
JSON.stringify({ items: [{ kind: 'fact', text: secret, cites: [{ path: 'a.md', commit: 'abc', lines: [1, 1], quote: 'q' }] }] }),
|
||||
JSON.stringify({ items: [{ kind: 'fact', text: secret, cites: [{ url: 'https://x.invalid', path: 'a.md', quote: 'q' }] }] }),
|
||||
null, 42, '[]'];
|
||||
for (const body of bodies) {
|
||||
const out = renderItems(body, options);
|
||||
assert.deepEqual(out, { kind: 'unreadable', text: UNREADABLE }, String(body));
|
||||
assert.ok(!JSON.stringify(out).includes(secret));
|
||||
test('without a check result a path cite has no badge, no label and is never changed', () => {
|
||||
const out = renderReply(CITED);
|
||||
assert.deepEqual(out.citations.map(c => [c.badge, c.agent, c.changed]),
|
||||
[[null, null, false], [null, null, false], [null, null, false], ['web', null, false]]);
|
||||
});
|
||||
|
||||
test('the label and the badge come from the check result only, never from a bad entry', () => {
|
||||
const bad = { citations: [{ scope: 'web', agent: '' }, { scope: 'story', agent: 7 }, null, { scope: 'canon', agent: 'x/y' }] };
|
||||
const out = renderReply(CITED, { check: bad });
|
||||
// A path cite can't be web; a url cite is web by its shape whatever the check says, and never agent-written.
|
||||
assert.deepEqual(out.citations.map(c => [c.badge, c.agent]), [[null, null], [null, null], [null, null], ['web', null]]);
|
||||
});
|
||||
|
||||
test('a web cite is a link only for https', () => {
|
||||
const urls = { 'https://example.invalid/a': 'https://example.invalid/a', 'http://example.invalid/a': null,
|
||||
'javascript:alert(1)': null, 'JAVASCRIPT:alert(1)': null, 'data:text/html,x': null, 'not a url': null, '//example.invalid': null };
|
||||
for (const [url, link] of Object.entries(urls)) {
|
||||
const out = renderReply(reply('t', [web(url)]));
|
||||
assert.equal(out.kind, 'reply', url);
|
||||
assert.equal(out.citations[0].link, link, url);
|
||||
assert.equal(out.citations[0].ref, url);
|
||||
}
|
||||
});
|
||||
|
||||
test('a write notice renders its fixed line', () => {
|
||||
const body = op => JSON.stringify({ notice: 'library-write', op, path: 'Notes/Eyes.md', commit: B });
|
||||
assert.deepEqual(renderReply(body('write'), { name: 'Scribe' }),
|
||||
{ kind: 'notice', op: 'write', path: 'Notes/Eyes.md', commit: B, text: 'Scribe wrote Notes/Eyes.md @bbbbbbb', plain: 'Scribe wrote Notes/Eyes.md @bbbbbbb' });
|
||||
assert.equal(renderReply(body('delete'), { name: 'Scribe' }).text, 'Scribe deleted Notes/Eyes.md @bbbbbbb');
|
||||
assert.equal(renderReply(body('write')).text, 'An agent wrote Notes/Eyes.md @bbbbbbb');
|
||||
});
|
||||
|
||||
test('a body without the reply or notice shape is free text: the whole body, no citations', () => {
|
||||
const bodies = [
|
||||
JSON.stringify({ text: 't' }), JSON.stringify({ citations: [] }), JSON.stringify({ text: 1, citations: [] }),
|
||||
JSON.stringify({ text: 't', citations: [], extra: 1 }), JSON.stringify({ items: [] }),
|
||||
reply('t', [cite('a.md', [2, 1], 'q')]), reply('t', [cite('a.md', [0, 1], 'q')]), reply('t', [cite('a.md', [1], 'q')]),
|
||||
reply('t', [{ path: 'a.md', commit: 'abc', lines: [1, 1], quote: 'q' }]), reply('t', [cite('a.md', [1, 1], 'q', A, { as: 'playground' })]),
|
||||
reply('t', [cite('a.md', [1, 1], 'q', A, { scope: 'canon' })]), reply('t', [{ url: 'https://x.invalid', path: 'a.md', quote: 'q' }]),
|
||||
reply('t', [{ url: 'https://x.invalid' }]), reply('t', [{ url: 'https://x.invalid', quote: 'q', agent: 'x/y' }]),
|
||||
JSON.stringify({ notice: 'library-write', op: 'move', path: 'a.md', commit: A }),
|
||||
JSON.stringify({ notice: 'library-write', op: 'write', path: 'a.md', commit: 'abc' }),
|
||||
JSON.stringify({ notice: 'library-write', op: 'write', path: 'a.md', commit: A, by: 'x' }),
|
||||
];
|
||||
for (const body of bodies) assert.deepEqual(renderReply(body, { check: CHECK }), { kind: 'text', text: body, plain: body }, body);
|
||||
});
|
||||
|
||||
test('an empty citations list is a reply with no cites', () => {
|
||||
assert.deepEqual(renderReply(reply('Grey.', [])), { kind: 'reply', text: 'Grey.', citations: [], plain: 'Grey.' });
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"prd": "docs/prd/mosaic-stack.md",
|
||||
"version": "1.15",
|
||||
"version": "1.17",
|
||||
"requirements": [
|
||||
{ "id": "REQ-ROLE-1", "title": "Each role is a reviewed roles/<name>.json: contract, authority map, credentials" },
|
||||
{ "id": "REQ-ROLE-2", "title": "One holder per role instance, one per assistant session; the chief of staff may end a run, others need a decision" },
|
||||
@@ -77,13 +77,15 @@
|
||||
{ "id": "REQ-SESS-1", "title": "Each session shows its lifetime count of completed compactions on pi and Claude Code; an unproven count shows unknown" },
|
||||
{ "id": "REQ-SESS-2", "title": "Clear context retires a session after a safe stop and starts a fresh successor with none of the old context" },
|
||||
{ "id": "REQ-SESS-3", "title": "Every session start passes the launch checks: authority, route, revocation, kill switch, limits and admission" },
|
||||
{ "id": "REQ-LIB-1", "title": "A library maps the user's repository onto universes, books, types, playgrounds and supporting folders, set by a human" },
|
||||
{ "id": "REQ-LIB-2", "title": "Scope comes from the path, lookups default to canon, and a playground or supporting file is never cited as canon" },
|
||||
{ "id": "REQ-LIB-1", "title": "A human-set library maps the user's repository onto universes, books, types, playgrounds, supporting and archive folders" },
|
||||
{ "id": "REQ-LIB-2", "title": "Scope comes from the path or a DOCX's source, lookups default to canon, and only canon files are ever cited as canon" },
|
||||
{ "id": "REQ-LIB-3", "title": "Universes stay separate; a crossover is a hybrid universe only a human creates, reading its sources' canon" },
|
||||
{ "id": "REQ-LIB-4", "title": "Git holds every change; the bus fast-forwards a read-only mirror every 60 seconds and agents read only that" },
|
||||
{ "id": "REQ-LIB-4", "title": "Git holds every change. The bus fast-forwards a read-only mirror every 60 seconds, the one place agents read Markdown" },
|
||||
{ "id": "REQ-LIB-5", "title": "Agents check the library through typed lookup tools that name the commit and show links out and in" },
|
||||
{ "id": "REQ-LIB-6", "title": "Agents never write story, only docs in supporting folders a human marks. Chat is free text, and any citation is checked" },
|
||||
{ "id": "REQ-LIB-7", "title": "One chat room with several creative agents, addressed by leading @tags; an unknown tag sends nothing" },
|
||||
{ "id": "REQ-LIB-8", "title": "Case 2 story files become DOCX by a human-only one-way import or in the editor; Markdown stays for notes and docs" },
|
||||
{ "id": "REQ-LIB-9", "title": "The Console's DOCX editor: only a human saves, each save is one commit, and the editor code is vendored and pinned" },
|
||||
{ "id": "REQ-INST-1", "title": "The installer offers optional components: pinned, health-checked, removable, switched on in config; first is SearXNG" },
|
||||
{ "id": "REQ-INST-2", "title": "With no OIDC provider to configure, the installer deploys a bundled Pocket ID, Q203 (post-v1)" },
|
||||
{ "id": "REQ-INST-3", "title": "One-command install of a named instance from a profile, and one-command upgrade with backup and rollback" }
|
||||
|
||||
@@ -18,10 +18,10 @@ test("the list holds the PRD's requirement ids, in its order, at its version", (
|
||||
const ids = [...prd.matchAll(/^- \*\*(REQ-[A-Z]+-[0-9]+)\.\*\*/gm)].map((m) => m[1]);
|
||||
// Any other mention of a bold id would be a bullet this pattern missed.
|
||||
assert.equal(ids.length, [...prd.matchAll(/\*\*REQ-/g)].length);
|
||||
assert.equal(ids.length, 85);
|
||||
assert.equal(ids.length, 87);
|
||||
assert.deepEqual(list.requirements.map((r) => r.id), ids);
|
||||
assert.match(prd, new RegExp(`^- Status: approved, version ${list.version.replace('.', '\\.')}\\.`, 'm'));
|
||||
assert.deepEqual([list.prd, list.version], ['docs/prd/mosaic-stack.md', '1.15']);
|
||||
assert.deepEqual([list.prd, list.version], ['docs/prd/mosaic-stack.md', '1.17']);
|
||||
});
|
||||
|
||||
test('the committed list loads frozen', () => {
|
||||
@@ -74,7 +74,7 @@ test('the schema refuses any other shape', () => {
|
||||
const twice = raw();
|
||||
twice.requirements.push(structuredClone(twice.requirements[0]));
|
||||
writeFileSync(join(dir, 'twice.json'), JSON.stringify(twice));
|
||||
assert.throws(() => loadRequirements(join(dir, 'twice.json')), listError('requirements[85].id: REQ-ROLE-1 twice'));
|
||||
assert.throws(() => loadRequirements(join(dir, 'twice.json')), listError('requirements[87].id: REQ-ROLE-1 twice'));
|
||||
} finally {
|
||||
rmSync(dir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
@@ -335,13 +335,28 @@ note is `agents/dewey/work/wui/SLICE1-VIEWS.md`.
|
||||
same functions, so both show the same broker data.
|
||||
- Nothing writes but the "Message a role" box, the Settings update, the Assistant
|
||||
section's three buttons and the spec and docs editor's Save, all under `--send` (above,
|
||||
"Assistant settings" and "Spec and docs editor"). A decision shows `mosaic decide <id> <key>` for each choice,
|
||||
"Assistant settings" and "Spec and docs editor"), and the decision Approve and Deny below.
|
||||
A decision shows `mosaic decide <id> <key>` for each choice,
|
||||
with Copy, which only puts the command on the clipboard. It is answered in a
|
||||
terminal (REQ-DEC-3, Q4). Seen is not set from the browser either. The
|
||||
command has no `--business`, so `mosaic decide` uses the running bus host's
|
||||
business, as the Console does by default. From a Console started with
|
||||
`--business` for another business the copied command refuses (no bus host,
|
||||
or no such decision) rather than answering elsewhere.
|
||||
- Row 252 (#1753, PRD 1.9 REQ-WEB-2): a grant request (`credential.mint` routed
|
||||
to the human, raised with a grant and two options) can also be approved or
|
||||
denied on its decision page, only when the Console runs with both `--sso` and
|
||||
`--send` and the page is signed in as a `console.sso` subject. The first click
|
||||
POSTs `/api/decisions/<id>/confirmation` and shows what the answer does; only
|
||||
Confirm POSTs `/resolve` with that one-use confirmation (two minutes, bound to
|
||||
the session, decision and choice). Each step spawns
|
||||
`packages/bus/src/console-cli.mjs`, which the bus verifies as the Console's
|
||||
child holding the signed-in subject, and the bus records the answer `via
|
||||
console` with a `human.input` naming that subject. Nothing retries; an unknown
|
||||
outcome says to refresh. Without `--sso` the page has no buttons and says why;
|
||||
under `--sso` without `--send` it says the Console is read-only for decisions.
|
||||
The tester listener has no decision routes. Every other decision stays
|
||||
terminal-only.
|
||||
- What no Q1 verb returns is labelled where it would show, for example
|
||||
"Bot names: not in the Q1 module" (lead decision 63). Nothing is guessed.
|
||||
- A task's list row can only say its current state came from a Vikunja read,
|
||||
|
||||
+35
-11
@@ -14,6 +14,7 @@ import { fileURLToPath } from 'node:url';
|
||||
import { HUMAN_CLI } from '../../cli/src/transport.mjs';
|
||||
import { readHostState } from '../../cli/src/host.mjs';
|
||||
import { views } from '../../bus/src/views.mjs';
|
||||
import { CONSOLE_VERBS } from '../../bus/src/broker.mjs';
|
||||
|
||||
export class BusReadError extends Error {
|
||||
constructor(code, message = code) { super(message); this.code = code; }
|
||||
@@ -27,10 +28,13 @@ export const subjectOk = s => typeof s === 'string' && s.length > 0 && s.length
|
||||
// request on stdin, JSON on stdout, or a bus error code as the last
|
||||
// `^[a-z-]{1,64}$` line of stderr.
|
||||
export function humanCall({ socket, business, env = process.env, cli = HUMAN_CLI, timeoutMs = 30000, maxBytes = 8 * 1024 * 1024 }) {
|
||||
return (verb, args = {}) => new Promise((resolve, reject) => {
|
||||
return (verb, args = {}) => transport({ cli, socket, env: cli === HUMAN_CLI ? { ...env, MOSAIC_BUS_CLI_NONCE: randomBytes(32).toString('hex') } : env, input: { business, verb, args }, timeoutMs, maxBytes });
|
||||
}
|
||||
function transport({ cli, socket, env, input, timeoutMs, maxBytes }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let child;
|
||||
try {
|
||||
child = spawn(process.execPath, [cli, socket], { env: cli === HUMAN_CLI ? { ...env, MOSAIC_BUS_CLI_NONCE: randomBytes(32).toString('hex') } : env, stdio: ['pipe', 'pipe', 'pipe'] });
|
||||
child = spawn(process.execPath, [cli, socket], { env, stdio: ['pipe', 'pipe', 'pipe'] });
|
||||
} catch { return reject(new BusReadError('outcome-unknown', 'the bus transport did not start')); }
|
||||
const out = [], err = [];
|
||||
let size = 0, settled = false;
|
||||
@@ -53,24 +57,42 @@ export function humanCall({ socket, business, env = process.env, cli = HUMAN_CLI
|
||||
catch { done(reject, new BusReadError('invalid-response')); }
|
||||
});
|
||||
child.stdin.on('error', () => {}); // A child that exits early reports through 'close'.
|
||||
child.stdin.end(`${JSON.stringify({ business, verb, args })}\n`);
|
||||
child.stdin.end(`${JSON.stringify(input)}\n`);
|
||||
});
|
||||
}
|
||||
|
||||
// Row 252 (#1753, design section 2): the Console owner's answer to a grant request. Each call spawns
|
||||
// a fresh console-cli with a fresh nonce, and the business and the signed-in (provider, iss, sub) go
|
||||
// in its spawn environment, where the bus reads them back. Inherited console keys are dropped first,
|
||||
// so only this call's values reach the wrapper. Only the two console verbs pass (N4). A resolve pins
|
||||
// the business its confirmation was issued for.
|
||||
export const CONSOLE_CLI = fileURLToPath(new URL('../../bus/src/console-cli.mjs', import.meta.url));
|
||||
export function consoleCall({ dataRoot, socket, business = null, env = process.env, cli = CONSOLE_CLI, timeoutMs = 30000 }) {
|
||||
return async (verb, args, { subject, business: pinned = null }) => {
|
||||
if (!CONSOLE_VERBS.includes(verb)) throw new Error(`the Console does not call ${verb}`);
|
||||
const id = pinned ?? (business || hostBusiness(dataRoot));
|
||||
const own = Object.fromEntries(Object.entries(env).filter(([k]) => !k.startsWith('MOSAIC_BUS_CONSOLE_')));
|
||||
return transport({
|
||||
cli, socket, timeoutMs, maxBytes: 1024 * 1024, input: { verb, args },
|
||||
env: { ...own, MOSAIC_BUS_CONSOLE_NONCE: randomBytes(32).toString('hex'), MOSAIC_BUS_CONSOLE_BUSINESS: id,
|
||||
MOSAIC_BUS_CONSOLE_PROVIDER: subject.provider, MOSAIC_BUS_CONSOLE_ISS: subject.iss, MOSAIC_BUS_CONSOLE_SUB: subject.sub },
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// The business is the --business flag, or else the live bus host's, read
|
||||
// on every request so a host started after the Console is picked up.
|
||||
export function busCaller({ dataRoot, socket, business = null, env = process.env, cli = HUMAN_CLI, timeoutMs = 30000 }) {
|
||||
return async (verb, args) => {
|
||||
let id = business;
|
||||
if (!id) {
|
||||
let state;
|
||||
try { state = readHostState(dataRoot); } catch { throw new BusReadError('no-bus-host', 'the bus host state file is unreadable'); }
|
||||
if (!state?.live) throw new BusReadError('no-bus-host', 'no bus host is running and no --business was given');
|
||||
id = state.business;
|
||||
}
|
||||
return humanCall({ socket, business: id, env, cli, timeoutMs })(verb, args);
|
||||
return humanCall({ socket, business: business || hostBusiness(dataRoot), env, cli, timeoutMs })(verb, args);
|
||||
};
|
||||
}
|
||||
function hostBusiness(dataRoot) {
|
||||
let state;
|
||||
try { state = readHostState(dataRoot); } catch { throw new BusReadError('no-bus-host', 'the bus host state file is unreadable'); }
|
||||
if (!state?.live) throw new BusReadError('no-bus-host', 'no bus host is running and no --business was given');
|
||||
return state.business;
|
||||
}
|
||||
export const busReader = options => views({ call: busCaller(options) });
|
||||
|
||||
// FED R6 (#1800): a granted user's bus transport, R3's user-cli.mjs (#414, design 3.6). Same
|
||||
@@ -167,5 +189,7 @@ const STATUS = {
|
||||
// leaves the remote unreachable, like no bus to ask.
|
||||
'library-sync-busy': 409, 'library-diverged': 409, 'library-accept-stale': 409, 'library-accept-invalid': 400,
|
||||
'library-credential-missing': 503, 'library-fetch-failed': 503,
|
||||
// Row 225 (C2-10b): a Revert of a commit that isn't an agent's is hers to read, like stale-base.
|
||||
'library-revert-not-agent': 409,
|
||||
};
|
||||
export const busStatus = code => STATUS[code] ?? 502;
|
||||
@@ -2,7 +2,7 @@
|
||||
// MOSAIC_TESTER_SOCKET_V1: private tester ingress, no tester TCP.
|
||||
import { createChat } from './chat.mjs';
|
||||
import { startServer, previewOptions, proofOptions, DEFAULT_BOARD } from './serve.mjs';
|
||||
import { busCaller, busBusiness, userCaller } from './bus.mjs';
|
||||
import { busCaller, busBusiness, userCaller, consoleCall } from './bus.mjs';
|
||||
import { consoleBus, userOptionsFor, agentCaller, TESTER_AGENT_VERBS } from './console-bus.mjs';
|
||||
import { consoleAccess } from './access.mjs';
|
||||
import { accessContextFor } from '../../cli/src/access.mjs';
|
||||
@@ -68,14 +68,17 @@ try {
|
||||
// the system config, Business can't resolve authority and Settings has
|
||||
// no notifier. A refusal printed here names no path (redactor).
|
||||
// --send without a bus refuses to start rather than serve a composer that can't send.
|
||||
let bus = null, send = null, settingsWrite = null, projectFiles = null, projectFile = null, libraryFile = null, libraryStatus = null, librarySync = null, projectSave = null, chat = null, nameWrite = null, assistantStop = null, instancesWrite = null, routesWrite = null, agentWrite = null, busLine, system = null;
|
||||
let bus = null, send = null, settingsWrite = null, projectFiles = null, projectFile = null, libraryFile = null, libraryStatus = null, librarySync = null, libraryRevert = null, projectSave = null, chat = null, nameWrite = null, assistantStop = null, instancesWrite = null, routesWrite = null, agentWrite = null, decisionWrite = null, busLine, system = null;
|
||||
let processing = null, ownerCall = null;
|
||||
try {
|
||||
system = loadSystem();
|
||||
const { dataRoot } = system;
|
||||
const call = ownerCall = busCaller({ dataRoot, socket: socketPath(dataRoot), business: options.business ?? null });
|
||||
// FED R6 (#1800): the bus-backed options, shared with each granted user's session (console-bus.mjs).
|
||||
({ processing, chat, bus, projectFiles, projectFile, libraryFile, libraryStatus, send, librarySync, settingsWrite, projectSave, nameWrite, assistantStop, instancesWrite, routesWrite, agentWrite } = consoleBus(call, { send: sendOn }));
|
||||
({ processing, chat, bus, projectFiles, projectFile, libraryFile, libraryStatus, send, librarySync, libraryRevert, settingsWrite, projectSave, nameWrite, assistantStop, instancesWrite, routesWrite, agentWrite } = consoleBus(call, { send: sendOn }));
|
||||
// Row 252 (#1753): Approve and Deny on grant requests, through the console wrapper, only with
|
||||
// --sso and --send.
|
||||
if (ssoOn && sendOn) decisionWrite = consoleCall({ dataRoot, socket: socketPath(dataRoot), business: options.business ?? null });
|
||||
busLine = `Bus: ${options.business ?? 'the running bus host\'s business'}`;
|
||||
} catch (err) {
|
||||
const why = redactor({ configDir: configDir() })(err.message);
|
||||
@@ -104,7 +107,7 @@ try {
|
||||
}
|
||||
let server;
|
||||
try {
|
||||
server = await startServer({ board: options.board, port: options.port, bus, reads, preview: options.preview, sso, proof, send, settingsWrite, projectFiles, projectFile, libraryFile, libraryStatus, librarySync, projectSave, chat, nameWrite, assistantStop, instancesWrite, routesWrite, agentWrite, processing, userOptions, federation: system?.federation ?? null });
|
||||
server = await startServer({ board: options.board, port: options.port, bus, reads, preview: options.preview, sso, proof, send, settingsWrite, projectFiles, projectFile, libraryFile, libraryStatus, librarySync, libraryRevert, projectSave, chat, nameWrite, assistantStop, instancesWrite, routesWrite, agentWrite, processing, decisionWrite, userOptions, federation: system?.federation ?? null });
|
||||
} catch (err) { sso?.close(); throw err; }
|
||||
let testerServer = null;
|
||||
if (testerSocket) {
|
||||
@@ -128,7 +131,7 @@ try {
|
||||
const proofLine = `\nProxy: proxy proof ${proof ? 'on' : 'off'}`;
|
||||
// One line per provider: id, issuer, subject count and state. No client id, secret or sub.
|
||||
const health = sso?.health() ?? {};
|
||||
const ssoLines = sso ? `\nSign-in: ${sso.publicOrigin}/ (--sso), ${send ? 'reads and human writes (--send)' : 'read-only'}` + sso.summary().map(p => `\nSign-in provider: ${p.id} issuer ${p.issuer} subjects ${p.subjects} (${health[p.id]})`).join('') : '';
|
||||
const ssoLines = sso ? `\nSign-in: ${sso.publicOrigin}/ (--sso), ${send ? 'reads and human writes (--send), grant Approve and Deny' : 'read-only'}` + sso.summary().map(p => `\nSign-in provider: ${p.id} issuer ${p.issuer} subjects ${p.subjects} (${health[p.id]})`).join('') : '';
|
||||
const queueLine = options.checkout ? '\nQueue: read from the --checkout directory' : '';
|
||||
console.log(`Mosaic Console: http://127.0.0.1:${server.address().port}/\nBoard: ${options.board}\n${busLine}${queueLine}${previewLine}${ssoLines}${proofLine}${testerServer ? `\nTester Console: unix:${testerServer.address()} (binds the tester)` : ''}\nCtrl-C stops this server.`);
|
||||
for (const signal of ['SIGINT', 'SIGTERM']) process.once(signal, () => { sso?.close(); server.close(); testerServer?.close(); });
|
||||
|
||||
@@ -30,10 +30,10 @@ export function consoleBus(call, { send: sendOn = false, owner = null } = {}) {
|
||||
projectFiles: args => call('project.files', args),
|
||||
projectFile: args => call('project.file', args),
|
||||
libraryFile: args => call('library.file', args), libraryStatus: args => call('library.status', args),
|
||||
send: null, librarySync: null, settingsWrite: null, projectSave: null, nameWrite: null, assistantStop: null, instancesWrite: null, routesWrite: null, agentWrite: null,
|
||||
send: null, librarySync: null, libraryRevert: null, settingsWrite: null, projectSave: null, nameWrite: null, assistantStop: null, instancesWrite: null, routesWrite: null, agentWrite: null,
|
||||
};
|
||||
if (sendOn) {
|
||||
o.send = args => call('message.send', args); o.librarySync = args => call('library.sync', args); o.settingsWrite = args => call('limits.set', args);
|
||||
o.send = args => call('message.send', args); o.librarySync = args => call('library.sync', args); o.libraryRevert = args => call('library.revert', args); o.settingsWrite = args => call('limits.set', args);
|
||||
o.projectSave = args => call('project.file.save', args); o.nameWrite = args => call('name.set', args); o.assistantStop = args => call('assistant.stop', args);
|
||||
o.instancesWrite = args => call('instances.set', args); o.routesWrite = args => call('routes.set', args); o.agentWrite = agentCaller(call, AGENT_VERBS);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
// Row 252 (#1753, Gander's design approved by Webby at 5d8f0f4b5): Approve and Deny for a grant
|
||||
// request, from the signed-in Console only. Two POSTs. /confirmation asks the bus for the decision's
|
||||
// two answers and digest and returns a one-use confirmation bound to this session, business,
|
||||
// decision, choice and digest. /resolve takes only that choice and confirmation, consumes the
|
||||
// confirmation before it awaits the bus, and asks the bus to resolve with the digest. The bus
|
||||
// rechecks everything in the resolve transaction. Nothing here retries.
|
||||
import { createHash, randomBytes } from 'node:crypto';
|
||||
import { BusReadError, subjectOk } from './bus.mjs';
|
||||
|
||||
export const DECISION_ROUTE = /^\/api\/decisions\/([^/]*)\/(confirmation|resolve)$/;
|
||||
// The endpoint contract, design section 4. Each refusal is one of these, never a 200.
|
||||
export const DECISION_REFUSALS = Object.freeze({
|
||||
'sign-in-required': [401, 'Sign in again before answering.'],
|
||||
'read-only': [403, 'Console decision answers are not enabled. Use mosaic decide.'],
|
||||
'cross-origin': [403, 'Answer from the signed-in Console page.'],
|
||||
'not-found': [404, 'Not found.'],
|
||||
'human-required': [403, 'The bus refused this human identity.'],
|
||||
'peercred-required': [403, 'The bus could not verify this connection.'],
|
||||
'method-not-allowed': [405, 'Use POST.'],
|
||||
'invalid-request': [400, 'Invalid decision answer.'],
|
||||
'request-too-large': [413, 'Decision answer is too large.'],
|
||||
'decision-not-found': [404, 'This decision is unavailable.'],
|
||||
'decision-not-eligible': [403, 'Answer this decision with mosaic decide.'],
|
||||
'decision-closed': [409, 'This decision is no longer open. Refresh the inbox.'],
|
||||
'decision-stale': [409, 'The choices changed. Review the decision again.'],
|
||||
'confirmation-required': [409, 'Review and confirm this answer again.'],
|
||||
'confirmation-unavailable': [503, 'Confirmation is unavailable. Try again later.'],
|
||||
'outcome-unknown': [503, 'The answer may have reached the bus. Refresh before trying again.'],
|
||||
});
|
||||
// Bus codes by name. A bus that refuses this caller is human-required, whatever its code. Any
|
||||
// other code, or no answer, is confirmation-unavailable at the preview and outcome-unknown at the
|
||||
// resolve, which the page reads as "refresh first".
|
||||
const BUS_CODES = {
|
||||
'human-required': 'human-required', unauthenticated: 'human-required', 'unknown-business': 'human-required',
|
||||
'access-refused': 'human-required', 'access-revoked': 'human-required', 'agent-required': 'human-required',
|
||||
'peercred-required': 'peercred-required',
|
||||
'decision-not-found': 'decision-not-found', 'decision-not-eligible': 'decision-not-eligible',
|
||||
'decision-closed': 'decision-closed', 'decision-stale': 'decision-stale', 'invalid-choice': 'decision-stale',
|
||||
'invalid-request': 'invalid-request',
|
||||
};
|
||||
const BODY_MAX = 4096;
|
||||
const TOKEN = /^[a-f0-9]{64}$/;
|
||||
const DIGEST = /^[a-f0-9]{64}$/;
|
||||
const one = (req, name) => (req.headersDistinct[name]?.length === 1 ? req.headersDistinct[name][0] : null);
|
||||
const hash = (token) => createHash('sha256').update(token).digest('hex');
|
||||
export function decisionRefuse(res, code) {
|
||||
const [status, message] = DECISION_REFUSALS[code];
|
||||
res.writeHead(status, { 'content-type': 'application/json', 'cache-control': 'no-store' });
|
||||
res.end(JSON.stringify({ error: code, message }));
|
||||
}
|
||||
|
||||
// The confirmations, in this process's memory only and stored by hash. 120 seconds, at most 1024
|
||||
// live. A full store refuses a new one rather than drop a live one. An expired one is swept.
|
||||
export function createConfirmations({ ttlMs = 120000, max = 1024, now = Date.now } = {}) {
|
||||
const live = new Map();
|
||||
const sweep = () => { const t = now(); for (const [k, v] of live) if (v.expires <= t) live.delete(k); };
|
||||
return {
|
||||
issue(binding) {
|
||||
sweep();
|
||||
if (live.size >= max) return null;
|
||||
const token = randomBytes(32).toString('hex');
|
||||
live.set(hash(token), { ...binding, expires: now() + ttlMs });
|
||||
return token;
|
||||
},
|
||||
// One use: a token found is gone, whether or not it matches.
|
||||
consume(token, { session, decision, choice }) {
|
||||
sweep();
|
||||
if (typeof token !== 'string' || !TOKEN.test(token)) return null;
|
||||
const k = hash(token), v = live.get(k);
|
||||
if (!v) return null;
|
||||
live.delete(k);
|
||||
return v.session === session && v.decision === decision && v.choice === choice ? v : null;
|
||||
},
|
||||
get size() { sweep(); return live.size; },
|
||||
};
|
||||
}
|
||||
|
||||
async function readBody(req) {
|
||||
if (one(req, 'content-type')?.split(';')[0].trim().toLowerCase() !== 'application/json') return { code: 'invalid-request' };
|
||||
const chunks = [];
|
||||
let size = 0;
|
||||
for await (const chunk of req) {
|
||||
size += chunk.length;
|
||||
if (size > BODY_MAX) return { code: 'request-too-large' };
|
||||
chunks.push(chunk);
|
||||
}
|
||||
try {
|
||||
const value = JSON.parse(Buffer.concat(chunks).toString('utf8'));
|
||||
return value && typeof value === 'object' && !Array.isArray(value) ? { value } : { code: 'invalid-request' };
|
||||
} catch { return { code: 'invalid-request' }; }
|
||||
}
|
||||
const preview = (v, id) =>
|
||||
v && typeof v === 'object' && v.id === id && typeof v.business === 'string' && DIGEST.test(v.digest ?? '') &&
|
||||
['approve', 'deny'].every((k) => typeof v[k]?.key === 'string' && typeof v[k]?.text === 'string') &&
|
||||
v.approve.key !== v.deny.key && v.grant && typeof v.grant.method === 'string';
|
||||
|
||||
// `session` is the live sign-in session object this request passed, and `live()` reads it again
|
||||
// right before each spawn. `call(verb, args, { subject, business })` is the console transport.
|
||||
export async function decisionHTTP(req, res, { path, decide, session, live, confirmations, log }) {
|
||||
const [, raw, step] = DECISION_ROUTE.exec(path);
|
||||
let id = null;
|
||||
try { id = decodeURIComponent(raw); } catch { /* refused below */ }
|
||||
if (req.method !== 'POST') return decisionRefuse(res, 'method-not-allowed');
|
||||
if (!decide) return decisionRefuse(res, 'read-only');
|
||||
if (!session) return decisionRefuse(res, 'sign-in-required');
|
||||
if (one(req, 'origin') !== decide.origin || one(req, 'sec-fetch-site') !== 'same-origin') return decisionRefuse(res, 'cross-origin');
|
||||
const line = (outcome) => log(`${new Date().toISOString()} decide user=${JSON.stringify(String(session.name ?? '').slice(0, 64))} decision=${JSON.stringify(String(id ?? '').slice(0, 64))} step=${step} ${outcome}`);
|
||||
const refuse = (code) => { line(`error=${code}`); return decisionRefuse(res, code); };
|
||||
const { value, code } = await readBody(req);
|
||||
if (code) return refuse(code);
|
||||
if (!subjectOk(id)) return refuse('decision-not-found');
|
||||
const subject = { provider: session.provider, iss: session.iss, sub: session.sub };
|
||||
const busCode = (err, open) => {
|
||||
const c = err instanceof BusReadError ? BUS_CODES[err.code] : undefined;
|
||||
return c ?? open;
|
||||
};
|
||||
if (step === 'confirmation') {
|
||||
if (Object.keys(value).length !== 1 || typeof value.choice !== 'string') return refuse('invalid-request');
|
||||
if (live() !== session) return refuse('sign-in-required');
|
||||
let v;
|
||||
try { v = await decide.call('decision.preview.console', { id }, { subject }); } catch (err) { return refuse(busCode(err, 'confirmation-unavailable')); }
|
||||
if (!preview(v, id)) return refuse('confirmation-unavailable');
|
||||
const action = value.choice === v.approve.key ? 'approve' : value.choice === v.deny.key ? 'deny' : null;
|
||||
if (!action) return refuse('decision-stale');
|
||||
if (live() !== session) return refuse('sign-in-required');
|
||||
const confirmation = confirmations.issue({ session, business: v.business, decision: id, choice: value.choice, digest: v.digest });
|
||||
if (!confirmation) return refuse('confirmation-unavailable');
|
||||
line(`action=${action}`);
|
||||
return json(res, 200, { id, question: typeof v.question === 'string' ? v.question : '', action, choice: value.choice, text: v[action].text, grant: v.grant, confirmation });
|
||||
}
|
||||
const keys = Object.keys(value);
|
||||
if (keys.length !== 2 || !keys.includes('choice') || !keys.includes('confirmation') || typeof value.choice !== 'string') return refuse('invalid-request');
|
||||
// Consumed before any await on the bus, so a second click finds nothing (J12).
|
||||
const held = confirmations.consume(value.confirmation, { session, decision: id, choice: value.choice });
|
||||
if (!held) return refuse('confirmation-required');
|
||||
if (live() !== session) return refuse('sign-in-required');
|
||||
let r;
|
||||
try {
|
||||
r = await decide.call('decision.resolve.console', { id, choice: held.choice, digest: held.digest }, { subject, business: held.business });
|
||||
} catch (err) { return refuse(busCode(err, 'outcome-unknown')); }
|
||||
if (r?.id !== id || r.op !== 'resolved' || r.choice !== held.choice) return refuse('outcome-unknown');
|
||||
line(`choice=${JSON.stringify(held.choice.slice(0, 64))}${r.grant ? ` grant=${r.grant}` : ''}`);
|
||||
return json(res, 200, { id, op: 'resolved', choice: r.choice, ...(r.grant === 'started' ? { grant: 'started' } : {}) });
|
||||
}
|
||||
function json(res, status, body) {
|
||||
res.writeHead(status, { 'content-type': 'application/json', 'cache-control': 'no-store' });
|
||||
res.end(JSON.stringify(body));
|
||||
}
|
||||
@@ -190,8 +190,9 @@
|
||||
out.kind = 'decision.raised'; out.decision = r.id; out.actor = { role: r.raised_by_role, run: r.raised_by_run };
|
||||
out.text = `Raised a ${r.class} decision for ${r.route_to}: ${String(r.question).split('\n')[0]}`;
|
||||
} else if (r.table === 'decision_events') {
|
||||
// The human answers from the CLI (via cli); every other row is the broker's.
|
||||
out.kind = `decision.${r.op}`; out.decision = r.decision; out.by = r.via === 'cli' ? 'human' : 'broker';
|
||||
// The human answers from the CLI (via cli) or, since row 252 (#1753), a grant request from the
|
||||
// signed-in Console (via console); every other row is the broker's.
|
||||
out.kind = `decision.${r.op}`; out.decision = r.decision; out.by = r.via === 'cli' ? 'human' : r.via === 'console' ? 'human-console' : 'broker';
|
||||
out.text = r.op === 'resolved' ? `${r.by} chose “${r.choice}” via ${r.via}` : r.op === 'seen' ? `${r.by} saw it${r.via ? ` via ${r.via}` : ''}` : `${r.op[0].toUpperCase()}${r.op.slice(1)} by ${r.by}${r.note ? `: ${r.note}` : ''}`;
|
||||
} else if (r.table === 'task_snapshots') {
|
||||
out.kind = `snapshot.${r.source}`;
|
||||
@@ -227,8 +228,9 @@
|
||||
// An empty state says what would appear and where it comes from.
|
||||
const empty = (what, from) => `<div class="empty"><b>${what}</b>${from ? `<p>${from}</p>` : ''}</div>`;
|
||||
const taskLink = ref => ref ? `<a href="#/tasks/${enc(ref)}">#${esc(String(ref).split('/')[1])}</a>` : '';
|
||||
// Rows without an actor role come from the human (CLI, outside any run) or from the broker itself.
|
||||
const actor = (a, by) => `<span class="source">${a ? `${txt(a.role)} · ${txt(a.run)}` : by === 'human' ? 'human, CLI outside any run' : 'broker'}</span>`;
|
||||
// Rows without an actor role come from the human (CLI outside any run, or the signed-in Console)
|
||||
// or from the broker itself.
|
||||
const actor = (a, by) => `<span class="source">${a ? `${txt(a.role)} · ${txt(a.run)}` : by === 'human' ? 'human, CLI outside any run' : by === 'human-console' ? 'human, signed-in Console' : 'broker'}</span>`;
|
||||
const PRIORITY = ['unset', 'low', 'medium', 'high', 'urgent', 'do now'];
|
||||
const head = (title, sub) => `<div class="page-head"><div><h1 tabindex="-1">${title}</h1>${sub ? `<p class="small muted" id="bus-status">${sub}</p>` : ''}</div></div>`;
|
||||
let readAt = null;
|
||||
@@ -256,7 +258,7 @@
|
||||
// Inbox
|
||||
function decisionCard(d) {
|
||||
return `<li class="wait-item s1-dec${d.blocking ? ' is-attn' : ''}"><div class="wait-head"><a href="#/inbox/${enc(d.id)}" class="s1-dec-open">${txt(first(d.question))}</a></div>
|
||||
<p class="s1-badges">${d.blocking ? blockChip('blocking') : ''}${chip(d.class, d.action)}</p>
|
||||
<p class="s1-badges">${d.blocking ? blockChip('blocking') : ''}${chip(d.class, d.action)}${canDecide && d.console ? ` ${badge('Approve or Deny here', 'ok')}` : ''}</p>
|
||||
<p class="small s1-auth">${approves(d.authorization)}</p>
|
||||
<p class="small muted">Raised by ${txt(d.raised_by_role)} ${when(d.at)}${d.task_ref ? ` · task ${taskLink(d.task_ref)}` : ''}${d.requirement_ref ? ` · ${txt(d.requirement_ref)}` : ''}</p></li>`;
|
||||
}
|
||||
@@ -314,12 +316,101 @@
|
||||
el.outerHTML = composerHtml();
|
||||
restore(k);
|
||||
}
|
||||
// Row 252 (#1753, design section 5): Approve and Deny for an open grant request, drawn only when
|
||||
// the server says this Console answers decisions (`decide` in /api/config: signed in through SSO
|
||||
// and started with --send) and the bus marked the inbox row eligible (its `console` field). The
|
||||
// first click asks the Console for a one-use confirmation that names what the answer does. Only
|
||||
// the second click answers. Nothing here retries: a refusal drops the confirmation, and an
|
||||
// unknown outcome says to refresh first. The state lives in `answer`, not the DOM, so the 10 s
|
||||
// refresh redraws it. The server and the bus check everything again; this is presentation only.
|
||||
let canDecide = false, ssoOn = false, answer = null;
|
||||
const ACTIONS = { approve: 'Approve', deny: 'Deny' };
|
||||
const grantText = g => [`method ${g.method}`, g.agent && `agent ${g.agent}`, g.host && `host ${g.host}`, Array.isArray(g.projects) && g.projects.length && `projects ${g.projects.join(', ')}`].filter(Boolean).map(s => txt(String(s))).join(' · ');
|
||||
function decideHtml() {
|
||||
const a = answer;
|
||||
if (!a) return '';
|
||||
const off = a.pending ? ' disabled' : '';
|
||||
let body;
|
||||
if (a.result) {
|
||||
const r = a.result;
|
||||
body = `<p class="receipt" id="decide-status" tabindex="-1">${r.action === 'approve' ? 'Approved' : 'Denied'}: you chose “${txt(r.choice)}”, ${txt(r.text)}. ${r.grant === 'started' ? 'The grant executor started.' : r.action === 'approve' ? 'The bus started no grant for it.' : 'Nothing starts for a denial.'} History below shows it once the bus is read again.</p>`;
|
||||
} else if (a.confirm) {
|
||||
const c = a.confirm, label = `Confirm ${c.action}`;
|
||||
body = `<div class="s1-confirm" role="group" aria-labelledby="b-confirm"><h3 id="b-confirm" class="small">${label}</h3>
|
||||
<dl class="kv"><dt>Id</dt><dd><code>${txt(c.id)}</code></dd><dt>Question</dt><dd class="s1-q">${txt(c.question)}</dd><dt>Answer</dt><dd><b class="s1-key">${txt(c.choice)}</b> ${txt(c.text)}</dd><dt>Grant</dt><dd>${grantText(c.grant)}</dd></dl>
|
||||
<p class="small muted">${c.action === 'approve' ? 'Approving starts this grant.' : 'Denying starts nothing.'} This confirmation works once and lasts two minutes.</p>
|
||||
<div class="s1-cmd"><button type="button" class="btn primary" data-decide="confirm"${off}>${a.pending ? 'Answering…' : label}</button><button type="button" class="btn" data-decide="cancel"${off}>Cancel</button></div></div>`;
|
||||
} else {
|
||||
body = `<ul class="s1-plain">${Object.entries(ACTIONS).map(([k, l]) => `<li><b>${l}</b> chooses <b class="s1-key">${txt(a.console[k].key)}</b> ${txt(a.console[k].text)}</li>`).join('')}</ul>
|
||||
<p class="small muted">Grant: ${grantText(a.console.grant)}. Either button opens a confirmation first. Nothing is answered until you confirm.</p>
|
||||
<div class="s1-cmd">${Object.entries(ACTIONS).map(([k, l]) => `<button type="button" class="btn${k === 'approve' ? ' primary' : ''}" data-decide="${k}"${off}>${a.pending === k ? 'Checking…' : l}</button>`).join('')}</div>`;
|
||||
}
|
||||
const e = a.error;
|
||||
const said = e ? `<p class="receipt failed" id="decide-status" tabindex="-1">Not answered here: ${txt(e.message)} (<code>${txt(e.code)}</code>).${e.code === 'outcome-unknown' ? ' Nothing was sent again.' : ''}</p>` : '';
|
||||
return `<section class="panel s1-decide" id="decide-section" aria-labelledby="b-decide"><h2 id="b-decide">Answer in Console</h2>${body}${said}</section>`;
|
||||
}
|
||||
// Redraw only the answer panel. `focus` names what takes focus after it.
|
||||
function paintDecide(focus) {
|
||||
const el = $('decide-section');
|
||||
if (!el) return;
|
||||
el.outerHTML = decideHtml();
|
||||
(focus ? $('decide-section')?.querySelector(focus) : null)?.focus();
|
||||
}
|
||||
async function decidePost(url, body) {
|
||||
let res = null, json = null;
|
||||
try {
|
||||
res = await fetch(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body), cache: 'no-store', redirect: 'manual' });
|
||||
try { json = await res.json(); } catch { json = null; }
|
||||
} catch { res = null; }
|
||||
return { res, json };
|
||||
}
|
||||
// A refusal the Console wrote carries its code and message (design section 4). Anything else, a
|
||||
// 408 or no answer included, gets the fallback: at the resolve step that is outcome-unknown.
|
||||
const DECIDE_FALLBACK = {
|
||||
'confirmation-unavailable': 'Confirmation is unavailable. Try again later.',
|
||||
'outcome-unknown': 'The answer may have reached the bus. Refresh before trying again.',
|
||||
};
|
||||
const decideRefusal = (res, json, fallback) => res && !res.ok && res.status !== 408 && typeof json?.error === 'string' && typeof json?.message === 'string'
|
||||
? { code: json.error, message: json.message } : { code: fallback, message: DECIDE_FALLBACK[fallback] };
|
||||
async function decide(step) {
|
||||
const a = answer;
|
||||
if (!a || a.pending || a.result) return;
|
||||
if (step === 'cancel') { a.confirm = null; a.error = null; paintDecide('[data-decide="approve"]'); announce('Cancelled. Nothing was answered.'); return; }
|
||||
if (out()) { a.confirm = null; a.error = { code: 'sign-in-required', message: 'Sign in again before answering.' }; paintDecide('#decide-status'); return; }
|
||||
if (step === 'approve' || step === 'deny') {
|
||||
const choice = a.console[step].key;
|
||||
a.pending = step; a.error = null; a.confirm = null; paintDecide();
|
||||
const { res, json } = await decidePost(`/api/decisions/${enc(a.id)}/confirmation`, { choice });
|
||||
a.pending = null;
|
||||
// The page moved to another decision meanwhile: its confirmation is dropped, never shown.
|
||||
if (answer !== a) { if (res?.type === 'opaqueredirect') signOut(); return; }
|
||||
if (res?.type === 'opaqueredirect') { a.error = { code: 'sign-in-required', message: 'Sign in again before answering.' }; paintDecide('#decide-status'); signOut(); return; }
|
||||
if (res?.ok && json?.id === a.id && json.action === step && json.choice === choice && typeof json.confirmation === 'string' && json.grant && typeof json.grant.method === 'string') {
|
||||
a.confirm = json; paintDecide('[data-decide="confirm"]'); announce(`Confirm ${step}: ${json.text}`);
|
||||
} else { a.error = decideRefusal(res, json, 'confirmation-unavailable'); paintDecide('#decide-status'); announce(`Not answered: ${a.error.message}`); }
|
||||
return;
|
||||
}
|
||||
if (step !== 'confirm' || !a.confirm) return;
|
||||
const c = a.confirm;
|
||||
a.pending = 'confirm'; a.error = null; paintDecide();
|
||||
const { res, json } = await decidePost(`/api/decisions/${enc(a.id)}/resolve`, { choice: c.choice, confirmation: c.confirmation });
|
||||
// One use, whatever came back.
|
||||
a.pending = null; a.confirm = null;
|
||||
if (answer !== a) { if (res?.type === 'opaqueredirect') signOut(); else render(false); return; }
|
||||
if (res?.type === 'opaqueredirect') { a.error = { code: 'sign-in-required', message: 'Sign in again before answering. The sign-in proxy redirected the answer, so it never reached the Console.' }; paintDecide('#decide-status'); signOut(); return; }
|
||||
if (res?.ok && json?.id === a.id && json.op === 'resolved' && json.choice === c.choice) {
|
||||
a.result = { action: c.action, choice: c.choice, text: c.text, grant: json.grant ?? null };
|
||||
paintDecide('#decide-status'); announce(c.action === 'approve' ? 'Approved' : 'Denied'); render(false);
|
||||
} else { a.error = decideRefusal(res, json, 'outcome-unknown'); paintDecide('#decide-status'); announce(`Not answered: ${a.error.message}`); }
|
||||
}
|
||||
async function inboxView(get) {
|
||||
// The broker orders gated first, then oldest; lift blocking ones to the top.
|
||||
const rows = (await get('inbox')).slice().sort((a, b) => (b.blocking - a.blocking) || String(a.at).localeCompare(String(b.at)));
|
||||
countInbox(rows);
|
||||
const body = rows.length ? `<ul class="waiting s1-decs">${rows.map(decisionCard).join('')}</ul>` : empty('Nothing is waiting on you.', 'A decision shows here when an agent raises one routed to you through the bus.');
|
||||
return `${head('Inbox', `${readNote()} Decisions are answered in a terminal with <code>mosaic decide</code>; Console only shows them.`)}
|
||||
const answered = canDecide ? 'A grant request can be approved or denied here, after a confirmation. Every other decision is answered in a terminal with <code>mosaic decide</code>.'
|
||||
: 'Decisions are answered in a terminal with <code>mosaic decide</code>; Console only shows them.';
|
||||
return `${head('Inbox', `${readNote()} ${answered}`)}
|
||||
${await composer(get)}
|
||||
<h2 id="b-for-you">For you <span class="count">${rows.length}</span></h2>${body}
|
||||
<p class="small muted">Not shown here yet: ${gap('Decisions routed to roles')} ${gap('Closed decisions')} ${gap('Seen and DM state per row')} Open a decision for its seen, DM and closing history.</p>`;
|
||||
@@ -343,6 +434,13 @@
|
||||
// A command is offered only for an open decision routed to the human, and only when
|
||||
// the id and key pass the broker's identifier rule, so the copied text is safe to paste.
|
||||
const answerable = !c && d.routeTo === 'human';
|
||||
// Row 252: the answer panel follows this decision. A refresh keeps a confirmation open; a
|
||||
// decision no longer eligible (closed elsewhere, say) drops it, unless an answer is in flight
|
||||
// or this page just answered it.
|
||||
const eligible = canDecide && answerable && open?.console ? open.console : null;
|
||||
if (answer?.id !== d.id) answer = eligible ? { id: d.id, console: eligible, pending: null, confirm: null, error: null, result: null } : null;
|
||||
else if (eligible && !answer.pending && !answer.confirm) answer.console = eligible;
|
||||
else if (!eligible && !answer.pending && !answer.result) answer = null;
|
||||
const options = `<ol class="s1-opts">${d.options.map(o => {
|
||||
const cmd = `mosaic decide ${d.id} ${o.key}`, chosen = c?.choice === o.key, approving = d.authorization?.approvalChoice === o.key;
|
||||
const copy = !answerable ? '' : SAFE.test(String(d.id)) && SAFE.test(String(o.key))
|
||||
@@ -352,11 +450,18 @@
|
||||
}).join('')}</ol>`;
|
||||
const earlier = await chain(get, d);
|
||||
const history = [...d.seen.map(s => `<li>Seen by ${txt(s.by)}${s.via ? ` via ${txt(s.via)}` : ''} ${when(s.at)}</li>`), ...(c ? [`<li>${esc(c.op)} by ${txt(c.by)}${c.via ? ` via ${txt(c.via)}` : ''} ${when(c.at)}</li>`] : [])];
|
||||
const help = answerable ? '<p class="small muted">To answer, run one of these in a terminal. Copy only puts the command on your clipboard. Console sends nothing.</p>'
|
||||
// Without SSO, or under SSO without --send, the Console says why it has no buttons and never
|
||||
// draws a disabled one (design section 5).
|
||||
const why = !answerable || isTester || canDecide ? ''
|
||||
: ssoOn ? ' This Console is read-only for decisions: it was started without writes enabled (--send), so answers go through a terminal.'
|
||||
: ' Answering a grant request from the Console needs sign-in (--sso) and writes enabled (--send).';
|
||||
const help = eligible ? '<p class="small muted">Approve or Deny in the panel above, or run one of these in a terminal. Copy only puts the command on your clipboard.</p>'
|
||||
: answerable ? `<p class="small muted">To answer, run one of these in a terminal. Copy only puts the command on your clipboard. Console sends nothing.${why}</p>`
|
||||
: !c ? `<p class="small muted">This decision is routed to ${txt(d.routeTo)}, not to you, so Console offers no command for it.</p>` : '';
|
||||
return `${head(`Decision ${txt(short(d.id))}`, status)}
|
||||
<section aria-labelledby="b-q" class="panel"><h2 id="b-q">Question</h2><p class="s1-q">${txt(d.question)}</p>
|
||||
<dl class="kv"><dt>Class</dt><dd>${chip(d.class, d.action)}${d.blocking ? ` ${blockChip('blocking')}` : ''}</dd><dt>Approval</dt><dd class="s1-auth">${approves(d.authorization)}</dd><dt>Routed to</dt><dd>${txt(d.routeTo)}</dd><dt>Raised by</dt><dd>${txt(d.raisedBy.role)} <span class="source">${txt(d.raisedBy.run)}</span></dd><dt>Raised</dt><dd>${when(d.at)}</dd>${d.taskRef ? `<dt>Task</dt><dd>${taskLink(d.taskRef)} <span class="source">${txt(d.taskRef)}</span></dd>` : ''}${d.requirementRef ? `<dt>Requirement</dt><dd>${txt(d.requirementRef)}</dd>` : ''}<dt>DM</dt><dd>${d.dm ? `sent ${when(d.dm.at)}` : d.blocking ? 'not sent' : 'not needed (not blocking)'}</dd><dt>Id</dt><dd><code>${txt(d.id)}</code></dd></dl></section>
|
||||
${answer?.id === d.id ? decideHtml() : ''}
|
||||
<section aria-labelledby="b-o"><h2 id="b-o">Options</h2>${help}${options}<p class="small muted" id="copy-status"></p></section>
|
||||
<section aria-labelledby="b-c"><h2 id="b-c">Earlier versions</h2>${earlier.length ? `<ul class="s1-plain">${earlier.map(x => `<li><a href="#/inbox/${enc(x.id)}">${txt(short(x.id))}</a> ${badge(x.closed ? x.closed.op : 'open')} ${txt(first(x.question))}${x.closed?.note ? `<span class="source">${txt(x.closed.note)}</span>` : ''}</li>`).join('')}</ul>` : '<p class="muted">None.</p>'}<p class="small muted">${gap('A later version that replaces this one')}</p></section>
|
||||
<section aria-labelledby="b-h"><h2 id="b-h">History</h2>${history.length ? `<ul class="s1-plain">${history.join('')}</ul>` : '<p class="muted">Not seen yet.</p>'}<p><a href="#/trail/decision/${enc(d.id)}">Full trail for this decision</a></p></section>`;
|
||||
@@ -1098,6 +1203,7 @@
|
||||
return {
|
||||
href: view.contains(a) ? a.getAttribute('href') : null, copy: view.contains(a) ? a.dataset?.copy : null, retry: view.contains(a) && a.hasAttribute?.('data-retry'), mirror: view.contains(a) ? a.dataset?.mirror : null, h1: view.contains(a) && a.tagName === 'H1',
|
||||
field: view.contains(a) ? a.dataset?.field : null, caret: view.contains(a) && a.tagName === 'TEXTAREA' ? [a.selectionStart, a.selectionEnd, a.scrollTop] : null, send: view.contains(a) && a.hasAttribute?.('data-send'),
|
||||
decide: view.contains(a) ? a.dataset?.decide ?? (a.id === 'decide-status' ? 'status' : null) : null,
|
||||
open: [...view.querySelectorAll('details[id]')].filter(d => d.open).map(d => d.id), status: $('copy-status')?.textContent || '',
|
||||
};
|
||||
}
|
||||
@@ -1105,7 +1211,10 @@
|
||||
for (const id of k.open) { const d = $(id); if (d) d.open = true; }
|
||||
if ($('copy-status')) $('copy-status').textContent = k.status;
|
||||
const el = [...$('bus-view').querySelectorAll('a[href],[data-copy],[data-retry],[data-mirror],[data-field],[data-send]')].find(e => k.href ? e.getAttribute('href') === k.href : k.copy ? e.dataset.copy === k.copy : k.mirror ? e.dataset.mirror === k.mirror : k.field ? e.dataset.field === k.field : k.send ? e.hasAttribute('data-send') : k.retry && e.hasAttribute('data-retry'));
|
||||
if (el && (k.href || k.copy || k.retry || k.mirror || k.field || k.send)) {
|
||||
// Row 252: the answer panel's buttons and its status line.
|
||||
const dec = k.decide ? $('bus-view').querySelector(k.decide === 'status' ? '#decide-status' : `[data-decide="${k.decide}"]`) : null;
|
||||
if (dec) dec.focus({ preventScroll: true });
|
||||
else if (el && (k.href || k.copy || k.retry || k.mirror || k.field || k.send)) {
|
||||
el.focus({ preventScroll: true });
|
||||
if (k.caret && el.tagName === 'TEXTAREA') { el.setSelectionRange(k.caret[0], k.caret[1]); el.scrollTop = k.caret[2]; }
|
||||
}
|
||||
@@ -1197,6 +1306,9 @@
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Row 252: Approve, Deny, Confirm and Cancel. One click is one step; none repeats itself.
|
||||
const dec = e.target.closest('#decide-section [data-decide]');
|
||||
if (dec) { if (!dec.disabled) decide(dec.dataset.decide); return; }
|
||||
if (e.target.closest('#toast [data-dismiss]')) { toast(null); return; }
|
||||
const item = e.target.closest('#cmdk-list [data-href]');
|
||||
if (item) { pkGo(item.dataset.href); return; }
|
||||
@@ -1318,12 +1430,14 @@
|
||||
isTester = c?.tester === true;
|
||||
canEdit = !isTester && c?.edit === true;
|
||||
canSend = !isTester && c?.send === true;
|
||||
ssoOn = c?.sso === true;
|
||||
canDecide = !isTester && c?.decide === true;
|
||||
if (isTester) {
|
||||
const banner = document.createElement('div'); banner.id = 'tester-banner'; banner.className = 'banner ref';
|
||||
banner.setAttribute('role', 'status'); banner.textContent = 'Tester Console. Changes are recorded as tester, never as the human.';
|
||||
$('main').prepend(banner);
|
||||
}
|
||||
if (!canSend && !isTester) return;
|
||||
if (!canSend && !isTester && !ssoOn) return;
|
||||
const path = routeOf().split('?')[0];
|
||||
if (path.startsWith('/chat')||path.startsWith('/inbox')||path==='/settings'||path.startsWith('/docs/')) render(false); else if (path === '/' || path === '') paintHeld(heldErr);
|
||||
}).catch(() => {});
|
||||
|
||||
@@ -23,3 +23,20 @@
|
||||
.chat-session-controls label { display: block; }
|
||||
.chat-session-controls select, .chat-session-controls input { max-width: 100%; }
|
||||
.chat-session-controls form { margin: .6rem 0; }
|
||||
|
||||
/* Row 225 (C2-10b, design 7.4): a reply's cites, a write notice and the library status line. The
|
||||
badge and labels are text, so they read the same without colour. */
|
||||
.chat-cites { list-style: none; margin: .5rem 0 0; padding-inline-start: 1rem; display: grid; gap: .35rem; }
|
||||
.chat-log .chat-cites li { padding: 0; border-bottom: 0; overflow-wrap: anywhere; font-size: .92rem; }
|
||||
.chat-cites code { font-family: var(--mono); font-size: .85rem; }
|
||||
.chat-scope, .chat-label { display: inline-block; padding: 0 .4rem; border: 1px solid var(--line); border-radius: var(--r); font-size: .78rem; }
|
||||
.chat-scope-canon { border-color: var(--success); color: var(--success); }
|
||||
.chat-scope-playground { border-color: var(--accent); color: var(--accent); }
|
||||
.chat-scope-web { border-color: var(--action); color: var(--action); }
|
||||
.chat-agent-written { color: var(--muted); }
|
||||
.chat-changed { border-color: var(--warning); color: var(--warning); }
|
||||
.chat-notice { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; white-space: normal; }
|
||||
.chat-revert-receipt { overflow-wrap: anywhere; }
|
||||
.chat-library { font-size: .9rem; margin-block: .5rem; overflow-wrap: anywhere; }
|
||||
.chat-library p { margin: 0; }
|
||||
.chat-library-problems ul { margin: .4rem 0 0; padding-inline-start: 1.25rem; }
|
||||
@@ -17,11 +17,22 @@
|
||||
if (!forms.has(key)) forms.set(key, { name: '', repo: '', instance: '', instanceChosen: false, receipt: '', pending: false });
|
||||
return forms.get(key);
|
||||
};
|
||||
// Row 225 (C2-10b, design 7.4): a reply renders through the library's renderReply, the one renderer the
|
||||
// Discord relay shares. Until it loads, or if it can't, a body shows as its text. Badges, the
|
||||
// agent-written label and "changed since" come from the bus's stored check (C2-06), never the body.
|
||||
const SHA = /^[0-9a-f]{40}$/, CODE = /^[a-z][a-z-]{0,63}$/, NAME = /^[A-Za-z0-9][A-Za-z0-9._/-]{0,200}$/;
|
||||
// The library verbs name the business project, which is the chat project's repository link. These
|
||||
// codes mean that repository is no library, or this page may not read it: no status line at all.
|
||||
const NO_LIBRARY = ['project-not-declared', 'project-not-configured', 'not-configured', 'owner-only'];
|
||||
const libraryOf = (c, t) => { const repo = c?.projects.find(p => p.id === t?.project)?.repo; return typeof repo === 'string' && NAME.test(repo) ? repo : null; };
|
||||
let renderReply = null;
|
||||
import('/render.mjs').then(m => { renderReply = m.renderReply; if (current && !out()) paint(); }, () => {});
|
||||
const libraries = new Map(), reverts = new Map();
|
||||
class ChatError extends Error {
|
||||
constructor(code, status = 0, sent) { super(code); this.code = code; this.status = status; this.sent = sent; }
|
||||
}
|
||||
function forget() {
|
||||
generation++; controller?.abort(); states.clear(); forms.clear();
|
||||
generation++; controller?.abort(); states.clear(); forms.clear(); libraries.clear(); reverts.clear();
|
||||
if (current) current.container.replaceChildren();
|
||||
current = null;
|
||||
}
|
||||
@@ -80,11 +91,93 @@
|
||||
const reason = !Number.isSafeInteger(selected?.revision) ? 'Safe clear is unavailable until its dependency is installed.' : '';
|
||||
return `<section class="chat-session-controls" aria-label="Sessions"><label>Session<select id="chat-session">${c.sessions.map(r => `<option value="${esc(r.id)}"${r.id === c.session ? ' selected' : ''}>${txt(r.name)}${r.default ? ' (default)' : ''} — ${txt(r.state ?? 'status unavailable')}</option>`).join('')}</select></label><p id="chat-compactions">Compactions: ${txt(countLabel(selected?.compactions))}</p><p>${txt(selected?.state ?? 'Session status unavailable')}${UUID.test(selected?.successor) ? ` · <a href="${sessionPath(t.id, selected.successor)}">Open fresh successor</a>` : ''}</p><form id="chat-session-form" class="chat-create" data-key="session:${esc(t.id)}"><label>New session name<input id="chat-session-name" data-chat-field="name" value="${esc(f.name)}" maxlength="200" required${disabled(f.pending)}></label><button class="btn" type="submit"${disabled(f.pending)}>New session</button><p role="status">${txt(f.receipt)}</p></form><button class="btn" type="button" id="chat-clear"${disabled(clear.pending || !!reason || selected?.state && selected.state !== 'active')}>Clear context</button>${reason ? `<p>${txt(reason)}</p>` : ''}<p id="chat-clear-receipt" role="status">${txt(clear.receipt)}</p><form id="chat-operation-form"><label>Check clear operation<input id="chat-operation" value="${esc(clear.op ?? '')}" maxlength="160"${clear.pending ? ' disabled' : ''}></label><button class="btn" type="submit">Check status</button><button class="btn" type="button" id="chat-cancel"${disabled(clear.pending || !!reason || !clear.op || ['cancelled', 'failed'].includes(clear.record?.state) || clear.record?.start === 'started')}>Cancel clear</button></form></section>`;
|
||||
}
|
||||
// A cite is changed when the file's last commit at the served tip (`last`, read with the page) is not
|
||||
// its last commit at the cited one (`file`, stored with the check). Either one missing marks nothing.
|
||||
const changedBy = check => (cite, i) => {
|
||||
const e = Array.isArray(check?.citations) ? check.citations[i] : null;
|
||||
return SHA.test(e?.file ?? '') && SHA.test(e?.last ?? '') && e.file !== e.last;
|
||||
};
|
||||
function cites(list) {
|
||||
return `<ul class="chat-cites">${list.map(c => `<li>${c.badge ? `<span class="chat-scope chat-scope-${c.badge}">${txt(c.badge)}</span> ` : ''}${c.link ? `<a href="${esc(c.link)}" rel="noopener noreferrer" target="_blank">${txt(c.ref)}</a>` : `<code>${txt(c.ref)}</code>`} <q>${txt(c.quote)}</q>${c.agent ? ` <span class="chat-label chat-agent-written">agent-written: ${txt(c.agent)}</span>` : ''}${c.changed ? ' <span class="chat-label chat-changed">changed since</span>' : ''}</li>`).join('')}</ul>`;
|
||||
}
|
||||
function messageBody(m) {
|
||||
const r = renderReply?.(m.body, { check: m.check ?? null, name: m.from_role, changed: changedBy(m.check) });
|
||||
if (r?.kind === 'reply') return `<div class="chat-body">${txt(r.text)}</div>${r.citations.length ? cites(r.citations) : ''}`;
|
||||
if (r?.kind === 'notice') {
|
||||
const v = reverts.get(r.commit) ?? {};
|
||||
return `<div class="chat-body chat-notice"><span>${txt(r.text)}</span> <button class="btn" type="button" data-revert="${esc(r.commit)}"${disabled(v.pending)}>Revert</button> <span class="chat-revert-receipt" role="status">${txt(v.receipt ?? '')}</span></div>`;
|
||||
}
|
||||
return `<div class="chat-body">${txt(m.body)}</div>`;
|
||||
}
|
||||
const ago = iso => {
|
||||
const minutes = Math.floor((Date.now() - Date.parse(iso)) / 60000);
|
||||
return !Number.isFinite(minutes) ? 'at an unknown time' : minutes < 1 ? 'just now' : minutes < 60 ? `${minutes} min ago` : minutes < 2880 ? `${Math.floor(minutes / 60)} h ago` : `${Math.floor(minutes / 1440)} days ago`;
|
||||
};
|
||||
// library.status (C2-04): the served commit and when it was last fetched, a held divergence, the last
|
||||
// fetch error, the reply limits in force (C2-06) and the R-problems, listed one click away.
|
||||
function libraryLine(project) {
|
||||
const l = libraries.get(project);
|
||||
if (!l || l.hidden) return '';
|
||||
if (l.error) return `<div class="chat-library"><p role="status">Library status unavailable (${txt(l.error)}).</p></div>`;
|
||||
const v = l.value, parts = [];
|
||||
parts.push(SHA.test(v.served ?? '') ? `Library at <code>${txt(v.served.slice(0, 7))}</code>` : 'Library not served yet');
|
||||
if (typeof v.lastFetch === 'string') parts.push(`fetched ${txt(ago(v.lastFetch))}`);
|
||||
if (SHA.test(v.diverged?.commit ?? '')) parts.push(`<b>library-diverged</b> at <code>${txt(v.diverged.commit.slice(0, 7))}</code>`);
|
||||
if (CODE.test(v.lastError?.code ?? '')) parts.push(`fetch error <code>${txt(v.lastError.code)}</code>`);
|
||||
const limits = v.replyLimits;
|
||||
if (limits && typeof limits === 'object') {
|
||||
parts.push(`citations ${limits.requireCitation === true ? 'required' : 'optional'}${Number.isSafeInteger(limits.citationsPerReply) ? `, up to ${limits.citationsPerReply} per reply` : ''}`);
|
||||
const fell = Array.isArray(limits.fallback) ? limits.fallback.filter(k => typeof k === 'string') : [];
|
||||
if (fell.length) parts.push(`limits fell back: ${fell.map(k => `<code>${txt(k)}</code>`).join(', ')}`);
|
||||
if (CODE.test(limits.problem ?? '')) parts.push(`<code>${txt(limits.problem)}</code>`);
|
||||
}
|
||||
const problems = Array.isArray(v.problems) ? v.problems : [];
|
||||
if (!problems.length) parts.push('no problems');
|
||||
const list = problems.length ? `<details class="chat-library-problems"><summary>${problems.length} problem${problems.length === 1 ? '' : 's'}</summary><ul>${problems.map(p => `<li><code>${txt(p?.code)}</code> ${txt(p?.path)}${Number.isSafeInteger(p?.line) ? ':' + p.line : ''} ${txt(p?.message)}</li>`).join('')}</ul></details>` : '';
|
||||
return `<div class="chat-library"><p role="status">${parts.join(' · ')}</p>${list}</div>`;
|
||||
}
|
||||
async function loadLibrary(project, g, signal) {
|
||||
if (project === null) return;
|
||||
let entry;
|
||||
try {
|
||||
const res = await fetch('/api/library/status?project=' + encodeURIComponent(project), { cache: 'no-store', redirect: 'manual', signal });
|
||||
if (res.type === 'opaqueredirect' || res.status === 401) { signOut(); return; }
|
||||
const data = await res.json().catch(() => null);
|
||||
entry = res.ok && data && typeof data === 'object' && !Array.isArray(data) ? { value: data } : { error: CODE.test(data?.error ?? '') ? data.error : 'invalid-response' };
|
||||
} catch (err) {
|
||||
if (err.name === 'AbortError') return;
|
||||
entry = { error: 'unreachable' };
|
||||
}
|
||||
if (g !== generation || out()) return;
|
||||
libraries.set(project, NO_LIBRARY.includes(entry.error) ? { hidden: true } : entry);
|
||||
paint();
|
||||
}
|
||||
// design (writes): Revert is library.revert {commit}, her act. A refusal shows its code; before
|
||||
// C2-02's verb exists that is the bus's refusal of the verb.
|
||||
async function revert(commit) {
|
||||
const c = current, t = c?.threads.find(t => t.id === c.id), v = reverts.get(commit) ?? {};
|
||||
const project = libraryOf(c, t);
|
||||
if (!c || !c.canSend || out() || v.pending || !SHA.test(commit) || project === null) return;
|
||||
if (!window.confirm(`Revert ${commit.slice(0, 7)}? This makes a new commit in the library that puts the file back as it was before it.`)) return;
|
||||
const unknown = 'Outcome unknown. Read the library status before trying again; nothing was retried.';
|
||||
reverts.set(commit, { pending: true, receipt: 'Reverting…' }); paint();
|
||||
let receipt;
|
||||
try {
|
||||
const res = await fetch('/api/library/revert', { method: 'POST', cache: 'no-store', redirect: 'manual', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ project, commit }) });
|
||||
if (res.type === 'opaqueredirect' || res.status === 401) { signOut(); return; }
|
||||
const data = await res.json().catch(() => null);
|
||||
receipt = res.ok && SHA.test(data?.commit ?? '') ? `Reverted in ${data.commit.slice(0, 7)}.`
|
||||
: data?.sent === false && typeof data.error === 'string' ? `Not reverted (${inert(data.error.slice(0, 80))}).` : unknown;
|
||||
} catch { receipt = unknown; }
|
||||
if (out()) return;
|
||||
reverts.set(commit, { pending: false, receipt });
|
||||
if (current) { paint(); void loadLibrary(project, generation); }
|
||||
}
|
||||
function conversation(t) {
|
||||
const s = state(current.key);
|
||||
const messages = s.rows.map(m => `<li data-message="${esc(m.id)}"><div class="chat-message-meta"><strong>${txt(m.from_role)}</strong> ${stamp(m.at)}</div><div class="chat-body">${txt(m.body)}</div></li>`).join('');
|
||||
const messages = s.rows.map(m => `<li data-message="${esc(m.id)}"><div class="chat-message-meta"><strong>${txt(m.from_role)}</strong> ${stamp(m.at)}</div>${messageBody(m)}</li>`).join('');
|
||||
const receipt = s.receipt;
|
||||
return `<section class="chat-conversation" data-thread="${esc(t.id)}" data-session="${esc(current.session)}"><p>${link('projects', t.project, current.projects.find(p => p.id === t.project)?.name ?? 'Project')} / ${txt(t.instance)}</p>${heading(t.name)}${sessionControls(t)}<p class="muted">Reading never wakes the assistant. An accepted message is not an answer.</p><button class="btn" type="button" id="chat-resume"${disabledSession(s.pending)}>Resume assistant</button><ol class="chat-log" tabindex="0" aria-label="Thread conversation">${messages || '<li class="muted">No messages yet.</li>'}</ol><div class="chat-paging">${s.more ? '<p>Showing earlier history. Read forward to reach the current conversation.</p><button class="btn" type="button" id="chat-next">Read next messages</button>' : '<p class="muted">Caught up to the last read.</p>'}<button class="btn" type="button" id="chat-new"${s.follow ? ' hidden' : ''}>New messages — go to end</button></div><form id="chat-send-form"><label for="chat-body">Message this thread</label><textarea id="chat-body" rows="4"${disabledSession(s.pending)}>${esc(s.draft)}</textarea><button class="btn primary" type="submit"${disabledSession(s.pending)}>Send</button></form><p id="chat-receipt" role="status">${txt(receipt)}</p></section>`;
|
||||
return `<section class="chat-conversation" data-thread="${esc(t.id)}" data-session="${esc(current.session)}"><p>${link('projects', t.project, current.projects.find(p => p.id === t.project)?.name ?? 'Project')} / ${txt(t.instance)}</p>${heading(t.name)}${libraryLine(libraryOf(current, t))}${sessionControls(t)}<p class="muted">Reading never wakes the assistant. An accepted message is not an answer.</p><button class="btn" type="button" id="chat-resume"${disabledSession(s.pending)}>Resume assistant</button><ol class="chat-log" tabindex="0" aria-label="Thread conversation">${messages || '<li class="muted">No messages yet.</li>'}</ol><div class="chat-paging">${s.more ? '<p>Showing earlier history. Read forward to reach the current conversation.</p><button class="btn" type="button" id="chat-next">Read next messages</button>' : '<p class="muted">Caught up to the last read.</p>'}<button class="btn" type="button" id="chat-new"${s.follow ? ' hidden' : ''}>New messages — go to end</button></div><form id="chat-send-form"><label for="chat-body">Message this thread</label><textarea id="chat-body" rows="4"${disabledSession(s.pending)}>${esc(s.draft)}</textarea><button class="btn primary" type="submit"${disabledSession(s.pending)}>Send</button></form><p id="chat-receipt" role="status">${txt(receipt)}</p></section>`;
|
||||
}
|
||||
function capture() {
|
||||
if (!current) return null;
|
||||
@@ -233,7 +326,11 @@
|
||||
}
|
||||
} catch (err) { if (err.name === 'AbortError') return; }
|
||||
}
|
||||
if (g === generation) paint(navigated);
|
||||
if (g === generation) {
|
||||
paint(navigated);
|
||||
const t = kind === 'thread' ? current.threads.find(t => t.id === id) : null;
|
||||
if (t) void loadLibrary(libraryOf(current, t), g, signal);
|
||||
}
|
||||
} catch (err) {
|
||||
if (g !== generation || out() || err.name === 'AbortError' || err.code === 'signed-out') return;
|
||||
current.error = readError(err);
|
||||
@@ -340,6 +437,8 @@
|
||||
if (event.target.id === 'chat-cancel') void cancelClear();
|
||||
if (event.target.id === 'chat-clear') void clearContext();
|
||||
if (event.target.id === 'chat-next') void refresh(true);
|
||||
const revertButton = event.target.closest?.('[data-revert]');
|
||||
if (revertButton) void revert(revertButton.dataset.revert);
|
||||
if (event.target.id === 'chat-new') { state(current.key ?? current.id).tailRequested = true; state(current.key ?? current.id).follow = true; paint(); }
|
||||
});
|
||||
document.addEventListener('change', event => {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { ReadError, readStatus, fieldTable } from './reads.mjs';
|
||||
import { THREAD_DEFINITIONS } from '../../business/src/vocabulary.mjs';
|
||||
import { chatHTTP } from './chat-http.mjs';
|
||||
import { processingHTTP } from './processing-http.mjs';
|
||||
import { DECISION_ROUTE, decisionHTTP, decisionRefuse, createConfirmations } from './decision-http.mjs';
|
||||
|
||||
export const DEFAULT_BOARD = 'http://127.0.0.1:7331';
|
||||
export function isLoopback(host) {
|
||||
@@ -31,6 +32,8 @@ const files = new Map([
|
||||
...['app.js', 'brand.js', 'bus.js', 'markdown-preview.js', 'chat.js', 'processing.js', 'agents.js', 'federation.js'].map(f => ['/' + f, [f, 'text/javascript; charset=utf-8']]),
|
||||
...['shared/app.css', 'tokens.css', 'console.css', 'live.css', 'bus.css', 'shell.css', 'chat.css', 'processing.css'].map(f => ['/' + f, [f, 'text/css; charset=utf-8']]),
|
||||
['/editor.js', ['editor.js', 'text/javascript; charset=utf-8']],
|
||||
// Row 225 (C2-10b): the one reply renderer, shared with the Discord relay, imported by chat.js.
|
||||
['/render.mjs', ['../../../library/src/render.mjs', 'text/javascript; charset=utf-8']],
|
||||
['/editor.css', ['editor.css', 'text/css; charset=utf-8']],
|
||||
['/icons.svg', ['icons.svg', 'image/svg+xml']],
|
||||
...[400, 500, 600, 700].map(w => [`/assets/fonts/manrope-${w}.woff2`, [`assets/fonts/manrope-${w}.woff2`, 'font/woff2']]),
|
||||
@@ -41,6 +44,7 @@ const files = new Map([
|
||||
const USER_FILES = new Map([
|
||||
['/', ['user.html', 'text/html; charset=utf-8']],
|
||||
...['user.js', 'chat.js', 'federation.js'].map(f => ['/' + f, [f, 'text/javascript; charset=utf-8']]),
|
||||
['/render.mjs', files.get('/render.mjs')],
|
||||
...['tokens.css', 'console.css', 'chat.css'].map(f => ['/' + f, [f, 'text/css; charset=utf-8']]),
|
||||
...[...files].filter(([p]) => p.startsWith('/assets/fonts/') || p === '/icons.svg'),
|
||||
]);
|
||||
@@ -595,12 +599,55 @@ async function projectFileRead(res, read, path, search) {
|
||||
return json(res, busStatus(code), { error: code, message: err instanceof BusReadError ? err.message : code });
|
||||
}
|
||||
}
|
||||
// Row 225 (C2-10b, design 7.4): the chat's library status line and a write notice's Revert. The status
|
||||
// is a read like the file list. The revert is her write (C2-02's `library.revert`), with the save's
|
||||
// boundary: header user, exact Origin, same-origin Fetch Metadata, JSON, strict keys. Until the verb
|
||||
// exists the bus refuses it, and the page shows that code.
|
||||
const REVERT_KEYS = ['project', 'commit'];
|
||||
async function libraryRevertSend(req, res, { libraryRevert, preview, log }) {
|
||||
let target = null;
|
||||
const line = outcome => log(`${new Date().toISOString()} library-revert user=${JSON.stringify(preview.user)} project=${quoted(target?.project)} commit=${quoted(target?.commit)} ${outcome}`);
|
||||
const refuse = (status, error, message, sent = false) => { line(`error=${error}`); return json(res, status, { error, message, sent }); };
|
||||
if (!signedIn(req, preview)) return json(res, 401, { error: 'sign-in required', message: 'sign in again', sent: false });
|
||||
if (one(req, 'origin') !== ownOrigin(preview)) return refuse(403, 'cross-origin request refused', 'a revert needs the Console\'s own Origin');
|
||||
if (one(req, 'sec-fetch-site') !== 'same-origin') return refuse(403, 'cross-site request refused', 'a revert needs same-origin Fetch Metadata');
|
||||
let value;
|
||||
try { value = JSON.parse((await body(req)).toString('utf8')); } catch (err) { return refuse(400, 'invalid-request', err.message); }
|
||||
if (value === null || typeof value !== 'object' || Array.isArray(value) || Object.keys(value).length !== REVERT_KEYS.length ||!REVERT_KEYS.every(k => typeof value[k] === 'string') || !PATH_SHAPE.test(value.project) || !COMMIT.test(value.commit)) {
|
||||
return refuse(400, 'invalid-request', 'a revert takes a project and a 40-hex commit, nothing else');
|
||||
}
|
||||
target = value;
|
||||
let result;
|
||||
try { result = await libraryRevert({ project: value.project, commit: value.commit }); } catch (err) {
|
||||
const { code, sent } = sendOutcome(err);
|
||||
return sent === false
|
||||
? refuse(busStatus(code), code, `not reverted: the bus refused it (${code}).`)
|
||||
: refuse(503, 'outcome-unknown', 'the revert may have been made; nothing was retried. Read the library status before trying again', 'unknown');
|
||||
}
|
||||
if (!COMMIT.test(result?.commit) || result.project !== value.project || result.reverted !== value.commit || typeof result.path !== 'string') return refuse(503, 'outcome-unknown', 'the bus answered without the new commit; the revert may have been made', 'unknown');
|
||||
line(`commit=${result.commit}`);
|
||||
return json(res, 200, { project: value.project, path: result.path, reverted: result.reverted, commit: result.commit, at: new Date().toISOString() });
|
||||
}
|
||||
async function libraryStatusRead(res, read, search) {
|
||||
const query = new URLSearchParams(search);
|
||||
if ([...query.keys()].some(k => k !== 'project') || query.getAll('project').length !== 1 || !PATH_SHAPE.test(query.get('project')))
|
||||
return json(res, 400, { error: 'invalid-request', message: 'a library status read takes a project' });
|
||||
if (!read) return json(res, 503, { error: 'not-configured', message: 'the Console has no bus configured' });
|
||||
try {
|
||||
const result = await read({ project: query.get('project') });
|
||||
if (result === null || typeof result !== 'object' || Array.isArray(result) || result.project !== query.get('project')) throw new BusReadError('invalid-response');
|
||||
return json(res, 200, { ...result, at: new Date().toISOString() });
|
||||
} catch (err) {
|
||||
const code = err instanceof BusReadError ? err.code : 'invalid-response';
|
||||
return json(res, busStatus(code), { error: code, message: err instanceof BusReadError ? err.message : code });
|
||||
}
|
||||
}
|
||||
// `send` is the bus write (row 76): `args => Promise<{id}>`, only with the preview mode or `sso`.
|
||||
// `sso` is createSso() from sso.mjs (Q175 phase 1): the human listener signs people in itself.
|
||||
// `log` takes one line per send attempt that got past sign-in; never the body. `fieldsFile` is for
|
||||
// tests; the field table is otherwise the committed packages/tasks/fields.json.
|
||||
// `agentWrite` (row 194, D7) is `(verb, args) => Promise` for the Agents section's verbs and instance.request.
|
||||
export async function startServer({ host = '127.0.0.1', port = 7330, board = DEFAULT_BOARD, timeout = 20000, bus = null, reads = null, preview = null, sso = null, tester = false, testerSocket = null, testerAuthHeader = null, proof = null, testerProofHeader = null, send = null, settingsWrite = null, projectFiles = null, projectFile = null, projectSave = null, chat = null, nameWrite = null, assistantStop = null, instancesWrite = null, routesWrite = null, agentWrite = null, processing = null, userOptions = null, federation = null, log = line => console.log(line), fieldsFile = undefined } = {}) {
|
||||
export async function startServer({ host = '127.0.0.1', port = 7330, board = DEFAULT_BOARD, timeout = 20000, bus = null, reads = null, preview = null, sso = null, tester = false, testerSocket = null, testerAuthHeader = null, proof = null, testerProofHeader = null, send = null, settingsWrite = null, projectFiles = null, projectFile = null, projectSave = null, libraryStatus = null, libraryRevert = null, chat = null, nameWrite = null, assistantStop = null, instancesWrite = null, routesWrite = null, agentWrite = null, processing = null, decisionWrite = null, userOptions = null, federation = null, log = line => console.log(line), fieldsFile = undefined } = {}) {
|
||||
if (!isLoopback(host)) throw new Error('refusing to bind to non-loopback host');
|
||||
if (host === 'localhost') host = '127.0.0.1';
|
||||
if (tester && preview !== null) throw new Error('tester listener cannot use preview mode');
|
||||
@@ -608,14 +655,17 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF
|
||||
if (sso !== null && (preview !== null || proof !== null)) throw new Error('--sso cannot be combined with --auth-header, --allow-user or --proof-*');
|
||||
if (tester && host !== '127.0.0.1') throw new Error('tester listener must bind 127.0.0.1');
|
||||
// Row 177 (#1675): chat is allowed. The tester listener's chat binds the tester, so the bus keeps it on tester threads.
|
||||
if (tester && [send, settingsWrite, projectSave, assistantStop].some(value => value !== null)) throw new Error('tester listener permits only instance, route, name and chat writes');
|
||||
if (tester && [send, settingsWrite, projectSave, libraryRevert, assistantStop].some(value => value !== null)) throw new Error('tester listener permits only instance, route, name and chat writes');
|
||||
if (tester && !testerSocket) throw new Error('tester listener requires private socket');
|
||||
if (!tester && testerSocket) throw new Error('tester socket requires tester listener');
|
||||
// Row 252 (#1753, design section 4): Console decision answers need --sso and --send, never the tester.
|
||||
if (decisionWrite !== null && (tester || sso === null || send === null || typeof decisionWrite !== 'function')) throw new Error('Console decision answers need --sso and --send on the main listener');
|
||||
const confirmations = createConfirmations();
|
||||
const upstream = boardURL(board);
|
||||
// `userOptions` (FED R6, #1800) is `session => options`, the bus-backed options over that session
|
||||
// user's own transport (console-bus.mjs). Only a signed-in listener has user sessions.
|
||||
if (userOptions !== null && (sso === null || typeof userOptions !== 'function')) throw new Error('user sessions need --sso');
|
||||
const owner = { bus, reads, send, settingsWrite, projectFiles, projectFile, projectSave, chat, nameWrite, assistantStop, instancesWrite, routesWrite, agentWrite, processing, upstream, files };
|
||||
const owner = { bus, reads, send, settingsWrite, projectFiles, projectFile, projectSave, libraryStatus, libraryRevert, chat, nameWrite, assistantStop, instancesWrite, routesWrite, agentWrite, processing, upstream, files };
|
||||
const hub = federationView(federation);
|
||||
// An object with none of the three is refused too: asking for the preview never serves without it.
|
||||
if (preview !== null && !(preview = previewOptions({ publicHost: preview.host, authHeader: preview.header, allowUser: preview.user }))) {
|
||||
@@ -625,7 +675,7 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF
|
||||
if (send !== null && ((preview === null && sso === null) || typeof send !== 'function')) throw new Error('--send needs the preview mode (--public-host, --auth-header and --allow-user) or --sso');
|
||||
const server = createServer(async (req, res) => {
|
||||
// A granted user's request rebinds these below; every other request keeps the owner's.
|
||||
let { bus, reads, send, settingsWrite, projectFiles, projectFile, projectSave, chat, nameWrite, assistantStop, instancesWrite, routesWrite, agentWrite, processing, upstream, files } = owner, granted = false;
|
||||
let { bus, reads, send, settingsWrite, projectFiles, projectFile, projectSave, libraryStatus, libraryRevert, chat, nameWrite, assistantStop, instancesWrite, routesWrite, agentWrite, processing, upstream, files } = owner, granted = false;
|
||||
res.setHeader('x-content-type-options', 'nosniff');
|
||||
res.setHeader('referrer-policy', 'no-referrer');
|
||||
// Under --sso the Sign out form's POST is redirected to the provider's end-session endpoint, and
|
||||
@@ -669,25 +719,30 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF
|
||||
// alone stays open on a loopback Host for the status and release gates (Q-C).
|
||||
if (sso !== null && !named && !(path === '/healthz' && req.method === 'GET')) return json(res, 403, { error: 'public Host required' });
|
||||
// No CORS. JSON content type and same-origin checks keep browser forms out.
|
||||
if (req.headers.origin && req.headers.origin !== (named ? (sso ? sso.publicOrigin : `https://${preview.host}`) : `http://${req.headers.host}`)) return json(res, 403, { error: 'cross-origin request refused' });
|
||||
let signer = preview;
|
||||
const decisionPath = DECISION_ROUTE.test(path);
|
||||
if (req.headers.origin && req.headers.origin !== (named ? (sso ? sso.publicOrigin : `https://${preview.host}`) : `http://${req.headers.host}`))
|
||||
return decisionPath ? decisionRefuse(res, 'cross-origin') : json(res, 403, { error: 'cross-origin request refused' });
|
||||
let signer = preview, ssoSession = null;
|
||||
if (sso !== null && named) {
|
||||
if (path.startsWith('/auth/')) return sso.handle(req, res, path, search);
|
||||
// Only a page load or a write keeps a session alive; the page's background reads don't (Q-D).
|
||||
const session = path === '/healthz' ? null : sso.session(req, { touch: req.method === 'POST' || (req.method === 'GET' && !path.startsWith('/api/')) });
|
||||
if (!session && path !== '/healthz') {
|
||||
if (decisionPath) return decisionRefuse(res, 'sign-in-required');
|
||||
if (path.startsWith('/api/') || req.method !== 'GET') return json(res, 401, { error: 'sign-in required' });
|
||||
res.writeHead(303, { location: `/auth/login?return=${encodeURIComponent(path + search)}`, 'cache-control': 'no-store' });
|
||||
return res.end();
|
||||
}
|
||||
if (session) signer = { sso: true, user: session.name, host: sso.publicHost, origin: sso.publicOrigin };
|
||||
// Row 252: only the owner's session answers a decision. A granted user stops at userRoute below.
|
||||
if (session && session.user === undefined) ssoSession = session;
|
||||
// FED R6 (#1800): a granted user. The Console's gate first; behind it no human-transport
|
||||
// object is left, so a route past the gate reaches the broker only as this user.
|
||||
if (session?.user !== undefined) {
|
||||
if (!userRoute(path, req.method)) return json(res, 403, { error: 'owner-only', message: 'this part of the Console is the business owner\'s' });
|
||||
if (userOptions === null) return json(res, 503, { error: 'not-configured', message: 'the Console has no user transport' });
|
||||
({ bus, send, settingsWrite, projectFiles, projectFile, projectSave, chat, nameWrite, assistantStop, instancesWrite, routesWrite, agentWrite, processing } = userOptions(session));
|
||||
reads = null; upstream = null; files = USER_FILES; granted = true;
|
||||
reads = null; upstream = null; libraryStatus = null; libraryRevert = null; files = USER_FILES; granted = true;
|
||||
}
|
||||
}
|
||||
if (named && preview !== null) {
|
||||
@@ -696,6 +751,13 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF
|
||||
if (!values || values.length !== 1 || values[0] !== preview.user) return json(res, 401, { error: 'sign-in required' });
|
||||
}
|
||||
const writer = tester ? { tester: true, user: 'tester', origin: TESTER_ORIGIN } : signer;
|
||||
// Row 252: Approve and Deny. The tester listener never offers them. Anywhere else without a signed-in
|
||||
// session on the public name under --sso and --send, they are read-only.
|
||||
if (decisionPath) {
|
||||
if (tester) return decisionRefuse(res, 'not-found');
|
||||
const decide = decisionWrite && send && named && sso ? { call: decisionWrite, origin: sso.publicOrigin } : null;
|
||||
return decisionHTTP(req, res, { path, decide, session: ssoSession, live: () => sso.session(req), confirmations, log });
|
||||
}
|
||||
// Row 194 (#1692, D4.1): the tester also launches and terminates.
|
||||
if (tester && !['GET', 'HEAD'].includes(req.method) && !['/api/instances', '/api/routes', '/api/name', '/api/agent/launch', '/api/agent/terminate'].includes(path) && !TESTER_CHAT_WRITE.test(path))
|
||||
return json(res, 403, { error: 'read-only', sent: false });
|
||||
@@ -732,6 +794,11 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF
|
||||
if ((!tester && (!send || !named)) || !routesWrite) return json(res, 403, { error: 'read-only', sent: false });
|
||||
return routesSend(req, res, { routesWrite, preview: writer, log });
|
||||
}
|
||||
if (path === '/api/library/revert') {
|
||||
if (req.method !== 'POST') return json(res, 405, { error: 'method not allowed' });
|
||||
if (!send || !libraryRevert || !named) return json(res, 403, { error: 'read-only', sent: false });
|
||||
return libraryRevertSend(req, res, { libraryRevert, preview: signer, log });
|
||||
}
|
||||
if (path === '/api/project-file' && req.method === 'POST') {
|
||||
if (!send || !projectSave || !named) return json(res, 403, { error: 'read-only', sent: false });
|
||||
return projectFileSend(req, res, { projectSave, preview: signer, log });
|
||||
@@ -800,6 +867,10 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF
|
||||
if (req.method !== 'GET') return json(res, 405, { error: 'method not allowed' });
|
||||
return consoleRead(res, () => fieldTable(fieldsFile));
|
||||
}
|
||||
if (path === '/api/library/status') {
|
||||
if (req.method !== 'GET') return json(res, 405, { error: 'method not allowed' });
|
||||
return libraryStatusRead(res, libraryStatus, search);
|
||||
}
|
||||
if (path === '/api/project-files' || path === '/api/project-file') {
|
||||
if (req.method !== 'GET') return json(res, 405, { error: 'method not allowed' });
|
||||
return projectFileRead(res, path === '/api/project-file' ? projectFile : projectFiles, path, search);
|
||||
@@ -820,7 +891,7 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF
|
||||
// `send`: the page shows the composer only where a send can pass (the public name, --send on).
|
||||
// `edit`: the editor shows Save only where a save can pass, the same test as the route's.
|
||||
// `user` and `federation` (FED R6) only when there is one, so the owner's config is unchanged.
|
||||
if (path === '/api/config') return json(res, 200, { board: upstream, ...(tester ? { tester: true } : {}), ...(sso ? { sso: true } : {}), ...(granted ? { user: true } : {}), ...(hub ? { federation: hub } : {}), send: !tester && Boolean(send) && named, edit: !tester && !granted && Boolean(send) && Boolean(projectSave) && named });
|
||||
if (path === '/api/config') return json(res, 200, { board: upstream, ...(tester ? { tester: true } : {}), ...(sso ? { sso: true } : {}), ...(granted ? { user: true } : {}), ...(hub ? { federation: hub } : {}), send: !tester && Boolean(send) && named, decide: !tester && !granted && Boolean(send) && Boolean(decisionWrite) && named && sso !== null, edit: !tester && !granted && Boolean(send) && Boolean(projectSave) && named });
|
||||
if (path === '/healthz') return json(res, 200, { ok: true, ...(sso ? { sso: sso.health() } : {}) });
|
||||
if (path === '/favicon.ico') { res.writeHead(204); return res.end(); }
|
||||
const file = files.get(path);
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
// Row 225 (C2-10b, design 7.4): replies, cites, write notices and the library status line in the
|
||||
// Console chat. Fixture only: the chat and library answers are stubbed; /render.mjs is the real one.
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { startServer } from '../src/serve.mjs';
|
||||
import { fixture, close } from './fixture.mjs';
|
||||
import { browser } from './browser.mjs';
|
||||
const P = '10000000-0000-4000-8000-000000000001';
|
||||
const A = '20000000-0000-4000-8000-000000000002';
|
||||
const C1 = 'a'.repeat(40), C2 = 'b'.repeat(40), C3 = 'c'.repeat(40), C4 = 'd'.repeat(40);
|
||||
const HOSTILE = '<img src=x onerror="window.injected=1">';
|
||||
const cite = (path, lines, quote, commit = C1, extra = {}) => ({ path, commit, lines, quote, ...extra });
|
||||
const reply = (text, citations) => JSON.stringify({ text, citations });
|
||||
const row = (id, body, check, from = 'assistant') => ({ id: `5000000${id}-0000-4000-8000-000000000000`, from_role: from, at: '2026-10-23T18:00:00.000Z', body, ...(check === undefined ? {} : { check }) });
|
||||
const ROWS = [
|
||||
row(1, 'Plain text answer.', undefined, 'jason'),
|
||||
row(2, reply("Mara's eyes are grey.", [
|
||||
cite('Book One/Chapters/Chapter 03.md', [41, 41], 'her grey eyes', C1, { as: 'canon' }),
|
||||
cite('Book One/Playground/What If.md', [5, 6], 'a storm'),
|
||||
cite('Notes/Eyes.md', [9, 10], 'green eyes'),
|
||||
{ url: 'https://example.invalid/tides', quote: 'spring tides' },
|
||||
{ url: 'http://example.invalid/plain', quote: 'plain http' },
|
||||
{ url: 'javascript:window.injected=2', quote: 'script' },
|
||||
]), { citations: [
|
||||
{ scope: 'canon', agent: null, file: C1, last: C1 },
|
||||
{ scope: 'playground', agent: null, file: C2, last: C3 },
|
||||
{ scope: 'supporting', agent: 'acme/scribe', file: C2 },
|
||||
{ scope: 'web', agent: null }, { scope: 'web', agent: null }, { scope: 'web', agent: null },
|
||||
] }),
|
||||
row(3, reply('Unchecked.', [cite('Notes/Eyes.md', [1, 1], HOSTILE)])),
|
||||
row(4, JSON.stringify({ notice: 'library-write', op: 'write', path: 'Notes/Eyes.md', commit: C4 }), undefined, 'scribe'),
|
||||
];
|
||||
const STATUS = { project: 'books', version: 1, branch: 'main', served: C3, lastFetch: 'FIVE-MINUTES-AGO',
|
||||
lastError: { code: 'library-fetch-failed', at: '2026-10-23T18:00:00.000Z' }, diverged: { commit: C2, at: '2026-10-23T18:00:00.000Z' },
|
||||
problems: [{ code: 'R1', path: 'Notes/Eyes.md', message: 'no heading', line: 3 }, { code: 'R2', path: HOSTILE, message: 'bad name' }] };
|
||||
const stub = `(() => {
|
||||
const real = fetch.bind(window);
|
||||
window.__reverts=[];window.__revertAnswers=[];window.__statusReads=[];window.__confirms=[];
|
||||
window.__status={status:200,body:${JSON.stringify(STATUS)}};
|
||||
window.confirm=text=>{window.__confirms.push(text);return window.__confirm!==false;};
|
||||
window.fetch=async (url,init={})=>{
|
||||
const path=String(url), method=init.method||'GET';
|
||||
const answer=(value,status=200)=>new Response(JSON.stringify(value),{status,headers:{'content-type':'application/json'}});
|
||||
if(path==='/api/config')return answer({send:!location.search.includes('readonly')});
|
||||
if(path.startsWith('/api/bus/'))return answer({rows:[],unread:0,at:new Date().toISOString()});
|
||||
if(path==='/api/business')return answer({projects:['books']});
|
||||
if(path.startsWith('/api/library/status')){
|
||||
window.__statusReads.push(path);
|
||||
const body={...window.__status.body};
|
||||
if(body.lastFetch==='FIVE-MINUTES-AGO')body.lastFetch=new Date(Date.now()-330000).toISOString();
|
||||
return answer(body,window.__status.status);
|
||||
}
|
||||
if(path==='/api/library/revert'){
|
||||
window.__reverts.push({method,body:JSON.parse(init.body),headers:init.headers,redirect:init.redirect});
|
||||
const a=window.__revertAnswers.shift();if(!a)throw new Error('No revert answer');
|
||||
if(a.reject)throw new TypeError('network');
|
||||
return answer(a.body,a.status||200);
|
||||
}
|
||||
if(!path.startsWith('/api/chat'))return real(url,init);
|
||||
const data=value=>answer({...value,at:new Date().toISOString()});
|
||||
if(path==='/api/chat/instances')return data({rows:[{instance:'assistant',name:'assistant'}]});
|
||||
if(path==='/api/chat/projects')return data({rows:[{id:'${P}',name:'Books',repo:window.__repo===undefined?'books':window.__repo}]});
|
||||
if(path.endsWith('/sessions'))return data({rows:[{id:'${A}',name:'default',default:true}]});
|
||||
if(path.startsWith('/api/chat/threads')&&!path.includes('/messages'))return data({rows:[{id:'${A}',project:'${P}',name:'alpha',instance:'assistant'}]});
|
||||
return data({rows:${JSON.stringify(ROWS)},after:null,hasMore:false});
|
||||
};
|
||||
})();`;
|
||||
async function setup(t, { suffix = '', before = '' } = {}) {
|
||||
const f = await fixture(); t.after(() => f.close());
|
||||
const server = await startServer({ port: 0, board: f.boardURL }); t.after(() => close(server));
|
||||
const b = await browser(); t.after(() => b.close());
|
||||
await b.call('Page.addScriptToEvaluateOnNewDocument', { source: stub + before });
|
||||
await b.navigate(`http://127.0.0.1:${server.address().port}/${suffix}#/chat/threads/${A}`);
|
||||
const wait = expression => b.evaluate(`(async()=>{for(let i=0;i<100;i++){if(${expression})return;await new Promise(r=>setTimeout(r,30));}throw new Error(${JSON.stringify(expression)});})()`);
|
||||
const text = selector => b.evaluate(`document.querySelector(${JSON.stringify(selector)})?.textContent ?? null`);
|
||||
const message = n => `.chat-log > li:nth-child(${n})`;
|
||||
await wait('document.querySelector(".chat-cites")');
|
||||
return { b, wait, text, message };
|
||||
}
|
||||
|
||||
test('chat replies: free text, cites with badges, the agent label, changed since and safe links', async t => {
|
||||
const { b, text, message } = await setup(t);
|
||||
assert.equal(await text(`${message(1)} .chat-body`), 'Plain text answer.');
|
||||
assert.equal(await text(`${message(2)} .chat-body`), "Mara's eyes are grey.");
|
||||
const cites = await b.evaluate(`[...document.querySelectorAll(${JSON.stringify(message(2) + ' .chat-cites > li')})].map(li => ({
|
||||
badge: li.querySelector('.chat-scope')?.textContent ?? null, ref: (li.querySelector('a') ?? li.querySelector('code'))?.textContent,
|
||||
href: li.querySelector('a')?.getAttribute('href') ?? null, rel: li.querySelector('a')?.getAttribute('rel') ?? null,
|
||||
quote: li.querySelector('q').textContent, agent: li.querySelector('.chat-agent-written')?.textContent ?? null,
|
||||
changed: !!li.querySelector('.chat-changed') }))`);
|
||||
assert.deepEqual(cites, [
|
||||
{ badge: 'canon', ref: 'Book One/Chapters/Chapter 03.md:41 @aaaaaaa', href: null, rel: null, quote: 'her grey eyes', agent: null, changed: false },
|
||||
{ badge: 'playground', ref: 'Book One/Playground/What If.md:5-6 @aaaaaaa', href: null, rel: null, quote: 'a storm', agent: null, changed: true },
|
||||
// `last` absent: nothing is marked changed (sage-3596).
|
||||
{ badge: 'supporting', ref: 'Notes/Eyes.md:9-10 @aaaaaaa', href: null, rel: null, quote: 'green eyes', agent: 'agent-written: acme/scribe', changed: false },
|
||||
{ badge: 'web', ref: 'https://example.invalid/tides', href: 'https://example.invalid/tides', rel: 'noopener noreferrer', quote: 'spring tides', agent: null, changed: false },
|
||||
{ badge: 'web', ref: 'http://example.invalid/plain', href: null, rel: null, quote: 'plain http', agent: null, changed: false },
|
||||
{ badge: 'web', ref: 'javascript:window.injected=2', href: null, rel: null, quote: 'script', agent: null, changed: false },
|
||||
]);
|
||||
// A reply with no check result: no badge, no label, never changed; its quote is inert text.
|
||||
assert.equal(await b.evaluate(`document.querySelectorAll(${JSON.stringify(message(3) + ' .chat-scope, ' + message(3) + ' .chat-label')}).length`), 0);
|
||||
assert.equal(await text(`${message(3)} q`), HOSTILE);
|
||||
assert.equal(await b.evaluate('!!(document.querySelector(".chat-log img") || window.injected)'), false);
|
||||
});
|
||||
|
||||
test('chat replies: a write notice reads as its line with a Revert; a refused revert shows its code', async t => {
|
||||
const { b, wait, text, message } = await setup(t);
|
||||
assert.equal(await text(`${message(4)} .chat-notice > span`), 'scribe wrote Notes/Eyes.md @ddddddd');
|
||||
assert.equal(await b.evaluate(`document.querySelector(${JSON.stringify(message(4) + ' [data-revert]')}).dataset.revert`), C4);
|
||||
assert.equal(await b.evaluate('document.querySelectorAll("[data-revert]").length'), 1, 'only the notice has a Revert');
|
||||
// Cancelled at the confirm: nothing is sent.
|
||||
await b.evaluate('window.__confirm=false;document.querySelector("[data-revert]").click();true');
|
||||
assert.equal(await b.evaluate('window.__reverts.length'), 0);
|
||||
assert.match(await b.evaluate('window.__confirms[0]'), /^Revert ddddddd\?/);
|
||||
// Before C2-02 the bus refuses the verb; the page shows that code and doesn't retry.
|
||||
await b.evaluate(`window.__confirm=true;window.__revertAnswers.push({status:502,body:{error:'unknown-verb',message:'not reverted: the bus refused it (unknown-verb).',sent:false}});document.querySelector("[data-revert]").click();true`);
|
||||
await wait('document.querySelector(".chat-revert-receipt").textContent.startsWith("Not")');
|
||||
assert.equal(await text('.chat-revert-receipt'), 'Not reverted (unknown-verb).');
|
||||
assert.deepEqual(await b.evaluate('window.__reverts'), [{ method: 'POST', body: { project: 'books', commit: C4 }, headers: { 'content-type': 'application/json' }, redirect: 'manual' }]);
|
||||
for (const [answer, receipt] of [
|
||||
[{ status: 409, body: { error: 'library-revert-not-agent', sent: false } }, 'Not reverted (library-revert-not-agent).'],
|
||||
[{ status: 409, body: { error: 'stale-base', sent: false } }, 'Not reverted (stale-base).'],
|
||||
[{ status: 503, body: { error: 'outcome-unknown', sent: 'unknown' } }, 'Outcome unknown. Read the library status before trying again; nothing was retried.'],
|
||||
[{ reject: true }, 'Outcome unknown. Read the library status before trying again; nothing was retried.'],
|
||||
[{ body: { project: 'books', path: 'Notes/Eyes.md', reverted: C4, commit: C1 } }, 'Reverted in aaaaaaa.'],
|
||||
]) {
|
||||
const n = await b.evaluate('window.__reverts.length');
|
||||
await b.evaluate(`window.__revertAnswers.push(${JSON.stringify(answer)});document.querySelector("[data-revert]").click();true`);
|
||||
await wait(`window.__reverts.length===${n + 1} && !document.querySelector("[data-revert]").disabled`);
|
||||
assert.equal(await text('.chat-revert-receipt'), receipt);
|
||||
}
|
||||
assert.ok(await b.evaluate('window.__statusReads.length') >= 2, 'the status line is read again after a revert');
|
||||
});
|
||||
|
||||
test('chat replies: a read-only Console shows the notice with Revert disabled', async t => {
|
||||
const { b, message } = await setup(t, { suffix: '?readonly' });
|
||||
assert.equal(await b.evaluate(`document.querySelector(${JSON.stringify(message(4) + ' [data-revert]')}).disabled`), true);
|
||||
await b.evaluate('document.querySelector("[data-revert]").click();true');
|
||||
assert.equal(await b.evaluate('window.__reverts.length + window.__confirms.length'), 0);
|
||||
});
|
||||
|
||||
test('chat status line: served commit and age, divergence, fetch error and the problems one click away', async t => {
|
||||
const { b, wait, text } = await setup(t);
|
||||
await wait('document.querySelector(".chat-library")');
|
||||
assert.equal(await b.evaluate('window.__statusReads[0]'), '/api/library/status?project=books');
|
||||
assert.equal(await text('.chat-library [role=status]'), 'Library at ccccccc · fetched 5 min ago · library-diverged at bbbbbbb · fetch error library-fetch-failed');
|
||||
assert.equal(await text('.chat-library-problems summary'), '2 problems');
|
||||
assert.deepEqual(await b.evaluate('[...document.querySelectorAll(".chat-library-problems li")].map(li => li.textContent)'),
|
||||
['R1 Notes/Eyes.md:3 no heading', `R2 ${HOSTILE} bad name`]);
|
||||
assert.equal(await b.evaluate('!!document.querySelector(".chat-library img")'), false);
|
||||
});
|
||||
|
||||
test('chat status line: limits when the status carries them, no problems, and refusals', async t => {
|
||||
const limits = { ...STATUS, lastError: null, diverged: null, problems: [], replyLimits: { requireCitation: true, citationsPerReply: 4, fallback: ['citationsPerReply'], problem: null } };
|
||||
const { b, wait, text } = await setup(t, { before: `window.__status={status:200,body:${JSON.stringify(limits)}};` });
|
||||
await wait('document.querySelector(".chat-library")');
|
||||
assert.equal(await text('.chat-library [role=status]'), 'Library at ccccccc · fetched 5 min ago · citations required, up to 4 per reply · limits fell back: citationsPerReply · no problems');
|
||||
assert.equal(await b.evaluate('!!document.querySelector(".chat-library-problems")'), false);
|
||||
for (const [status, error, shown] of [[502, 'library-state-invalid', 'Library status unavailable (library-state-invalid).'], [502, 'Not A Code', 'Library status unavailable (invalid-response).'],
|
||||
[403, 'owner-only', null], [502, 'project-not-declared', null], [502, 'library-mapping-invalid', 'Library status unavailable (library-mapping-invalid).'], [503, 'project-not-configured', null], [503, 'not-configured', null]]) {
|
||||
await wait('!document.querySelector("#refresh").disabled');
|
||||
await b.evaluate(`window.__status={status:${status},body:{error:${JSON.stringify(error)}}};document.querySelector("#refresh").click();true`);
|
||||
await wait(`window.__statusReads.length && document.querySelector(".chat-conversation") && ${shown === null ? '!document.querySelector(".chat-library")' : `document.querySelector(".chat-library")?.textContent===${JSON.stringify(shown)}`}`);
|
||||
}
|
||||
});
|
||||
|
||||
test('chat status line: a project with no repository link reads no library status', async t => {
|
||||
const { b } = await setup(t, { before: 'window.__repo=null;' });
|
||||
assert.equal(await b.evaluate('window.__statusReads.length'), 0);
|
||||
assert.equal(await b.evaluate('!!document.querySelector(".chat-library")'), false);
|
||||
});
|
||||
|
||||
// Removing the nested problem display would hide the reason default limits are in force.
|
||||
test('chat status line: unreadable reply limits show their problem and both fallback keys', async t => {
|
||||
const limits = { ...STATUS, lastError: null, diverged: null, problems: [],
|
||||
replyLimits: { requireCitation: false, citationsPerReply: 8,
|
||||
fallback: ['requireCitation', 'citationsPerReply'], problem: 'reply-limits-unreadable' } };
|
||||
const { wait, text } = await setup(t, { before: `window.__status={status:200,body:${JSON.stringify(limits)}};` });
|
||||
await wait('document.querySelector(".chat-library")');
|
||||
assert.equal(await text('.chat-library [role=status]'), 'Library at ccccccc · fetched 5 min ago · citations optional, up to 8 per reply · limits fell back: requireCitation, citationsPerReply · reply-limits-unreadable · no problems');
|
||||
});
|
||||
|
||||
// Comparing commit to last would incorrectly mark the first cite; trusting missing file would
|
||||
// incorrectly mark the second. The third ensures malformed last never becomes a changed marker.
|
||||
test('chat replies: unchanged file at a different library commit and incomplete checks stay unmarked', async t => {
|
||||
const { b, wait } = await setup(t);
|
||||
await b.evaluate(`window.__checkOverride={citations:[{scope:'canon',agent:null,file:'${C2}',last:'${C2}'},
|
||||
{scope:'playground',agent:null,last:'${C3}'}, {scope:'supporting',agent:null,file:'${C2}',last:'bad'}]};true`);
|
||||
await b.evaluate(`const old=window.fetch;window.fetch=async(url,init)=>{const res=await old(url,init);
|
||||
if(!String(url).includes('/messages'))return res;
|
||||
const data=await res.json();data.rows[1].check=window.__checkOverride;
|
||||
return new Response(JSON.stringify(data),{headers:{'content-type':'application/json'}});
|
||||
};true`);
|
||||
await wait('!document.querySelector("#refresh").disabled');
|
||||
await b.evaluate('document.querySelector(".chat-area").dataset.beforeRefresh="yes";document.querySelector("#refresh").click();true');
|
||||
await wait('!document.querySelector(".chat-area")?.dataset.beforeRefresh && !document.querySelector("#refresh").disabled');
|
||||
assert.equal(await b.evaluate('document.querySelectorAll(".chat-changed").length'), 0);
|
||||
});
|
||||
|
||||
// Invalid configuration is a diagnostic, unlike an ordinary project with no library mapping.
|
||||
test('chat status line: an invalid library mapping remains visible for diagnosis', async t => {
|
||||
const { b, wait, text } = await setup(t, { before: "window.__status={status:502,body:{error:'library-mapping-invalid'}};" });
|
||||
await wait('window.__statusReads.length===1');
|
||||
assert.equal(await text('.chat-library [role=status]'), 'Library status unavailable (library-mapping-invalid).');
|
||||
assert.equal(await b.evaluate('window.__reverts.length'), 0);
|
||||
});
|
||||
@@ -0,0 +1,250 @@
|
||||
// Row 252 (#1753, design section 5, J16 and J17): Approve and Deny on a decision page, in a browser.
|
||||
// A loopback page has no sign-in, so a script added before the page loads sets `sso` and `decide`
|
||||
// in /api/config from the page URL, and answers each POST /api/decisions/... from a queue, recording
|
||||
// what the page sent. Server-side checks are decision-http.test.mjs's and the bus side is
|
||||
// packages/bus/tests/console-decide.test.mjs's. The decisions come from an in-process broker
|
||||
// through its reader session. Refresh timers fire after 150 ms.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { mkdtempSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { Store } from '../../bus/src/store.mjs';
|
||||
import { Broker } from '../../bus/src/broker.mjs';
|
||||
import { views } from '../../bus/src/views.mjs';
|
||||
import { grantDecision } from '../../bus/tests/host-fixtures.mjs';
|
||||
import { startServer } from '../src/serve.mjs';
|
||||
import { browser } from './browser.mjs';
|
||||
import { fixture, close } from './fixture.mjs';
|
||||
|
||||
const HOSTILE = '<script>window.injected=1</script><img src=x onerror="window.injected=2">';
|
||||
const businesses = { demo: { id: 'demo', human: 'jason', arbiters: { technical: 'pm', delivery: 'pm' }, roles: { chief: { authority: { withinRole: ['message.send'], crossRole: [] } }, pm: { authority: { withinRole: ['message.send'], crossRole: [] } } } } };
|
||||
|
||||
// Answers in order; `hold` waits for window.__release(), `reject` is a network failure, `redirect`
|
||||
// what fetch gives for the sign-in proxy's redirect under redirect: 'manual'.
|
||||
const STUB = `(() => {
|
||||
const real = window.fetch.bind(window);
|
||||
window.__posts = []; window.__answers = [];
|
||||
const timeout = window.setTimeout.bind(window);
|
||||
window.setTimeout = (f, ms, ...rest) => timeout(f, ms === 10000 ? 150 : ms, ...rest);
|
||||
const q = new URLSearchParams(location.search);
|
||||
const answer = (status, body) => new Response(JSON.stringify(body), { status, headers: { 'content-type': 'application/json' } });
|
||||
window.fetch = async (url, init = {}) => {
|
||||
const u = String(url);
|
||||
if (u === '/api/config') {
|
||||
const c = await (await real(url, init)).json();
|
||||
return answer(200, { ...c, ...(q.has('sso') ? { sso: true } : {}), ...(q.has('send') ? { send: true } : {}), ...(q.has('decide') ? { send: true, decide: true } : {}), ...(q.has('tester') ? { tester: true } : {}) });
|
||||
}
|
||||
if (!u.startsWith('/api/decisions/')) return real(url, init);
|
||||
window.__posts.push({ url: u, method: init.method, headers: init.headers, body: init.body, cache: init.cache, redirect: init.redirect });
|
||||
const a = window.__answers.shift();
|
||||
if (!a) throw new TypeError('no answer queued');
|
||||
if (a.hold) await new Promise(r => { window.__release = r; });
|
||||
if (a.reject) throw new TypeError('Failed to fetch');
|
||||
if (a.redirect) return { type: 'opaqueredirect', ok: false, status: 0, json: async () => { throw new SyntaxError('no body'); } };
|
||||
return answer(a.status, a.body);
|
||||
};
|
||||
})();`;
|
||||
|
||||
// The open grant request, as host-fixtures' grantDecision writes it but with the hostile question.
|
||||
// decisions is append-only (migration 3b), so the question goes in with the row, not by an UPDATE.
|
||||
function hostileGrant(store, grant) {
|
||||
const id = randomUUID(), at = '2026-10-21T00:00:00.000Z';
|
||||
store.run(
|
||||
'INSERT INTO decisions(id,at,business,raised_by_role,raised_by_run,class,action,route_to,question,options,recommendation,blocking) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)',
|
||||
id, at, 'demo', 'chief', 'chief-run', 'gated', 'credential.mint', 'human', `Enroll web1? ${HOSTILE}`,
|
||||
JSON.stringify([{ key: 'yes', text: 'Yes' }, { key: 'no', text: 'No' }]), 'yes', 0,
|
||||
);
|
||||
store.run(
|
||||
"INSERT INTO events(id,at,business,kind,actor_role,actor_run,subject,body) VALUES(?,?,?,'action.allowed',?,?,?,?)",
|
||||
randomUUID(), at, 'demo', 'chief', 'chief-run', id,
|
||||
JSON.stringify({ decision: id, action: 'credential.mint', operation: 'decision.raise', approvalChoice: 'yes', grant }),
|
||||
);
|
||||
return id;
|
||||
}
|
||||
|
||||
async function setup() {
|
||||
const root = mkdtempSync(join(tmpdir(), 'webui-decide-browser-'));
|
||||
const store = new Store(root), b0 = new Broker({ store, businesses });
|
||||
const grant = { method: 'host-enroll', host: 'web1', address: '192.0.2.10', port: 22, user: 'jarvis', sudo: true, fingerprints: [] };
|
||||
const open = hostileGrant(store, grant);
|
||||
const deploy = grantDecision(store, { action: 'deploy', grant, close: null });
|
||||
const bare = grantDecision(store, { close: null });
|
||||
const reader = b0.bindReader({ business: 'demo' });
|
||||
const bus = views({ call: async (verb, args = {}) => structuredClone(b0.request(reader, { verb, args })) });
|
||||
const f = await fixture(), b = await browser();
|
||||
const web = await startServer({ port: 0, board: f.boardURL, bus }), base = `http://127.0.0.1:${web.address().port}/`;
|
||||
await b.call('Page.addScriptToEvaluateOnNewDocument', { source: STUB });
|
||||
await b.viewport(1280);
|
||||
const wait = expr => b.evaluate(`(async()=>{for(let i=0;i<100;i++){if(${expr})return true;await new Promise(r=>setTimeout(r,50))}throw new Error('Condition timed out: '+${JSON.stringify(expr)})})()`);
|
||||
const text = sel => b.evaluate(`document.querySelector(${JSON.stringify(sel)})?.textContent ?? null`);
|
||||
const has = sel => b.evaluate(`!!document.querySelector(${JSON.stringify(sel)})`);
|
||||
const posts = () => b.evaluate('window.__posts');
|
||||
const queue = a => b.evaluate(`window.__answers.push(${JSON.stringify(a)}), true`);
|
||||
const click = step => b.evaluate(`document.querySelector('#decide-section [data-decide="${step}"]').click(), true`);
|
||||
const page = async (query, id) => {
|
||||
// The same URL again is a same-document hash change, not a load, so load about:blank first (as editor-browser does).
|
||||
await b.navigate('about:blank');
|
||||
await b.navigate(`${base}?${query}#/inbox/${id}`);
|
||||
await wait('document.querySelector("#bus-view h1")?.textContent.startsWith("Decision") && !document.querySelector("#bus-view [aria-busy]")');
|
||||
// The config read redraws once it lands; a refresh tick after it settles the page.
|
||||
await new Promise(r => setTimeout(r, 400));
|
||||
};
|
||||
const settle = () => new Promise(r => setTimeout(r, 600));
|
||||
const done = async () => { await b.close(); await close(web); await f.close(); store.close(); rmSync(root, { recursive: true, force: true }); };
|
||||
return { b, store, base, open, deploy, bare, wait, text, has, posts, queue, click, page, settle, done };
|
||||
}
|
||||
|
||||
const CONFIRM = (s, action, choice, text) => ({ status: 200, body: { id: s.open, question: `Enroll web1? ${HOSTILE}`, action, choice, text, grant: { method: 'host-enroll', host: 'web1' }, confirmation: 'c'.repeat(64) } });
|
||||
|
||||
test('J16: no controls without sso and decide, read-only reasons, terminal lines kept, and only an eligible grant gets the panel', { timeout: 120000 }, async () => {
|
||||
const s = await setup();
|
||||
try {
|
||||
// Without SSO: no panel, no button, and the reason names both flags.
|
||||
await s.page('x', s.open);
|
||||
assert.equal(await s.has('#decide-section'), false);
|
||||
assert.equal(await s.has('[data-decide]'), false);
|
||||
assert.match(await s.text('#bus-view'), /needs sign-in \(--sso\) and writes enabled \(--send\)/);
|
||||
assert.equal(await s.b.evaluate('document.querySelectorAll("#bus-view [data-copy]").length'), 2);
|
||||
// SSO without --send: read-only, still the terminal lines.
|
||||
await s.page('sso', s.open);
|
||||
assert.equal(await s.has('#decide-section'), false);
|
||||
assert.match(await s.text('#bus-view'), /read-only for decisions: it was started without writes enabled \(--send\)/);
|
||||
// send alone, without decide, still draws nothing.
|
||||
await s.page('sso&send', s.open);
|
||||
assert.equal(await s.has('#decide-section'), false);
|
||||
// A tester Console never answers, whatever the config says.
|
||||
await s.page('sso&decide&tester', s.open);
|
||||
assert.equal(await s.has('#decide-section'), false);
|
||||
// Eligible: the panel, both buttons, the escaped question and the terminal lines too.
|
||||
await s.page('sso&decide', s.open);
|
||||
assert.equal(await s.text('#decide-section h2'), 'Answer in Console');
|
||||
assert.deepEqual(await s.b.evaluate('[...document.querySelectorAll("#decide-section [data-decide]")].map(e => [e.dataset.decide, e.textContent, e.disabled])'), [['approve', 'Approve', false], ['deny', 'Deny', false]]);
|
||||
assert.match(await s.text('#decide-section'), /Grant: method host-enroll · host web1\./);
|
||||
assert.equal(await s.b.evaluate('document.querySelectorAll("#bus-view [data-copy]").length'), 2);
|
||||
assert.equal(await s.b.evaluate('window.injected ?? null'), null);
|
||||
assert.ok((await s.text('#bus-view .s1-q')).includes(HOSTILE));
|
||||
// A grant raise with another action, and a credential.mint with no grant, keep the terminal only.
|
||||
for (const id of [s.deploy, s.bare]) {
|
||||
await s.page('sso&decide', id);
|
||||
assert.equal(await s.has('#decide-section'), false);
|
||||
assert.equal(await s.has('[data-decide]'), false);
|
||||
}
|
||||
// The Inbox says so, and marks only the eligible row.
|
||||
await s.b.navigate(`${s.base}?sso&decide#/inbox`);
|
||||
await s.wait('document.querySelector("#bus-view h1")?.textContent.startsWith("Inbox") && document.querySelectorAll("#bus-view .s1-decs > li").length === 3');
|
||||
await s.settle();
|
||||
assert.match(await s.text('#bus-view'), /A grant request can be approved or denied here, after a confirmation\./);
|
||||
assert.equal(await s.b.evaluate('[...document.querySelectorAll("#bus-view .s1-decs > li")].filter(li => li.textContent.includes("Approve or Deny here")).length'), 1);
|
||||
assert.deepEqual(await s.posts(), []);
|
||||
} finally { await s.done(); }
|
||||
});
|
||||
|
||||
test('J17: one POST per click, confirm then answer, cancel, refusals and an unknown outcome never retry', { timeout: 120000 }, async () => {
|
||||
const s = await setup();
|
||||
const enc = encodeURIComponent;
|
||||
try {
|
||||
await s.page('sso&decide', s.open);
|
||||
|
||||
// Approve asks for a confirmation and answers nothing. The button holds while the request is out.
|
||||
await s.queue({ ...CONFIRM(s, 'approve', 'yes', 'Yes'), hold: true });
|
||||
await s.click('approve');
|
||||
await s.wait('document.querySelector("#decide-section [data-decide=approve]")?.textContent === "Checking…"');
|
||||
assert.equal(await s.b.evaluate('[...document.querySelectorAll("#decide-section [data-decide]")].every(e => e.disabled)'), true);
|
||||
await s.click('approve');
|
||||
await s.b.evaluate('window.__release(), true');
|
||||
await s.wait('document.querySelector("#decide-section [data-decide=confirm]")');
|
||||
let sent = await s.posts();
|
||||
assert.equal(sent.length, 1);
|
||||
assert.deepEqual(sent[0], { url: `/api/decisions/${enc(s.open)}/confirmation`, method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ choice: 'yes' }), cache: 'no-store', redirect: 'manual' });
|
||||
assert.equal(await s.text('#decide-section [data-decide=confirm]'), 'Confirm approve');
|
||||
assert.match(await s.text('#decide-section .s1-confirm'), /Approving starts this grant\./);
|
||||
assert.equal(await s.b.evaluate('document.activeElement?.dataset.decide ?? null'), 'confirm');
|
||||
assert.equal(await s.b.evaluate('window.injected ?? null'), null);
|
||||
|
||||
// A refresh keeps the confirmation open.
|
||||
await s.settle();
|
||||
assert.equal(await s.has('#decide-section [data-decide=confirm]'), true);
|
||||
|
||||
// Cancel drops it without a request.
|
||||
await s.click('cancel');
|
||||
await s.wait('document.querySelector("#decide-section [data-decide=approve]")');
|
||||
assert.equal((await s.posts()).length, 1);
|
||||
|
||||
// A refusal the Console wrote shows its code and message; a 408 or a lost answer is unavailable.
|
||||
await s.queue({ status: 409, body: { error: 'decision-stale', message: 'The choices changed. Review the decision again.' } });
|
||||
await s.click('deny');
|
||||
await s.wait('document.querySelector("#decide-status")');
|
||||
assert.equal(await s.text('#decide-status'), 'Not answered here: The choices changed. Review the decision again. (decision-stale).');
|
||||
await s.queue({ status: 408, body: { error: 'x', message: 'y' } });
|
||||
await s.click('deny');
|
||||
await s.wait('document.querySelector("#decide-status code")?.textContent === "confirmation-unavailable"');
|
||||
await s.queue({ reject: true });
|
||||
await s.click('deny');
|
||||
await s.wait('document.querySelectorAll("#decide-section [data-decide]:not([disabled])").length === 2');
|
||||
assert.equal(await s.b.evaluate('document.querySelector("#decide-status code")?.textContent'), 'confirmation-unavailable');
|
||||
assert.equal((await s.posts()).length, 4);
|
||||
|
||||
// A reply that doesn't match what was asked is not a confirmation.
|
||||
await s.queue({ status: 200, body: { ...CONFIRM(s, 'approve', 'yes', 'Yes').body } });
|
||||
await s.click('deny');
|
||||
await s.wait('document.querySelector("#decide-status code")?.textContent === "confirmation-unavailable" && document.querySelectorAll("#decide-section [data-decide]:not([disabled])").length === 2');
|
||||
assert.equal(await s.has('#decide-section [data-decide=confirm]'), false);
|
||||
|
||||
// An unknown outcome at the answer says to refresh, drops the confirmation and sends nothing again.
|
||||
await s.queue(CONFIRM(s, 'deny', 'no', 'No'));
|
||||
await s.click('deny');
|
||||
await s.wait('document.querySelector("#decide-section [data-decide=confirm]")');
|
||||
assert.match(await s.text('#decide-section .s1-confirm'), /Denying starts nothing\./);
|
||||
await s.queue({ status: 503, body: { error: 'outcome-unknown', message: 'The answer may have reached the bus. Refresh before trying again.' } });
|
||||
await s.click('confirm');
|
||||
await s.wait('document.querySelector("#decide-status code")?.textContent === "outcome-unknown"');
|
||||
assert.match(await s.text('#decide-status'), /Nothing was sent again\.$/);
|
||||
sent = await s.posts();
|
||||
assert.equal(sent.length, 7);
|
||||
assert.deepEqual(sent[6], { url: `/api/decisions/${enc(s.open)}/resolve`, method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ choice: 'no', confirmation: 'c'.repeat(64) }), cache: 'no-store', redirect: 'manual' });
|
||||
assert.equal(await s.has('#decide-section [data-decide=confirm]'), false);
|
||||
await s.settle();
|
||||
await s.settle();
|
||||
assert.equal((await s.posts()).length, 7, 'the page sent again by itself');
|
||||
|
||||
// A confirmed approve: one answer, a receipt, and no buttons after it, across refreshes.
|
||||
await s.queue(CONFIRM(s, 'approve', 'yes', 'Yes'));
|
||||
await s.click('approve');
|
||||
await s.wait('document.querySelector("#decide-section [data-decide=confirm]")');
|
||||
await s.queue({ status: 200, body: { id: s.open, op: 'resolved', choice: 'yes', grant: 'started' } });
|
||||
await s.click('confirm');
|
||||
await s.wait('document.querySelector("#decide-status")?.textContent.startsWith("Approved")');
|
||||
assert.equal(await s.text('#decide-status'), 'Approved: you chose “yes”, Yes. The grant executor started. History below shows it once the bus is read again.');
|
||||
await s.settle();
|
||||
assert.equal(await s.has('[data-decide]'), false);
|
||||
assert.equal((await s.posts()).length, 9);
|
||||
|
||||
// Closed elsewhere: the next read drops the panel and shows the recorded answer with its provenance.
|
||||
s.store.run('INSERT INTO decision_events(decision,at,op,by,choice,via) VALUES(?,?,?,?,?,?)', s.open, '2026-10-22T00:00:00.000Z', 'resolved', 'jason', 'yes', 'console');
|
||||
await s.page('sso&decide', s.open);
|
||||
assert.equal(await s.has('#decide-section'), false);
|
||||
assert.match(await s.text('#bus-view'), /Resolved: jason chose “yes” via console/);
|
||||
assert.equal(await s.b.evaluate('document.querySelectorAll("#bus-view [data-copy]").length'), 0);
|
||||
} finally { await s.done(); }
|
||||
});
|
||||
|
||||
test('a sign-in redirect at either step signs the page out and answers nothing', { timeout: 120000 }, async () => {
|
||||
const s = await setup();
|
||||
try {
|
||||
await s.page('sso&decide', s.open);
|
||||
await s.queue({ redirect: true });
|
||||
await s.click('approve');
|
||||
await s.wait('document.body.classList.contains("signed-out")');
|
||||
assert.equal((await s.posts()).length, 1);
|
||||
await s.page('sso&decide', s.open);
|
||||
await s.queue(CONFIRM(s, 'approve', 'yes', 'Yes'));
|
||||
await s.click('approve');
|
||||
await s.wait('document.querySelector("#decide-section [data-decide=confirm]")');
|
||||
await s.queue({ redirect: true });
|
||||
await s.click('confirm');
|
||||
await s.wait('document.body.classList.contains("signed-out")');
|
||||
assert.equal((await s.posts()).length, 2);
|
||||
} finally { await s.done(); }
|
||||
});
|
||||
@@ -0,0 +1,192 @@
|
||||
// Row 252 (#1753, design sections 4 and 5): the Console decision routes on the human listener, signed
|
||||
// in through the fake OP in helpers/fake-oidc.mjs on loopback. The bus transport is a recording stub,
|
||||
// so this covers the listener's gates and the session it passes; decision-http.test.mjs covers the
|
||||
// endpoint's own table and console-decide.test.mjs the bus. The public name is console.example.test,
|
||||
// sent only as a Host header to the test's own listener. sso.test.mjs pins its own log lines, so the
|
||||
// decide lines are checked here.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { request } from 'node:http';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { startServer } from '../src/serve.mjs';
|
||||
import { createSso, SESSION_COOKIE } from '../src/sso.mjs';
|
||||
import { DECISION_REFUSALS } from '../src/decision-http.mjs';
|
||||
import { consoleCall } from '../src/bus.mjs';
|
||||
import { consoleAccess } from '../src/access.mjs';
|
||||
import { userOptionsFor } from '../src/console-bus.mjs';
|
||||
import { close } from './fixture.mjs';
|
||||
import { fakeOidc } from './helpers/fake-oidc.mjs';
|
||||
|
||||
const HOST = 'console.example.test', ORIGIN = `https://${HOST}`;
|
||||
const DIGEST = 'b'.repeat(64);
|
||||
const PREVIEW = { id: 'd1', business: 'demo', question: 'Enroll web1?', digest: DIGEST, approve: { key: 'yes', text: 'Yes' }, deny: { key: 'no', text: 'No' }, grant: { method: 'host-enroll', host: 'web1' } };
|
||||
|
||||
// node:http, not fetch: fetch can't set Host, Origin or Sec-Fetch-Site.
|
||||
function call(port, { method = 'GET', path = '/', headers = {}, body, host = HOST } = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const length = body === undefined ? {} : { 'content-length': Buffer.byteLength(body) };
|
||||
const req = request({ host: '127.0.0.1', port, method, path, headers: { host, ...length, ...headers } }, res => {
|
||||
let text = '';
|
||||
res.on('data', c => (text += c));
|
||||
res.on('end', () => resolve({ status: res.statusCode, headers: res.headers, body: text && (res.headers['content-type'] ?? '').startsWith('application/json') ? JSON.parse(text) : text }));
|
||||
});
|
||||
req.on('error', reject);
|
||||
req.end(body);
|
||||
});
|
||||
}
|
||||
const writeHeaders = cookie => ({ ...(cookie ? { cookie } : {}), origin: ORIGIN, 'sec-fetch-site': 'same-origin', 'content-type': 'application/json' });
|
||||
|
||||
// The fake OP, createSso over it, and the human listener. `server` overrides startServer options.
|
||||
// The decision transport records each call and answers a preview or a resolve. `access`, when given,
|
||||
// is the access document: createSso gets the users hook and the listener a user transport, as
|
||||
// granted-user.test.mjs sets them up.
|
||||
async function setup(t, server = {}, access = null) {
|
||||
const op = await fakeOidc();
|
||||
t.after(() => op.close());
|
||||
const iss = op.issuer('a');
|
||||
const config = { publicOrigin: ORIGIN, providers: [{ id: 'a', issuer: iss.issuer, clientId: iss.clientId, clientSecret: { slot: 'a' }, algs: ['RS256'], subjects: [{ sub: 'user-a', name: 'person-a' }] }] };
|
||||
const lines = [];
|
||||
const users = access && { users: consoleAccess({ load: () => access, business: () => 'demo' }) };
|
||||
const sso = await createSso(config, { secrets: new Map([['a', iss.clientSecret]]), fetch: op.fetch, log: l => lines.push(l), ...users });
|
||||
t.after(() => sso.close());
|
||||
const calls = [];
|
||||
const decisionWrite = async (verb, args, ctx) => {
|
||||
calls.push({ verb, args, ctx });
|
||||
return verb === 'decision.preview.console' ? { ...PREVIEW } : { id: args.id, op: 'resolved', choice: args.choice };
|
||||
};
|
||||
const bus = Object.fromEntries(['inbox', 'tasks', 'agents', 'trail', 'decisions'].map(v => [v, async () => []]));
|
||||
const userOptions = access && { userOptions: userOptionsFor({ owner: async () => ({}), send: true, transport: () => async () => [] }) };
|
||||
const web = await startServer({ port: 0, board: 'http://127.0.0.1:9', bus, sso, send: async () => ({ id: 'msg-0001' }), decisionWrite, log: l => lines.push(l), ...userOptions, ...server });
|
||||
t.after(() => close(web));
|
||||
const port = web.address().port;
|
||||
const signIn = async (sub = undefined) => {
|
||||
const start = await call(port, { path: '/auth/login' });
|
||||
assert.equal(start.status, 303);
|
||||
const cookie = [start.headers['set-cookie']].flat()[0].split(';')[0];
|
||||
const g = op.grant(iss, start.headers.location, { sub });
|
||||
const q = new URLSearchParams({ code: g.code, state: new URL(start.headers.location).searchParams.get('state') });
|
||||
const r = await call(port, { path: `/auth/callback?${q}`, headers: { cookie } });
|
||||
return [r.headers['set-cookie'] ?? []].flat().find(c => c.startsWith(`${SESSION_COOKIE}=`) && !c.includes('Max-Age=0')).split(';')[0];
|
||||
};
|
||||
const post = (cookie, path, body, headers = {}) => call(port, { method: 'POST', path, headers: { ...writeHeaders(cookie), ...headers }, body: JSON.stringify(body) });
|
||||
return { port, iss, calls, lines, signIn, post };
|
||||
}
|
||||
const refused = (r, code) => {
|
||||
assert.equal(r.status, DECISION_REFUSALS[code][0], `${code}: ${r.status} ${JSON.stringify(r.body)}`);
|
||||
assert.deepEqual(r.body, { error: code, message: DECISION_REFUSALS[code][1] });
|
||||
};
|
||||
|
||||
test('a signed-in owner confirms and answers, with the session\'s provider, issuer and sub as the subject', async t => {
|
||||
const env = await setup(t);
|
||||
const session = await env.signIn();
|
||||
const config = await call(env.port, { path: '/api/config', headers: { cookie: session } });
|
||||
assert.equal(config.body.decide, true);
|
||||
assert.equal(config.body.sso, true);
|
||||
const c = await env.post(session, '/api/decisions/d1/confirmation', { choice: 'yes' });
|
||||
assert.equal(c.status, 200, JSON.stringify(c.body));
|
||||
const r = await env.post(session, '/api/decisions/d1/resolve', { choice: 'yes', confirmation: c.body.confirmation });
|
||||
assert.equal(r.status, 200, JSON.stringify(r.body));
|
||||
assert.deepEqual(r.body, { id: 'd1', op: 'resolved', choice: 'yes' });
|
||||
const subject = { provider: 'a', iss: env.iss.issuer, sub: 'user-a' };
|
||||
assert.deepEqual(env.calls, [
|
||||
{ verb: 'decision.preview.console', args: { id: 'd1' }, ctx: { subject } },
|
||||
{ verb: 'decision.resolve.console', args: { id: 'd1', choice: 'yes', digest: DIGEST }, ctx: { subject, business: 'demo' } },
|
||||
]);
|
||||
assert.match(env.lines.at(-1), / decide user="person-a" decision="d1" step=resolve choice="yes"$/);
|
||||
assert.equal(env.lines.some(l => l.includes(c.body.confirmation) || l.includes(session.split('=')[1])), false);
|
||||
});
|
||||
|
||||
test('the listener gates: no session, a cross-origin page, a loopback Host, a GET, and a sign-out between the steps', async t => {
|
||||
const env = await setup(t);
|
||||
refused(await env.post(null, '/api/decisions/d1/confirmation', { choice: 'yes' }), 'sign-in-required');
|
||||
const session = await env.signIn();
|
||||
refused(await env.post(session, '/api/decisions/d1/confirmation', { choice: 'yes' }, { origin: 'https://evil.test' }), 'cross-origin');
|
||||
refused(await env.post(session, '/api/decisions/d1/confirmation', { choice: 'yes' }, { 'sec-fetch-site': 'cross-site' }), 'cross-origin');
|
||||
const loop = await call(env.port, { method: 'POST', path: '/api/decisions/d1/confirmation', host: `127.0.0.1:${env.port}`, headers: { cookie: session, 'content-type': 'application/json' }, body: '{"choice":"yes"}' });
|
||||
assert.equal(loop.status, 403);
|
||||
refused(await call(env.port, { path: '/api/decisions/d1/confirmation', headers: { cookie: session } }), 'method-not-allowed');
|
||||
assert.equal(env.calls.length, 0);
|
||||
const c = await env.post(session, '/api/decisions/d1/confirmation', { choice: 'yes' });
|
||||
assert.equal(c.status, 200);
|
||||
const out = await call(env.port, { method: 'POST', path: '/auth/logout', headers: { cookie: session, origin: ORIGIN, 'sec-fetch-site': 'same-origin' } });
|
||||
assert.equal(out.status, 303);
|
||||
refused(await env.post(session, '/api/decisions/d1/resolve', { choice: 'yes', confirmation: c.body.confirmation }), 'sign-in-required');
|
||||
assert.equal(env.calls.length, 1);
|
||||
// A new session can't use the old session's confirmation.
|
||||
const again = await env.signIn();
|
||||
refused(await env.post(again, '/api/decisions/d1/resolve', { choice: 'yes', confirmation: c.body.confirmation }), 'confirmation-required');
|
||||
assert.equal(env.calls.length, 1);
|
||||
});
|
||||
|
||||
test('J16: without a decision transport the routes are read-only and /api/config says no; startServer refuses decide without sso or send', async t => {
|
||||
// A decision transport without --send never starts (serve.mjs refuses it). The configs that start
|
||||
// without send have no transport either, so they are checked with the missing transport.
|
||||
await assert.rejects(setup(t, { send: null }), /need --sso and --send/);
|
||||
for (const server of [{ decisionWrite: null }, { decisionWrite: null, send: null }]) {
|
||||
const env = await setup(t, server);
|
||||
const session = await env.signIn();
|
||||
const config = await call(env.port, { path: '/api/config', headers: { cookie: session } });
|
||||
assert.equal(config.body.decide, false);
|
||||
assert.equal(config.body.sso, true);
|
||||
refused(await env.post(session, '/api/decisions/d1/confirmation', { choice: 'yes' }), 'read-only');
|
||||
assert.equal(env.calls.length, 0);
|
||||
}
|
||||
const write = async () => ({});
|
||||
await assert.rejects(startServer({ port: 0, decisionWrite: write, send: async () => ({}) }), /need --sso and --send/);
|
||||
await assert.rejects(startServer({ port: 0, tester: true, testerSocket: {}, decisionWrite: write }), /need --sso and --send/);
|
||||
const plain = await startServer({ port: 0, board: 'http://127.0.0.1:9' });
|
||||
t.after(() => close(plain));
|
||||
const port = plain.address().port, host = `127.0.0.1:${port}`;
|
||||
const r = await call(port, { method: 'POST', path: '/api/decisions/d1/confirmation', host, headers: { origin: `http://${host}`, 'sec-fetch-site': 'same-origin', 'content-type': 'application/json' }, body: '{"choice":"yes"}' });
|
||||
refused(r, 'read-only');
|
||||
const config = await call(port, { path: '/api/config', host });
|
||||
assert.equal(config.body.decide, false);
|
||||
assert.equal('sso' in config.body, false);
|
||||
});
|
||||
|
||||
test('J19: a granted user\'s session gets decide false and the user page config, and a decision POST stops at owner-only', async t => {
|
||||
const access = {
|
||||
accessVersion: 1, revision: 1,
|
||||
users: [{ id: 'alice', home: 'local', subjects: [{ provider: 'a', sub: 'alice-sub' }] }],
|
||||
grants: [{ id: 'g-1', user: 'alice', business: 'demo', projects: ['*'], instances: ['assistant'], level: 'collaborator' }],
|
||||
};
|
||||
const env = await setup(t, {}, access);
|
||||
// The listener has a decision transport and --send, and the owner's session decides.
|
||||
const owner = await env.signIn();
|
||||
assert.equal((await call(env.port, { path: '/api/config', headers: { cookie: owner } })).body.decide, true);
|
||||
// The granted user's config says send (its own transport) but never decide.
|
||||
const alice = await env.signIn('alice-sub');
|
||||
const config = await call(env.port, { path: '/api/config', headers: { cookie: alice } });
|
||||
assert.equal(config.status, 200);
|
||||
assert.equal(config.body.user, true);
|
||||
assert.equal(config.body.send, true);
|
||||
assert.equal(config.body.decide, false);
|
||||
// userRoute refuses the decision routes before decisionHTTP, so no session reaches the transport.
|
||||
for (const step of ['confirmation', 'resolve']) {
|
||||
const r = await env.post(alice, `/api/decisions/d1/${step}`, { choice: 'yes', confirmation: 'c'.repeat(64) });
|
||||
assert.equal(r.status, 403);
|
||||
assert.equal(r.body.error, 'owner-only');
|
||||
}
|
||||
assert.equal(env.calls.length, 0);
|
||||
});
|
||||
|
||||
test('N4: decision.resolve has no Console route, the --send caller names no decision verb, and consoleCall takes only the two console verbs', async t => {
|
||||
const env = await setup(t);
|
||||
const session = await env.signIn();
|
||||
for (const verb of ['decision.resolve', 'decision.resolve.console', 'decision.preview.console']) {
|
||||
for (const method of ['GET', 'POST']) {
|
||||
const r = await call(env.port, { method, path: `/api/bus/${verb}`, headers: writeHeaders(session), ...(method === 'POST' ? { body: '{}' } : {}) });
|
||||
// A GET finds no such bus read. A POST stops earlier, at the preview's read-only refusal for
|
||||
// every write that has no route of its own (row 74).
|
||||
if (method === 'GET') assert.equal(r.status, 404, `${method} ${verb}`);
|
||||
else assert.deepEqual([r.status, r.body.error], [403, 'read-only'], `${method} ${verb}`);
|
||||
}
|
||||
}
|
||||
assert.equal(env.calls.length, 0);
|
||||
const cli = readFileSync(new URL('../src/cli.mjs', import.meta.url), 'utf8');
|
||||
assert.doesNotMatch(cli, /['"]decision\./);
|
||||
const c = consoleCall({ dataRoot: '/nonexistent', socket: '/nonexistent', business: 'demo', cli: '/nonexistent/console-cli.mjs', timeoutMs: 1000 });
|
||||
for (const verb of ['decision.resolve', 'decision.seen', 'message.send', 'inbox']) {
|
||||
await assert.rejects(c(verb, { id: 'd1', choice: 'yes' }, { subject: { provider: 'a', iss: 'i', sub: 's' } }), /the Console does not call/);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,205 @@
|
||||
// Row 252 (#1753): the Console decision endpoint, driven with a fake request, response and bus
|
||||
// transport. The real bus side is in packages/bus/tests/console-decide.test.mjs and the page side
|
||||
// in the browser tests.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { BusReadError } from '../src/bus.mjs';
|
||||
import { DECISION_REFUSALS, createConfirmations, decisionHTTP } from '../src/decision-http.mjs';
|
||||
|
||||
const ORIGIN = 'https://console.test';
|
||||
const DIGEST = 'a'.repeat(64);
|
||||
const PREVIEW = {
|
||||
id: 'd1', business: 'demo', question: 'Enroll host?', digest: DIGEST,
|
||||
approve: { key: 'yes', text: 'Yes, enroll it' }, deny: { key: 'no', text: 'No' },
|
||||
grant: { method: 'host-enroll', host: 'h1' },
|
||||
};
|
||||
|
||||
function request({ method = 'POST', body = {}, headers = {}, raw } = {}) {
|
||||
const h = { origin: [ORIGIN], 'sec-fetch-site': ['same-origin'], 'content-type': ['application/json'], ...headers };
|
||||
for (const k of Object.keys(h)) if (h[k] === null) delete h[k];
|
||||
const data = Buffer.from(raw ?? JSON.stringify(body));
|
||||
return { method, headersDistinct: h, async *[Symbol.asyncIterator]() { yield data; } };
|
||||
}
|
||||
function response() {
|
||||
const r = { status: null, headers: null, text: '' };
|
||||
r.writeHead = (s, h) => { r.status = s; r.headers = h; };
|
||||
r.end = (t = '') => { r.text += t; };
|
||||
r.json = () => JSON.parse(r.text);
|
||||
return r;
|
||||
}
|
||||
function setup({ answer = () => ({ ...PREVIEW }), resolve = (a) => ({ id: a.id, op: 'resolved', choice: a.choice, grant: 'started' }), now } = {}) {
|
||||
const session = { name: 'jason', provider: 'fake-oidc', iss: 'https://idp.test', sub: 'owner-1' };
|
||||
const calls = [], lines = [];
|
||||
const s = {
|
||||
session, calls, lines, current: session,
|
||||
confirmations: createConfirmations(now ? { now } : {}),
|
||||
decide: {
|
||||
origin: ORIGIN,
|
||||
call: async (verb, args, ctx) => {
|
||||
calls.push({ verb, args, ctx });
|
||||
return verb === 'decision.preview.console' ? answer(args) : resolve(args);
|
||||
},
|
||||
},
|
||||
};
|
||||
s.run = async (path, req) => {
|
||||
const res = response();
|
||||
await decisionHTTP(req, res, { path, decide: s.decide, session: s.session, live: () => s.current, confirmations: s.confirmations, log: (l) => lines.push(l) });
|
||||
return res;
|
||||
};
|
||||
s.confirm = (choice = 'yes', id = 'd1') => s.run(`/api/decisions/${id}/confirmation`, request({ body: { choice } }));
|
||||
s.resolve = (body, id = 'd1') => s.run(`/api/decisions/${id}/resolve`, request({ body }));
|
||||
return s;
|
||||
}
|
||||
const refused = (res, code) => {
|
||||
assert.equal(res.status, DECISION_REFUSALS[code][0], `${code}: ${res.text}`);
|
||||
assert.deepEqual(res.json(), { error: code, message: DECISION_REFUSALS[code][1] });
|
||||
assert.equal(res.headers['cache-control'], 'no-store');
|
||||
};
|
||||
|
||||
test('a confirmation then a resolve answers once with the held choice and digest, and a second resolve refuses', async () => {
|
||||
const s = setup();
|
||||
const c = await s.confirm('yes');
|
||||
assert.equal(c.status, 200);
|
||||
const body = c.json();
|
||||
assert.match(body.confirmation, /^[a-f0-9]{64}$/);
|
||||
assert.deepEqual({ ...body, confirmation: 'x' }, { id: 'd1', question: 'Enroll host?', action: 'approve', choice: 'yes', text: 'Yes, enroll it', grant: PREVIEW.grant, confirmation: 'x' });
|
||||
assert.deepEqual(s.calls[0], { verb: 'decision.preview.console', args: { id: 'd1' }, ctx: { subject: { provider: 'fake-oidc', iss: 'https://idp.test', sub: 'owner-1' } } });
|
||||
const r = await s.resolve({ choice: 'yes', confirmation: body.confirmation });
|
||||
assert.equal(r.status, 200);
|
||||
assert.deepEqual(r.json(), { id: 'd1', op: 'resolved', choice: 'yes', grant: 'started' });
|
||||
assert.deepEqual(s.calls[1], { verb: 'decision.resolve.console', args: { id: 'd1', choice: 'yes', digest: DIGEST }, ctx: { subject: { provider: 'fake-oidc', iss: 'https://idp.test', sub: 'owner-1' }, business: 'demo' } });
|
||||
// J12: the confirmation is spent, so a repeat never reaches the bus.
|
||||
refused(await s.resolve({ choice: 'yes', confirmation: body.confirmation }), 'confirmation-required');
|
||||
assert.equal(s.calls.length, 2);
|
||||
assert.equal(s.lines.length, 3);
|
||||
assert.match(s.lines[0], / decide user="jason" decision="d1" step=confirmation action=approve$/);
|
||||
assert.match(s.lines[1], / step=resolve choice="yes" grant=started$/);
|
||||
assert.doesNotMatch(s.lines.join('\n'), new RegExp(body.confirmation));
|
||||
});
|
||||
|
||||
test('deny resolves without a grant field', async () => {
|
||||
const s = setup({ resolve: (a) => ({ id: a.id, op: 'resolved', choice: a.choice }) });
|
||||
const c = (await s.confirm('no')).json();
|
||||
assert.equal(c.action, 'deny');
|
||||
assert.equal(c.text, 'No');
|
||||
const r = await s.resolve({ choice: 'no', confirmation: c.confirmation });
|
||||
assert.deepEqual(r.json(), { id: 'd1', op: 'resolved', choice: 'no' });
|
||||
});
|
||||
|
||||
test('the gates before the body: method, read-only, sign-in and same origin', async () => {
|
||||
const s = setup();
|
||||
refused(await s.run('/api/decisions/d1/confirmation', request({ method: 'GET' })), 'method-not-allowed');
|
||||
const res = response();
|
||||
await decisionHTTP(request({ body: { choice: 'yes' } }), res, { path: '/api/decisions/d1/confirmation', decide: null, session: s.session, live: () => s.session, confirmations: s.confirmations, log: () => {} });
|
||||
refused(res, 'read-only');
|
||||
const out = response();
|
||||
await decisionHTTP(request({ body: { choice: 'yes' } }), out, { path: '/api/decisions/d1/confirmation', decide: s.decide, session: null, live: () => null, confirmations: s.confirmations, log: () => {} });
|
||||
refused(out, 'sign-in-required');
|
||||
for (const headers of [{ origin: ['https://evil.test'] }, { origin: null }, { origin: [ORIGIN, ORIGIN] }, { 'sec-fetch-site': ['same-site'] }, { 'sec-fetch-site': null }]) {
|
||||
refused(await s.run('/api/decisions/d1/confirmation', request({ body: { choice: 'yes' }, headers })), 'cross-origin');
|
||||
}
|
||||
assert.equal(s.calls.length, 0);
|
||||
});
|
||||
|
||||
test('a bad body, id or content type refuses before the bus', async () => {
|
||||
const s = setup();
|
||||
const path = '/api/decisions/d1/confirmation';
|
||||
refused(await s.run(path, request({ body: { choice: 'yes' }, headers: { 'content-type': ['text/plain'] } })), 'invalid-request');
|
||||
refused(await s.run(path, request({ raw: '{' })), 'invalid-request');
|
||||
refused(await s.run(path, request({ raw: '[]' })), 'invalid-request');
|
||||
refused(await s.run(path, request({ body: { choice: 'yes', extra: 1 } })), 'invalid-request');
|
||||
refused(await s.run(path, request({ body: { choice: 1 } })), 'invalid-request');
|
||||
refused(await s.run(path, request({ raw: JSON.stringify({ choice: 'y'.repeat(5000) }) })), 'request-too-large');
|
||||
refused(await s.run('/api/decisions/..%2Fx/confirmation', request({ body: { choice: 'yes' } })), 'decision-not-found');
|
||||
refused(await s.run('/api/decisions/%E0%A4%A/confirmation', request({ body: { choice: 'yes' } })), 'decision-not-found');
|
||||
refused(await s.resolve({ choice: 'yes' }), 'invalid-request');
|
||||
refused(await s.resolve({ choice: 'yes', confirmation: 'a'.repeat(64), more: 1 }), 'invalid-request');
|
||||
assert.equal(s.calls.length, 0);
|
||||
});
|
||||
|
||||
test('a choice that is neither key is decision-stale, and a malformed preview is confirmation-unavailable', async () => {
|
||||
refused(await setup().confirm('maybe'), 'decision-stale');
|
||||
for (const bad of [{ ...PREVIEW, id: 'd2' }, { ...PREVIEW, digest: 'short' }, { ...PREVIEW, deny: { key: 'yes', text: 'No' } }, { ...PREVIEW, grant: null }, null]) {
|
||||
const s = setup({ answer: () => bad });
|
||||
refused(await s.confirm('yes'), 'confirmation-unavailable');
|
||||
assert.equal(s.confirmations.size, 0);
|
||||
}
|
||||
});
|
||||
|
||||
test('bus refusals map by code, and an unknown or missing code is unavailable at preview and outcome-unknown at resolve', async () => {
|
||||
const cases = [
|
||||
['human-required', 'human-required'], ['agent-required', 'human-required'], ['access-revoked', 'human-required'],
|
||||
['peercred-required', 'peercred-required'], ['decision-not-eligible', 'decision-not-eligible'],
|
||||
['decision-closed', 'decision-closed'], ['decision-stale', 'decision-stale'], ['invalid-choice', 'decision-stale'],
|
||||
['decision-not-found', 'decision-not-found'], ['outcome-unknown', 'confirmation-unavailable'], ['weird', 'confirmation-unavailable'],
|
||||
];
|
||||
for (const [bus, code] of cases) {
|
||||
const s = setup({ answer: () => { throw new BusReadError(bus); } });
|
||||
refused(await s.confirm('yes'), code);
|
||||
}
|
||||
refused(await setup({ answer: () => { throw new Error('boom'); } }).confirm('yes'), 'confirmation-unavailable');
|
||||
for (const [bus, code] of [['decision-closed', 'decision-closed'], ['outcome-unknown', 'outcome-unknown'], ['weird', 'outcome-unknown']]) {
|
||||
const s = setup({ resolve: () => { throw new BusReadError(bus); } });
|
||||
const c = (await s.confirm('yes')).json();
|
||||
refused(await s.resolve({ choice: 'yes', confirmation: c.confirmation }), code);
|
||||
// Nothing retries, and the confirmation stays spent.
|
||||
assert.equal(s.calls.length, 2);
|
||||
refused(await s.resolve({ choice: 'yes', confirmation: c.confirmation }), 'confirmation-required');
|
||||
}
|
||||
for (const reply of [null, { id: 'd2', op: 'resolved', choice: 'yes' }, { id: 'd1', op: 'refused', choice: 'yes' }, { id: 'd1', op: 'resolved', choice: 'no' }]) {
|
||||
const s = setup({ resolve: () => reply });
|
||||
const c = (await s.confirm('yes')).json();
|
||||
refused(await s.resolve({ choice: 'yes', confirmation: c.confirmation }), 'outcome-unknown');
|
||||
}
|
||||
});
|
||||
|
||||
test('a confirmation binds the session, decision and choice, and any mismatch spends it', async () => {
|
||||
const s = setup();
|
||||
let c = (await s.confirm('yes')).json();
|
||||
refused(await s.resolve({ choice: 'no', confirmation: c.confirmation }), 'confirmation-required');
|
||||
refused(await s.resolve({ choice: 'yes', confirmation: c.confirmation }), 'confirmation-required');
|
||||
c = (await s.confirm('yes')).json();
|
||||
refused(await s.resolve({ choice: 'yes', confirmation: c.confirmation }, 'd2'), 'confirmation-required');
|
||||
c = (await s.confirm('yes')).json();
|
||||
const other = setup();
|
||||
other.confirmations = s.confirmations;
|
||||
other.session = { ...s.session };
|
||||
other.current = other.session;
|
||||
refused(await other.resolve({ choice: 'yes', confirmation: c.confirmation }), 'confirmation-required');
|
||||
refused(await s.resolve({ choice: 'yes', confirmation: 'not-a-token' }), 'confirmation-required');
|
||||
assert.equal(s.calls.filter((x) => x.verb === 'decision.resolve.console').length, 0);
|
||||
assert.equal(other.calls.length, 0);
|
||||
});
|
||||
|
||||
test('a session that ends between the steps refuses before the bus', async () => {
|
||||
const s = setup();
|
||||
s.current = null;
|
||||
refused(await s.confirm('yes'), 'sign-in-required');
|
||||
assert.equal(s.calls.length, 0);
|
||||
s.current = s.session;
|
||||
const c = (await s.confirm('yes')).json();
|
||||
s.current = { ...s.session };
|
||||
refused(await s.resolve({ choice: 'yes', confirmation: c.confirmation }), 'sign-in-required');
|
||||
assert.equal(s.calls.length, 1);
|
||||
// A sign-out during the preview also refuses, and no confirmation is issued.
|
||||
const t = setup({ answer: () => { t.current = null; return { ...PREVIEW }; } });
|
||||
refused(await t.confirm('yes'), 'sign-in-required');
|
||||
assert.equal(t.confirmations.size, 0);
|
||||
});
|
||||
|
||||
test('confirmations expire after the TTL, cap at the limit without dropping a live one, and are one use', () => {
|
||||
let t = 0;
|
||||
const store = createConfirmations({ ttlMs: 1000, max: 2, now: () => t });
|
||||
const bind = { session: 's', business: 'demo', decision: 'd1', choice: 'yes', digest: DIGEST };
|
||||
const a = store.issue(bind), b = store.issue(bind);
|
||||
assert.equal(store.issue(bind), null);
|
||||
assert.equal(store.size, 2);
|
||||
assert.equal(store.consume(a, bind).digest, DIGEST);
|
||||
assert.equal(store.consume(a, bind), null);
|
||||
t = 1000;
|
||||
assert.equal(store.consume(b, bind), null);
|
||||
assert.equal(store.size, 0);
|
||||
assert.match(store.issue(bind), /^[a-f0-9]{64}$/);
|
||||
assert.equal(store.consume(undefined, bind), null);
|
||||
assert.equal(store.consume('A'.repeat(64), bind), null);
|
||||
});
|
||||
@@ -14,7 +14,7 @@ test('C2-04 CLI: both listener callback pairs dispatch library verbs with their
|
||||
// The loader supplies a fixture bus and captures callbacks instead of
|
||||
// opening an HTTP listener. Production imports and routes are unchanged.
|
||||
const serveSource = "export const DEFAULT_BOARD='http://127.0.0.1:9';export const previewOptions=()=>null;export const proofOptions=()=>null;export async function startServer(o){if(typeof o.libraryFile!=='function'||typeof o.libraryStatus!=='function')throw Error('missing library callbacks');await o.libraryFile({project:'books',path:'Book One/A.md'});await o.libraryStatus({project:'books'});return {address:()=>({port:0}),close:()=>{}};}";
|
||||
const busSource = `import {appendFileSync} from 'node:fs';export class BusReadError extends Error{};export const busCaller=o=>async(verb,args)=>{appendFileSync(${JSON.stringify(log)},JSON.stringify({verb,args,cli:o.cli??${JSON.stringify(HUMAN_CLI)}})+'\\n');return {};};export const busBusiness=()=>{throw Error('busBusiness outside --sso')};export const userCaller=()=>{throw Error('userCaller outside --sso')};`;
|
||||
const busSource = `import {appendFileSync} from 'node:fs';export class BusReadError extends Error{};export const busCaller=o=>async(verb,args)=>{appendFileSync(${JSON.stringify(log)},JSON.stringify({verb,args,cli:o.cli??${JSON.stringify(HUMAN_CLI)}})+'\\n');return {};};export const busBusiness=()=>{throw Error('busBusiness outside --sso')};export const userCaller=()=>{throw Error('userCaller outside --sso')};export const consoleCall=()=>{throw Error('consoleCall outside --sso')};`;
|
||||
writeFileSync(hook, `import {registerHooks} from 'node:module';
|
||||
registerHooks({load(url,context,next){
|
||||
if(url.endsWith('/webui/src/serve.mjs'))return {format:'module',shortCircuit:true,source:${JSON.stringify(serveSource)}};
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
// Row 225 (C2-10b, design 7.4): the chat's library status read, a write notice's Revert and the
|
||||
// shared reply renderer served to the page. The revert is C2-02's `library.revert`; until that verb
|
||||
// exists the bus refuses it and the route reports the code.
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { request } from 'node:http';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { startServer, userRoute } from '../src/serve.mjs';
|
||||
import { BusReadError } from '../src/bus.mjs';
|
||||
const preview = { host: 'console.example', header: 'x-user', user: 'jason' };
|
||||
const headers = { host: 'console.example', 'x-user': 'jason', origin: 'https://console.example', 'sec-fetch-site': 'same-origin', 'content-type': 'application/json' };
|
||||
const C1 = 'a'.repeat(40), C2 = 'b'.repeat(40);
|
||||
const payload = { project: 'books', commit: C1 };
|
||||
const STATUS = { project: 'books', version: 1, branch: 'main', served: C2, lastFetch: '2026-10-23T18:00:00.000Z', lastError: null, diverged: null, problems: [] };
|
||||
async function setup(t, { enabled = true, revert, status, lines = [] } = {}) {
|
||||
const calls = { revert: [], status: [] };
|
||||
const server = await startServer({
|
||||
port: 0, preview, log: l => lines.push(l),
|
||||
send: enabled ? async () => ({}) : null,
|
||||
libraryStatus: status === null ? null : async args => { calls.status.push(args); return status ? status(args) : STATUS; },
|
||||
libraryRevert: enabled ? async args => { calls.revert.push(args); return revert ? revert(args) : { project: args.project, path: 'Notes/Eyes.md', reverted: args.commit, commit: C2 }; } : null,
|
||||
});
|
||||
t.after(() => new Promise(r => server.close(r)));
|
||||
return { calls, lines, port: server.address().port };
|
||||
}
|
||||
function call(s, { method = 'POST', path = '/api/library/revert', hs = headers, data = payload } = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const req = request({ hostname: '127.0.0.1', port: s.port, path, method, headers: hs }, r => {
|
||||
let text = '';
|
||||
r.on('data', c => text += c);
|
||||
r.on('end', () => resolve({ status: r.statusCode, type: r.headers['content-type'], text, body: text.startsWith('{') ? JSON.parse(text) : null }));
|
||||
});
|
||||
req.on('error', reject);
|
||||
req.end(data === null ? undefined : typeof data === 'string' ? data : JSON.stringify(data));
|
||||
});
|
||||
}
|
||||
const get = (s, path, hs = headers) => call(s, { method: 'GET', path, hs, data: null });
|
||||
const refusal = code => { throw new BusReadError(code); };
|
||||
|
||||
test('a signed-in same-origin revert reaches exactly one library.revert and returns the new commit', async t => {
|
||||
const s = await setup(t), r = await call(s);
|
||||
assert.equal(r.status, 200, r.text);
|
||||
assert.deepEqual(s.calls.revert, [payload]);
|
||||
assert.deepEqual({ ...r.body, at: undefined }, { project: 'books', path: 'Notes/Eyes.md', reverted: C1, commit: C2, at: undefined });
|
||||
assert.ok(s.lines.some(l => l.includes('library-revert') && l.includes(`commit=${C2}`) && l.includes('project="books"')));
|
||||
});
|
||||
|
||||
test('a revert needs send, the named Host, the user, the exact Origin and same-origin Fetch Metadata', async t => {
|
||||
const off = await setup(t, { enabled: false });
|
||||
assert.deepEqual((await call(off)).body, { error: 'read-only', sent: false });
|
||||
const s = await setup(t);
|
||||
for (const [key, value, status] of [['host', 'wrong.example', 403], ['x-user', 'other', 401], ['origin', 'https://else.example', 403], ['sec-fetch-site', 'cross-site', 403],
|
||||
['origin', undefined, 403], ['sec-fetch-site', undefined, 403], ['x-user', ['jason', 'jason'], 401]]) {
|
||||
const hs = { ...headers };
|
||||
if (value === undefined) delete hs[key]; else hs[key] = value;
|
||||
const r = await call(s, { hs });
|
||||
assert.equal(r.status, status, key);
|
||||
assert.notEqual(r.body?.sent, true);
|
||||
}
|
||||
assert.equal((await call(s, { method: 'GET', data: null })).status, 405);
|
||||
assert.deepEqual(s.calls.revert, []);
|
||||
});
|
||||
|
||||
test('a revert takes a project and a 40-hex commit, nothing else, before the bus is asked', async t => {
|
||||
const s = await setup(t);
|
||||
for (const data of ['not json', 'null', '[]', '5', { project: 'books' }, { commit: C1 }, { ...payload, path: 'a.md' },
|
||||
{ project: 'books', commit: 'abc' }, { project: 'books', commit: C1.toUpperCase() }, { project: '../x', commit: C1 }, { project: 7, commit: C1 }]) {
|
||||
const r = await call(s, { data });
|
||||
assert.equal(r.status, 400, JSON.stringify(data));
|
||||
assert.equal(r.body.error, 'invalid-request');
|
||||
assert.equal(r.body.sent, false);
|
||||
}
|
||||
assert.deepEqual(s.calls.revert, []);
|
||||
});
|
||||
|
||||
test('a bus refusal is reported as not reverted with its code; before C2-02 that is the verb refusal', async t => {
|
||||
const codes = { 'unknown-verb': 502, 'library-revert-not-agent': 409, 'stale-base': 409, 'human-required': 403, 'project-not-configured': 503, 'invalid-request': 400 };
|
||||
for (const [code, status] of Object.entries(codes)) {
|
||||
const s = await setup(t, { revert: () => refusal(code) }), r = await call(s);
|
||||
assert.equal(r.status, status, code);
|
||||
assert.equal(r.body.error, code);
|
||||
assert.equal(r.body.sent, false);
|
||||
assert.match(r.body.message, new RegExp(`not reverted: the bus refused it \\(${code}\\)`));
|
||||
assert.equal(s.calls.revert.length, 1, 'never retried');
|
||||
}
|
||||
});
|
||||
|
||||
test('a revert whose answer is lost or unusable is reported unknown and is never retried', async t => {
|
||||
const answers = [() => refusal('outcome-unknown'), () => { throw new Error('socket closed'); }, () => ({ project: 'books', path: 'a.md', reverted: C1 }),
|
||||
() => ({ project: 'books', path: 'a.md', reverted: C2, commit: C2 }), () => ({ project: 'books', reverted: C1, commit: C2 }), () => null];
|
||||
for (const revert of answers) {
|
||||
const s = await setup(t, { revert }), r = await call(s);
|
||||
assert.equal(r.status, 503, revert.toString());
|
||||
assert.equal(r.body.error, 'outcome-unknown');
|
||||
assert.equal(r.body.sent, 'unknown');
|
||||
assert.equal(s.calls.revert.length, 1);
|
||||
}
|
||||
});
|
||||
|
||||
test('the status read takes one project query and answers the bus result for that project', async t => {
|
||||
const s = await setup(t), r = await get(s, '/api/library/status?project=books');
|
||||
assert.equal(r.status, 200, r.text);
|
||||
assert.deepEqual(s.calls.status, [{ project: 'books' }]);
|
||||
assert.deepEqual({ ...r.body, at: undefined }, { ...STATUS, at: undefined });
|
||||
for (const path of ['/api/library/status', '/api/library/status?project=books&x=1', '/api/library/status?project=books&project=other', '/api/library/status?project=../x'])
|
||||
assert.equal((await get(s, path)).status, 400, path);
|
||||
assert.equal((await call(s, { path: '/api/library/status?project=books' })).status, 403, 'the preview write fence precedes GET-only routes');
|
||||
assert.equal(s.calls.status.length, 1);
|
||||
});
|
||||
|
||||
test('a status answer for another project or of the wrong shape is refused; a refusal keeps its status', async t => {
|
||||
for (const answer of [{ ...STATUS, project: 'other' }, null, [], 'books']) {
|
||||
const s = await setup(t, { status: () => answer }), r = await get(s, '/api/library/status?project=books');
|
||||
assert.equal(r.status, 502, JSON.stringify(answer));
|
||||
assert.equal(r.body.error, 'invalid-response');
|
||||
}
|
||||
for (const [code, status] of Object.entries({ 'human-required': 403, 'project-not-configured': 503, 'project-not-declared': 400, 'library-mapping-invalid': 502 })) {
|
||||
const s = await setup(t, { status: () => refusal(code) }), r = await get(s, '/api/library/status?project=books');
|
||||
assert.equal(r.status, status, code);
|
||||
assert.equal(r.body.error, code);
|
||||
}
|
||||
const none = await setup(t, { status: null });
|
||||
assert.equal((await get(none, '/api/library/status?project=books')).body.error, 'not-configured');
|
||||
});
|
||||
|
||||
test('the status read needs no send; a read-only Console still has no revert', async t => {
|
||||
const s = await setup(t, { enabled: false });
|
||||
assert.equal((await get(s, '/api/library/status?project=books')).status, 200);
|
||||
assert.equal((await call(s)).status, 403);
|
||||
});
|
||||
|
||||
test('library routes are the owner\'s: a granted user is refused them, and the tester never reverts', async t => {
|
||||
for (const [path, method] of [['/api/library/status', 'GET'], ['/api/library/revert', 'POST']]) assert.equal(userRoute(path, method), false, path);
|
||||
await assert.rejects(startServer({ port: 0, tester: true, testerSocket: '/nonexistent', libraryRevert: async () => ({}) }), /tester listener permits only/);
|
||||
});
|
||||
|
||||
test('the page gets the one library renderer, byte for byte, as a JavaScript module', async t => {
|
||||
const s = await setup(t), r = await get(s, '/render.mjs');
|
||||
assert.equal(r.status, 200);
|
||||
assert.match(r.type, /^text\/javascript/);
|
||||
assert.equal(r.text, readFileSync(new URL('../../library/src/render.mjs', import.meta.url), 'utf8'));
|
||||
});
|
||||
|
||||
// A valid commit from an unrelated project is an unusable receipt, never evidence of this revert.
|
||||
test('a revert receipt for another project is unknown and is never retried', async t => {
|
||||
const s = await setup(t, { revert: args => ({ project: 'other', path: 'Notes/Eyes.md', reverted: args.commit, commit: C2 }) });
|
||||
const r = await call(s);
|
||||
assert.equal(r.status, 503);
|
||||
assert.equal(r.body.error, 'outcome-unknown');
|
||||
assert.equal(r.body.sent, 'unknown');
|
||||
assert.deepEqual(s.calls.revert, [payload]);
|
||||
});
|
||||
|
||||
// Catch a route being added ahead of the granted-user owner fence: neither transport may be used.
|
||||
test('a granted-user HTTP session cannot reach owner library callbacks', async t => {
|
||||
let ownerCalls = 0, userCalls = 0;
|
||||
const sso = { publicHost: 'console.example', publicOrigin: 'https://console.example',
|
||||
formTargets: () => [], session: () => ({ name: 'Alice', user: 'alice' }) };
|
||||
const server = await startServer({ port: 0, sso, send: async () => ({}),
|
||||
libraryStatus: async () => { ownerCalls++; return STATUS; },
|
||||
libraryRevert: async () => { ownerCalls++; return { project: 'books', path: 'a.md', reverted: C1, commit: C2 }; },
|
||||
userOptions: () => { userCalls++; return {}; }, log: () => {} });
|
||||
t.after(() => new Promise(r => server.close(r)));
|
||||
const s = { port: server.address().port };
|
||||
for (const options of [{ method: 'GET', path: '/api/library/status?project=books', data: null }, {}]) {
|
||||
const r = await call(s, options);
|
||||
assert.equal(r.status, 403);
|
||||
assert.equal(r.body.error, 'owner-only');
|
||||
}
|
||||
assert.equal(ownerCalls, 0);
|
||||
assert.equal(userCalls, 0);
|
||||
});
|
||||
|
||||
// A supplied callback is insufficient authority: --send must independently be enabled.
|
||||
test('a configured revert callback remains unreachable when send is off', async t => {
|
||||
let calls = 0;
|
||||
const server = await startServer({ port: 0, preview,
|
||||
libraryRevert: async () => { calls++; return { project: 'books', path: 'a.md', reverted: C1, commit: C2 }; } });
|
||||
t.after(() => new Promise(r => server.close(r)));
|
||||
const r = await call({ port: server.address().port });
|
||||
assert.equal(r.status, 403);
|
||||
assert.equal(r.body.error, 'read-only');
|
||||
assert.equal(r.body.sent, false);
|
||||
assert.equal(calls, 0);
|
||||
});
|
||||
@@ -50,14 +50,18 @@ test('shipped strings are unchanged, and the web keeps its write boundary', () =
|
||||
['bus.js', 'No open tasks.'], ['bus.js', 'No role is held right now.'], ['bus.js', 'Nothing of this kind in the trail.'],
|
||||
['bus.js', 'Console shows nothing rather than a guess. Nothing was written.'],
|
||||
]) assert.equal(plain[file].split(s).length - 1, n, `${file}: ${s}`);
|
||||
// No Resolve control. The board's Seen and reply are app.js's POSTs; bus.js has four explicit writes:
|
||||
// Row 252 (#1753, mos-1321): the one decision control is the Console's grant Approve and Deny, one
|
||||
// fetch(url, ...) in decidePost, called only for a decision's confirmation and its resolve. Its labels
|
||||
// come from ACTIONS, and the doesNotMatch below keeps any literal Resolve, Decide or Approve label out
|
||||
// of the markup. The board's Seen and reply are app.js's POSTs; bus.js's other explicit writes are
|
||||
// row 76's message to a role, row 122's human Settings update, row 125's token-limit reset (one path,
|
||||
// to the same Settings route) and row 148's spec and docs save. Row 165 (#1662) adds the role
|
||||
// instance add or change to /api/instances, and row 65 the routing table's save to /api/routes.
|
||||
assert.doesNotMatch(src, /<button[^>]*>[^<]*(Resolve|Decide|Approve)/i);
|
||||
const writes = read('bus.js').toString().match(/fetch\([^;]*method:\s*['"](POST|PUT|PATCH|DELETE)[^;]*;/g) ?? [];
|
||||
assert.deepEqual(writes, ["fetch('/api/settings',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(payload),cache:'no-store',redirect:'manual'});", "fetch('/api/settings',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({revision,reset:[JSON.parse(path)]}),cache:'no-store',redirect:'manual'});", "fetch(url,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(payload),cache:'no-store',redirect:'manual'});", "fetch('/api/instances',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(payload),cache:'no-store',redirect:'manual'});", "fetch('/api/routes',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(payload),cache:'no-store',redirect:'manual'});", "fetch('/api/project-file', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(sent), cache: 'no-store', redirect: 'manual' });", "fetch('/api/bus/message', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ to, body: text }), cache: 'no-store', redirect: 'manual' });"]);
|
||||
assert.equal(read('bus.js').toString().split(/method:/).length - 1, 7);
|
||||
assert.deepEqual(writes, ["fetch(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body), cache: 'no-store', redirect: 'manual' });", "fetch('/api/settings',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(payload),cache:'no-store',redirect:'manual'});", "fetch('/api/settings',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({revision,reset:[JSON.parse(path)]}),cache:'no-store',redirect:'manual'});", "fetch(url,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(payload),cache:'no-store',redirect:'manual'});", "fetch('/api/instances',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(payload),cache:'no-store',redirect:'manual'});", "fetch('/api/routes',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(payload),cache:'no-store',redirect:'manual'});", "fetch('/api/project-file', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(sent), cache: 'no-store', redirect: 'manual' });", "fetch('/api/bus/message', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ to, body: text }), cache: 'no-store', redirect: 'manual' });"]);
|
||||
assert.equal(read('bus.js').toString().split(/method:/).length - 1, 8);
|
||||
assert.deepEqual([...read('bus.js').toString().matchAll(/decidePost\(([^,]*),/g)].map(m => m[1]), ['url', '`/api/decisions/${enc(a.id)}/confirmation`', '`/api/decisions/${enc(a.id)}/resolve`']);
|
||||
// Row 155 (#1649): the one fetch(url, ...) posts only to these three routes, each a literal.
|
||||
// Row 176 (#1674): the tester name form adds a second /api/name caller.
|
||||
assert.deepEqual([...read('bus.js').toString().matchAll(/assistantPost\(([^,]*),/g)].map(m => m[1]), ['url', "'/api/settings'", "'/api/name'", "'/api/assistant-stop'", "'/api/name'"]);
|
||||
|
||||
@@ -183,3 +183,14 @@ test('row 177 W4: the main listener refuses x-mosaic-tester on chat reads and wr
|
||||
assert.equal((await http(web, '/api/chat/threads', { headers: signed })).status, 200);
|
||||
assert.deepEqual(calls, ['threads']);
|
||||
});
|
||||
|
||||
test('Row 252: the tester listener has no decision answer routes, and its config never offers them', async t => {
|
||||
const s = await testerFixture(t);
|
||||
for (const step of ['confirmation', 'resolve']) {
|
||||
const r = await post(s.web, `/api/decisions/d1/${step}`, step === 'confirmation' ? { choice: 'yes' } : { choice: 'yes', confirmation: 'a'.repeat(64) });
|
||||
assert.equal(r.status, 404, r.text);
|
||||
assert.equal(r.body.error, 'not-found');
|
||||
}
|
||||
assert.equal((await http(s.web, '/api/config')).body.decide, false);
|
||||
assert.deepEqual(s.calls, []);
|
||||
});
|
||||
@@ -55,7 +55,7 @@ test('row278 Console adapter calls argument-free thread.claims through the norma
|
||||
const root = tmp(t, 'claims-cli-'), f = fixture(root), log = join(root, 'calls.jsonl'), hook = join(root, 'hooks.mjs');
|
||||
writeFileSync(log, '');
|
||||
const serveSource = `export const DEFAULT_BOARD='http://127.0.0.1:9';export const previewOptions=()=>null;export const proofOptions=()=>null;export async function startServer(o){await o.bus['thread.claims']();return {address:()=>({port:0}),close:()=>{}};}`;
|
||||
const busSource = `import {appendFileSync} from 'node:fs';export class BusReadError extends Error{};export const busCaller=o=>async(verb,...args)=>{appendFileSync(${JSON.stringify(log)},JSON.stringify({verb,args,tester:!!o.cli})+'\\n');return [];};export const busBusiness=()=>{throw Error('busBusiness outside --sso')};export const userCaller=()=>{throw Error('userCaller outside --sso')};`;
|
||||
const busSource = `import {appendFileSync} from 'node:fs';export class BusReadError extends Error{};export const busCaller=o=>async(verb,...args)=>{appendFileSync(${JSON.stringify(log)},JSON.stringify({verb,args,tester:!!o.cli})+'\\n');return [];};export const busBusiness=()=>{throw Error('busBusiness outside --sso')};export const userCaller=()=>{throw Error('userCaller outside --sso')};export const consoleCall=()=>{throw Error('consoleCall outside --sso')};`;
|
||||
writeFileSync(hook, `import {registerHooks} from 'node:module';registerHooks({load(url,context,next){
|
||||
if(url.endsWith('/webui/src/serve.mjs'))return {format:'module',shortCircuit:true,source:${JSON.stringify(serveSource)}};
|
||||
if(url.endsWith('/webui/src/bus.mjs'))return {format:'module',shortCircuit:true,source:${JSON.stringify(busSource)}};
|
||||
|
||||
Reference in new issue
Block a user