Compare commits

...
13 Commits
Author SHA1 Message Date
jason.woltje 7defb58e97 sessions: Sage 10-23 rows 291 and 306 landings, row 308 launch 2026-10-23 11:37:34 -05:00
jason.woltje 9c8877bdf3 plans: DEFERRED row 306 N1 (revoke Set lost on broker restart) and N2 (pending limit stop answers not-holder first), landed 2d0318a44 (mos-1463) 2026-10-23 11:35:21 -05:00
jason.woltje 2d0318a44a morgana: row 306 build (#1813): #accessRevoked from #revokeLost, #agent answers thread-revoked until endLaunch, runner stops on thread-revoked, READMEs, access-revoke.test 7 7 (mos-1463) 2026-10-23 11:33:17 -05:00
jason.woltje bd3fa2a484 morgana: row 306 red-first tests (#1813): bus revoke-window T1/T2, cli revoke-window T3 forcing test; no product code 2026-10-23 11:33:17 -05:00
jason.woltje ab575ee553 morgana: row 306 design r2 (dewey-0918 C1-C3, sage-3483/mos-1463): T3 asserts no thread-revoked event for A, T2 limit half makes a second call, six-suite gate, access-revoke edit bounded to 7 7 2026-10-23 11:33:17 -05:00
jason.woltje 1676ad0de8 morgana: row 306 design r1 (#1813, sage-3478): #accessRevoked set from #revokeLost, #agent answers thread-revoked until endLaunch, runner maps it to stopped; T1-T3, M1-M3, six access-revoke asserts to Mos via Sage 2026-10-23 11:33:17 -05:00
jason.woltje 4874d1e83a gosalyn: PRD 1.16 routes library.write under REQ-LIB-6 (mos-1328, mos-1329, sage-2919, webby-0164 B2). REQ-WAIT-3 gains the routing paragraph with its bounds, creative roles only and within-role, Markdown under supporting folders a human marks, never a story file, the writing agent's live Gitea grant on the library project, one commit per write by its own account with the trailer, notice and revert. REQ-LIB-6 names the action. Status, the header, a 1.16 source line and a 1.16 note. requirements.json changes its version only, with the test pin 2026-10-23 11:15:49 -05:00
jason.woltje e909ef51a2 plans: PRD 1.17 brief (Gitea #1815, Vikunja 570): Gosalyn builds d9 4607e15b8 onto 1.16 after row 291, Webby reviews, four files, Sage gates 2026-10-23 10:44:58 -05:00
jason.woltje 4607e15b83 sage: PRD 1.17 d9 r3 (02f28dec), Mos's J-b check mos-1470: J-b records N20 as confirmed, REQ-LIB-5's version tag cites Q239 for the Connections view (N21), d9 changes names both 2026-10-23 10:41:08 -05:00
jason.woltje 8b42010551 sage: PRD 1.17 d9 round 2 (b17ce386), Webby round 6 B1: REQ-LIB-5, its note, the Risks line and the A6 line take mos-1443 R3's text as written; J-b in the past tense (N19); the import-waits line cited as Mos's R3 default (N20) 2026-10-23 10:36:16 -05:00
jason.woltje 4863e2caf4 sage: PRD 1.17 draft 9 (7dfc52fd), d8 plus Jason's Q41 O2 (Q239, mos-1467): REQ-LIB-5 requires the Console Connections view for converted chapters, note and Risks line follow, J-b records the answer; Webby round 5 N15-N17 2026-10-23 10:25:37 -05:00
jason.woltje 7b25a60633 agents: webui runs set MOSAIC_REQUIRE_EDITOR_BUILD=1 and linked worktrees npm ci packages/webui (Vikunja 597) 2026-10-23 10:01:25 -05:00
jason.woltje e86df37d76 sessions: Sage 272 and 307 landings, 306 design, 252 rebase check 2026-10-23 09:59:29 -05:00
19 changed files with 2185 additions and 24 deletions

No files matched your search

+4
View File
@@ -5403,3 +5403,7 @@ 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).
+8
View File
@@ -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.
+205
View File
@@ -0,0 +1,205 @@
# Row 306: a revoked run's late bus call stops it instead of exiting 22 (#1813, 295 N1)
Owner Morgana. Reviewer Dewey. Gate owner Sage. Brief: docs/plans/2026-10-23_gate-env-rows.md, third
section (c16e943b9). Go: sage-3478 (Mos-1453 puts 306 next). Base: refactor fe4ee8c7b, after row 272
(d33989230) and row 307 (d243f6b25). Every line below is as it stands at fe4ee8c7b.
## Design round 1 (no code yet), round 2 edits marked r2
### The window today
- `#revokeLost` (packages/bus/src/broker.mjs:1012-1029) ends each lost user thread's held claim in
one transaction: `#claimEnd(..., 'revoke', null, 'access-revoked', by)` at :1022. The four
callers are the timer `accessSweep` (:1039), a user's request (:4542), `access.reload` (:4561)
and `threadsState` (:1107 and the access-expiry sweep at :1113).
- The launcher learns of the loss from `threadsState`'s `revoked: true` row, records
`thread-revoked` and sends SIGTERM (packages/cli/src/launcher.mjs:710-718).
- A runner call between that claim end and the signal goes through `#agent` (:1064-1072). The
run's latest claim row is now op `revoke`, so the check at :1069 fails. :1070 answers
`launcher-released` only for a run in `#launcherReleased` (:431, row 302), and `not-holder`
otherwise.
- The runner's `ended()` (packages/harness/src/runner.mjs:488-500) counts `not-holder` as a gone
session (`SESSION_GONE`, :55). It sets `code = EXIT.session` and the run exits 22 with
`session-invalid`.
### D1: the broker remembers the revoked run in memory, the same way as #launcherReleased
- A new field next to `#launcherReleased` (:431): `#accessRevoked = new Set()`, keyed
`business:run`, with a comment naming row 306.
- `#revokeLost` adds each ended claim's `h.business + ':' + h.holder_run`. It adds them after the
transaction at :1018-1026 commits, by iterating `ended`, so a transaction that throws leaves the
Set unchanged. This is the only place the Set grows. No other `#claimEnd` caller adds to it:
`assistant.stop` (:6078), `role.revoke`/`role.end` (:5333, :5338), `instance.fire` (:4780), the
limit stop (:4949), `threadIdle` (:1133) and `landRelease` do not.
- `#agent`'s refusal at :1070 becomes three-way, and only on the existing failure branch:
`launcher-released` if the run is in `#launcherReleased`, else `thread-revoked` if it is in
`#accessRevoked`, else `not-holder`. A run that still holds its claim never reaches the branch.
The two sets don't overlap. A released run holds no claim for the sweep to end, and a revoked run
holds none for `threadIdle` or `landRelease` to release (both refuse `not-holder` first, :1131 and
:4237).
- **Where the memory ends.** `endLaunch` deletes the key next to `#launcherReleased.delete(key)` at
:1394. That is also where every capability of the run is dropped (:1395-1396), so after it no call
of the run reaches `#agent`.
- **The alternative I didn't take.** Derive the answer from the store: the run's latest claim row is
op `revoke` with reason `access-revoked`. It would survive a broker restart. But `reason` is
caller text at :4780, :5333 and :5338, so a human's `role.revoke` with reason `access-revoked`
would turn that run's `not-holder` into `thread-revoked`, a stopped exit. `by` doesn't separate the
cases either: `access.reload` passes the human's name (:4561). The Set can't be spoofed that way,
and it matches row 302's shape. The cost is N1 below.
- **Unchanged.** `role.claim` keeps its order: `launcher-released` (:5252), then `run-revoked` for a
run with any revoke row in its session (:5257-5258), then `thread-revoked` from the file (:5259).
`bindLaunch` keeps refusing `thread-revoked` for a new run of a lost thread (:1371). The limit
stop's `not-holder` (:4952) is unchanged.
### D2: the runner maps thread-revoked from a call to stopped
- runner.mjs gets `THREAD_REVOKED = "thread-revoked"` next to `LAUNCHER_RELEASED` (:58), with a
comment naming row 306.
- In `ended()` (:491-500), `thread-revoked` takes the launcher-released branch:
- it logs its own line, `runner: thread revoked by the access file`;
- it sets `released = true` and returns true;
- `code` stays `EXIT.stopped`.
`released` also skips the exit-time `role.release` (:596-602), which is right because the sweep
already ended the claim.
- The refusal of the run's first `role.claim` (:459-467) is unchanged. `thread-revoked` there stays
`EXIT.claim` (21), because the brief maps it only "from a call" after the claim. Mostly
`bindLaunch` refuses such a run before it starts.
- `ended()` covers every call site in the loop: landing `state` (:521), `message.receive` (:543),
the turn's `state` (:561) and the reply's `message.send`/`message.read` (:589). The harness's tool
calls go through the tool server and return their error to the harness, as they do for
`launcher-released` today. The run stops at its next own call.
### D3: docs
- packages/bus/README.md:328: "the run's next bus call refuses `not-holder`" becomes
`thread-revoked`, until the run ends (row 306).
- packages/harness/README.md:296: exit 0 adds `thread-revoked` next to `launcher-released`.
- The `#revokeLost` comment at broker.mjs:1008 changes the same way as the bus README.
## Tests (red first under mos-1272)
### New file packages/bus/tests/revoke-window.test.mjs
It uses access-revoke.test.mjs's fixture shape, copied, because that file is an old test.
- **T1.** A run the timer sweep ended answers `thread-revoked` on `message.receive`, `state`,
`message.read` and `message.send`, and each answer is logged as `action.refused` with code
`thread-revoked`. Its `role.claim` still refuses `run-revoked`. The same holds when the trigger is
a user's request or `access.reload`, one assert each, because all three go through `#revokeLost`.
- **T2, the control.** In the same broker, after the sweep ended the first run:
- a second user thread's run whose claim the human's `assistant.stop` ended answers `not-holder`;
- a third run with a pending limit stop answers `not-holder` on its first `message.receive`, and
then `not-holder` again on its next call (r2, Dewey C2). The first answer comes from
`#limitStop` (:4952) and never reaches `#agent`, so only the second call checks the Set.
### New file packages/cli/tests/revoke-window.test.mjs
thread-revoke.test.mjs's `start()`, copied the way idle-stop-race.test.mjs copied thread-launch's,
with the `threadsState` op replaced by the caller.
- **T3, the forcing test.**
- Setup: a user thread A owned by alice and a human-owned thread B. Both get a message and a
RESULT, so both runs hold.
- Trigger: a hand edit drops alice's grant.
- The hold: the replaced `threadsState` op calls `runtime.threadsState`. That call's sweep ends A's
claim. When the rows include A as `revoked`, and before returning them to the launcher, the op
has the human `assistant.stop` the instance's human-owned threads (B), then waits. It waits until
A's runner has written its verdict line and the launch log has A's `end`, then the same for B.
The launcher doesn't tick while a pass is running, so nothing signals either run while the op
is held.
- Asserts for A:
- the verdict is `thread revoked by the access file`;
- the end is `["stopped", 0, null]`;
- the launch log has no `thread-revoked` event for A's run (r2, Dewey C1). The launcher
removes A from the registry before it records `end` (packages/cli/src/launcher.mjs:643-646),
so when the held op returns, `registry.running` at :705 finds nothing and :711-717 record
and signal nothing. The runner stopped by itself before any SIGTERM;
- the runner log has no `session stopped working` and no `role.release:`, and ends with
`exiting 0`;
- the store's `action.refused` codes for A include `thread-revoked` and not `not-holder`.
- Asserts for B, the control:
- the verdict is `session stopped working: not-holder`;
- the end is `["session-invalid", 22, null]`;
- B's codes include `not-holder`.
- Every wait returns what it last saw, so a mutant fails on an assertion, not a timeout
(sage-2707).
## Mutants
| # | Edit | Must turn red |
|---|------|---------------|
| M1 | `#agent` drops the `#accessRevoked` check: the failure answers `launcher-released` or `not-holder` | T1, T3 (A gets 22) |
| M2 | runner `ended()` maps `thread-revoked` to `EXIT.session` (it moves into `SESSION_GONE`) | T3 (A exits 22) |
| M3 | every ended thread claim marks its run revoked: `#claimEnd` adds `s.business:h.holder_run` to `#accessRevoked` when `h.thread` (anchor `if (h.thread)`, one hit at :6495) | T2 (both halves, the limit half on its second call), T3 (B gets thread-revoked) |
Each anchor must hit exactly once. The kit prints the count, as row 295's M8 receipt did.
## Expected first-run reds
- **New tests (mos-1272).** On a red-first run against fe4ee8c7b, T1 and T3 are red: A gets
`not-holder` and exits 22. T2 is green on both sides. Any other first-run red in T1-T3 I place
myself and report after.
- **Old test that changes: Mos GO (mos-1463, via sage-3483).** In
packages/bus/tests/access-revoke.test.mjs (row 295), `not-holder` becomes `thread-revoked` in the
six asserts at :103, :120, :140, :171, :201 and :262, and the :95 title's "refuses not-holder"
becomes "refuses thread-revoked". Nothing else in the file changes; `git diff --numstat` for it
reads `7 7`. Dewey checks that in the manifest round. At fe4ee8c7b those are the only seven
`not-holder` lines in the file.
- **Checked and not expected to change.**
- thread-revoke.test.mjs:180 asserts `["stopped", 0, null]` for a run that only the SIGTERM ends.
If its runner's poll happened to land in the window, it would get exit 0 now, where today it
would get 22, so the assert holds either way.
- idle-stop-race.test.mjs's control is a human `assistant.stop`, not a revoke, so it stays
`not-holder`/22. M3 would turn it red too.
- A `git grep` of `packages/*/tests/*` finds `not-holder` after a revoke only in
access-revoke.test.mjs.
## Gate (per the brief)
Dewey approves this design, then the manifest. On Sage's gate (mos-1455 D4, sage-3483/3484):
- the new files and access-revoke.test.mjs whole;
- the bus, cli, plugins, webui, business and harness suites;
- every `scripts/test-*.sh` under `timeout -k 10` at three times its longest run (mos-1275);
- M1-M3.
Every suite shows 0 failures. Any red follows mos-1272.
## N items
Both stay out of this row (sage-3483); Sage adds them to DEFERRED at landing. Dewey agrees on N1
(dewey-0918).
- N1. The Set is lost on a broker restart. recover() rebinds an earlier host's run (:1366-1373),
and if that run makes a call before the launcher's SIGTERM, it gets `not-holder` and exits 22, as
every revoked run does today. Seeding the Set from the store at a rebind would need a mark only
`#revokeLost` writes (D1's alternative shows `reason` and `by` aren't one). I'd leave it unless
Dewey wants that mark.
- N2. A revoked run that also has a pending limit stop gets `#limitStop`'s `not-holder` (:4572-4573,
:4952) on `message.receive` and `state`, because that check runs before `#agent`. It's rare; I'd
leave it and record it.
## Round 2 (dewey-0918 CHANGES C1-C3, sage-3483)
- C1: T3 asserts A has no `thread-revoked` launch-log event, in place of "end before the event".
- C2: T2's limit-stopped run makes a second call, which carries M3.
- C3: the gate lists the six suites and every scripts/test-*.sh with 0 failures; mos-1463's
bounds for access-revoke.test.mjs are in "Expected first-run reds".
- Cosmetic: threadIdle's `#claimEnd` is :1133.
## Build (dewey-0920 APPROVE r2, sage-3487)
- Red-first commit d38c5213a: packages/bus/tests/revoke-window.test.mjs (T1 two tests, T2) and
packages/cli/tests/revoke-window.test.mjs (T3), no product code.
- Build commit (this one): D1 in broker.mjs, D2 in runner.mjs, D3 in the two READMEs and the
#revokeLost comment, and the mos-1463 edit to access-revoke.test.mjs (numstat 7 7).
- Nothing has run yet; every run is slot work.
Expected first-run reds, on d38c5213a (new tests, fe4ee8c7b product):
- bus revoke-window: both T1 tests red, A answers `not-holder` where `thread-revoked` is expected.
T2 green.
- cli revoke-window T3 red: A's verdict is `session stopped working: not-holder`, its end
`session-invalid`/22.
- access-revoke.test.mjs is unchanged at d38c5213a, so it stays green there.
On the build commit every file above, and every gate suite, is expected green.
+652
View File
@@ -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.
+652
View File
@@ -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.
+132
View File
@@ -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.
+3
View File
@@ -1585,3 +1585,6 @@ 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).
+82
View File
@@ -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.
+14
View File
@@ -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.
+33 -4
View File
@@ -1,6 +1,6 @@
# PRD: Mosaic Stack
- Status: approved, version 1.15. Jason approved draft 0.4 unchanged as
- Status: approved, version 1.16. 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,17 @@
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.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 +716,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
@@ -1259,8 +1277,10 @@ library is the user's own writing repository.
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
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 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
@@ -1750,6 +1770,15 @@ 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.
## Risks and open questions
+3 -2
View File
@@ -325,8 +325,9 @@ starts such a thread and sends a running one SIGTERM.
Revocation (row 295, #1801, FED R4, federation design 3.7). A user thread is lost when no grant
in the access file covers it at collaborator level, so a downgrade to viewer is a loss. One
transaction ends the held claim of every session of every lost thread, op `revoke`, reason
`access-revoked`; the run's next bus call refuses `not-holder`, and a new run of the thread
refuses `thread-revoked` at `bindLaunch` and at `role.claim`. A rebind of an earlier host's run is
`access-revoked`; the run's bus calls refuse `thread-revoked` until it ends (row 306, so the runner
stops rather than exit as a lost session), and a new run of the thread refuses `thread-revoked` at
`bindLaunch` and at `role.claim`. A rebind of an earlier host's run is
allowed, so the launcher's recovery can end it. Four triggers end the claims, each with its `by`:
the runtime's timer, every 30 s (`access.intervalMs` sets it in process, as `librarySync.intervalMs`
does), which reads the file whatever its stamp (`access-timer`); a user's request or a
+12 -5
View File
@@ -429,6 +429,10 @@ export class Broker {
// landRelease release and then signal, so the run's own calls in between answer launcher-released,
// not not-holder, and the runner exits stopped instead of as a lost session.
#launcherReleased = new Set();
// Row 306 (#1813): runs whose claim #revokeLost ended, by business:run, until endLaunch. The launcher
// signals only after its threadsState op returns, so the run's own calls in between answer
// thread-revoked, not not-holder, and the runner exits stopped instead of as a lost session.
#accessRevoked = new Set();
#clock = 0;
#processing;
// credentialStatus is the runtime's metadata-only Credentials.status(); the broker never gets use().
@@ -1005,10 +1009,10 @@ export class Broker {
covers(g, { business: t.business, project: t.project, instance: t.instance }, now, { level: 'collaborator' }));
}
// Design 3.7: on a loss, one transaction ends the held claim of every session of every user thread
// the access file no longer covers, in every business. The run's next bus call refuses not-holder
// (F10), and a later claim refuses thread-revoked. Runs only when the read is new: a forced read,
// a stamp it hasn't swept, or no stamp at all. `doc` is a read the caller just made, so a request
// reads once. Returns the ended claims.
// the access file no longer covers, in every business. The run's bus calls refuse thread-revoked
// until it ends (row 306), and a later claim refuses thread-revoked. Runs only when the read is
// new: a forced read, a stamp it hasn't swept, or no stamp at all. `doc` is a read the caller just
// made, so a request reads once. Returns the ended claims.
#revokeLost(by, force = false, doc = this.#accessDoc(force)) {
const stamp = this.#accessSeen.stamp;
if (!force && stamp !== null && stamp === this.#accessSwept) return [];
@@ -1023,6 +1027,7 @@ export class Broker {
ended.push(h);
}
});
for (const h of ended) this.#accessRevoked.add(h.business + ':' + h.holder_run);
this.#accessSwept = stamp;
return ended;
}
@@ -1067,7 +1072,8 @@ export class Broker {
if (s.human) fail('agent-required');
const h = this.#own(s);
if (h?.op !== 'claim' || (s.thread ? h.generation !== this.#runGeneration(s) : h.holder_run !== s.run))
fail(this.#launcherReleased.has(s.business + ':' + s.run) ? 'launcher-released' : 'not-holder');
fail(this.#launcherReleased.has(s.business + ':' + s.run) ? 'launcher-released'
: this.#accessRevoked.has(s.business + ':' + s.run) ? 'thread-revoked' : 'not-holder');
return h;
}
// Row 264a (#1769, T2): the generation a thread run holds, its latest claim's in its session, or
@@ -1392,6 +1398,7 @@ export class Broker {
if (exitCode !== null && !Number.isSafeInteger(exitCode)) fail('invalid-request');
this.#ended.add(key);
this.#launcherReleased.delete(key);
this.#accessRevoked.delete(key);
for (const [cap, s] of this.#sessions)
if (!s.human && !s.reader && s.business === record.business && s.run === record.run) this.#sessions.delete(cap);
return this.#store.transaction(() => {
+7 -7
View File
@@ -92,7 +92,7 @@ function setup(t, { runs = true, grants = [grant(), grant({ user: 'bob' })] } =
const withoutAlice = (gs) => gs.filter((g) => g.user !== 'alice');
test('R4: the timer sweep after a hand edit ends only the lost user\'s run; its next call refuses not-holder', (t) => {
test('R4: the timer sweep after a hand edit ends only the lost user\'s run; its next call refuses thread-revoked', (t) => {
const { b, code, edit, claim, A } = setup(t);
edit(withoutAlice);
const ended = b.accessSweep();
@@ -100,7 +100,7 @@ test('R4: the timer sweep after a hand edit ends only the lost user\'s run; its
assert.deepEqual({ ...ended[0], session: undefined }, { business: 'demo', thread: A, session: undefined, run: 'a-run' });
assert.equal(typeof ended[0].session, 'string');
assert.deepEqual(claim('a-run'), { op: 'revoke', reason: 'access-revoked', by: 'access-timer' });
assert.equal(code('a', 'message.receive'), 'not-holder', 'the ended run');
assert.equal(code('a', 'message.receive'), 'thread-revoked', 'the ended run');
assert.equal(code('b', 'message.receive'), null, 'another user\'s run stays');
assert.equal(code('h', 'message.receive'), null, 'the human\'s run stays');
assert.deepEqual([claim('b-run').op, claim('h-run').op], ['claim', 'claim']);
@@ -117,7 +117,7 @@ test('R4: an expiry with no write and no request ends the run at the next timer
assert.equal(code('bob', 'thread.list'), null);
assert.equal(claim('a-run').op, 'claim');
assert.deepEqual(b.accessSweep().map((h) => h.run), ['a-run']);
assert.equal(code('a', 'message.receive'), 'not-holder');
assert.equal(code('a', 'message.receive'), 'thread-revoked');
assert.equal(code('b', 'message.receive'), null);
});
@@ -137,7 +137,7 @@ test('R4: another user\'s request after a hand edit ends the lost user\'s run, a
assert.equal(code('a', 'message.receive'), null, 'an agent request is not a trigger');
assert.equal(code('bob', 'thread.list'), null);
assert.deepEqual(claim('a-run'), { op: 'revoke', reason: 'access-revoked', by: 'access-change' });
assert.equal(code('a', 'message.receive'), 'not-holder');
assert.equal(code('a', 'message.receive'), 'thread-revoked');
assert.equal(code('b', 'message.receive'), null);
assert.equal(code('h', 'message.receive'), null);
});
@@ -168,7 +168,7 @@ test('R4: access.reload ends the lost runs at once for the human; the tester, a
assert.deepEqual(ended.map((h) => [h.thread, h.run]), [[A, 'a-run']]);
assert.equal(typeof ended[0].session, 'string');
assert.deepEqual(claim('a-run'), { op: 'revoke', reason: 'access-revoked', by: 'jason' });
assert.equal(code('a', 'message.receive'), 'not-holder');
assert.equal(code('a', 'message.receive'), 'thread-revoked');
assert.equal(code('b', 'message.receive'), null);
assert.deepEqual(b.accessSweep(), []);
});
@@ -198,7 +198,7 @@ test('R4: threadsState after an expiry with no write and no sweep ends the claim
const a = row(A);
assert.deepEqual([a.revoked, a.holder], [true, null]);
assert.deepEqual(claim('a-run'), { op: 'revoke', reason: 'access-revoked', by: 'access-expiry' });
assert.equal(code('a', 'message.receive'), 'not-holder');
assert.equal(code('a', 'message.receive'), 'thread-revoked');
assert.deepEqual([row(B).holder, claim('b-run').op], ['b-run', 'claim']);
// Ended once: the next call writes no second revoke.
row(A);
@@ -259,7 +259,7 @@ test('R4 runtime: a hand edit ends the run at the first timer period, intervalMs
t.mock.timers.tick(ACCESS_SWEEP_MS - 1);
assert.equal(receive(), null, 'before the first period');
t.mock.timers.tick(1);
assert.equal(receive(), 'not-holder', 'at the first period');
assert.equal(receive(), 'thread-revoked', 'at the first period');
// After close the timer is gone: the sweep is never called again.
let sweeps = 0;
b.accessSweep = () => void sweeps++;
+140
View File
@@ -0,0 +1,140 @@
// Row 306 (#1813, row 295's N1): a run whose claim #revokeLost ended answers thread-revoked on every
// claim-needing call until the run ends, so the runner stops it instead of exiting session-invalid.
// A claim another cause ended still answers not-holder. access-revoke.test.mjs's fixture, copied, with
// a limit stub and a usage stub for the limit stop. BUILD.md (agents/morgana/work/queue-306) names
// the mutant each test kills.
import test from 'node:test';
import assert from 'node:assert/strict';
import { mkdtempSync, readFileSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { Store } from '../src/store.mjs';
import { Broker } from '../src/broker.mjs';
const shipped = (name) =>
JSON.parse(readFileSync(fileURLToPath(new URL(`../../../roles/${name}.json`, import.meta.url)), 'utf8'));
const grant = (over = {}) => ({
id: `g-${over.user ?? 'alice'}`, user: 'alice', business: 'demo', projects: ['*'], instances: ['assistant'], level: 'collaborator', ...over,
});
const BUSINESSES = {
demo: {
id: 'demo', human: 'jason', arbiters: { technical: 'chief', delivery: 'chief' }, vars: { 'bus.tester': true }, plugins: { harness: ['pi'] },
roles: {
chief: { definition: 'chief-of-staff', authority: { withinRole: ['message.send'], crossRole: [] } },
assistant: { definition: 'assistant', authority: { withinRole: ['message.send'], crossRole: [] } },
},
definitions: { 'chief-of-staff': {}, assistant: { messaging: shipped('assistant').messaging } },
},
};
const HIT = { path: ['tokens', 'instances', 'assistant'], limit: 100, count: 120, unknownTurns: 1 };
// Alice and Bob each hold a collaborator grant and own a thread; the human owns thread H. Each thread
// has a claimed run: a-run on A, b-run on B, h-run on H. `stops` are the limit checks' answers, in order.
function setup(t, { stops = [] } = {}) {
const root = mkdtempSync(join(tmpdir(), 'bus-revoke-window-'));
const store = new Store(root);
t.after(() => {
store.close();
rmSync(root, { recursive: true, force: true });
});
const access = { doc: { accessVersion: 1, revision: 1, users: [], grants: [grant(), grant({ user: 'bob' })] }, rev: 1 };
const b = new Broker({
store,
businesses: BUSINESSES,
access: () => access.doc,
accessStamp: () => String(access.rev),
limits: { mustStop: async () => stops.shift() ?? { stop: false } },
usage: { collect: async () => ({ recorded: true }), view: () => ({}) },
});
const caps = { human: b.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true }) };
const call = (who, verb, args = {}) => b.request(caps[who], { verb, args });
const code = (who, verb, args = {}) => {
try {
call(who, verb, args);
} catch (e) {
return e.code;
}
return null;
};
const edit = (fn) => {
access.doc = { ...access.doc, revision: access.doc.revision + 1, grants: fn(access.doc.grants) };
access.rev++;
};
const launch = (name, thread) => {
caps[name] = b.bindLaunch({ business: 'demo', role: 'assistant', run: `${name}-run`, harness: 'pi', thread });
return call(name, 'role.claim');
};
const claim = (run) => ({ ...store.get('SELECT op, reason, by FROM thread_claims WHERE holder_run=? ORDER BY seq DESC LIMIT 1', run) });
// The codes of the run's refusals, as request() logs them.
const refused = (run) =>
store.all("SELECT body FROM events WHERE kind='action.refused' AND actor_run=? ORDER BY seq", run).map((e) => JSON.parse(e.body).code);
const P = call('human', 'project.create', { name: 'shared' }).id;
caps.alice = b.bindUser({ business: 'demo', user: 'alice' });
caps.bob = b.bindUser({ business: 'demo', user: 'bob' });
const A = call('alice', 'thread.create', { project: P, name: 'alice work' }).id;
const B = call('bob', 'thread.create', { project: P, name: 'bob work' }).id;
const H = call('human', 'thread.create', { project: P, name: 'owner work' }).id;
launch('a', A);
launch('b', B);
launch('h', H);
return { b, store, caps, call, code, edit, claim, refused, A, B, H };
}
const withoutAlice = (gs) => gs.filter((g) => g.user !== 'alice');
// The run's claim-needing calls after the sweep: each answers thread-revoked, and each is logged.
function lateCalls(code) {
return [
code('a', 'message.receive'),
code('a', 'state'),
code('a', 'message.read', { id: 'm-none' }),
code('a', 'message.send', { to: 'human', body: 'late' }),
];
}
test('row 306 T1: a run the timer sweep ended answers thread-revoked on every claim-needing call, logged, and its claim still refuses run-revoked', (t) => {
const { b, code, edit, claim, refused } = setup(t);
edit(withoutAlice);
assert.deepEqual(b.accessSweep().map((h) => h.run), ['a-run']);
assert.deepEqual(claim('a-run'), { op: 'revoke', reason: 'access-revoked', by: 'access-timer' });
assert.deepEqual(lateCalls(code), Array(4).fill('thread-revoked'));
assert.deepEqual(refused('a-run'), Array(4).fill('thread-revoked'));
assert.equal(code('a', 'role.claim'), 'run-revoked', 'role.claim keeps its order');
assert.equal(code('b', 'message.receive'), null, 'another user\'s run stays');
assert.equal(code('h', 'message.receive'), null, 'the human\'s run stays');
});
test('row 306 T1: a user\'s request and access.reload end the run the same way, and it answers thread-revoked', (t) => {
for (const trigger of ['request', 'reload']) {
const { code, call, edit, claim } = setup(t);
edit(withoutAlice);
if (trigger === 'request') assert.equal(code('bob', 'thread.list'), null);
else assert.deepEqual(call('human', 'access.reload').ended.map((h) => h.run), ['a-run']);
assert.equal(claim('a-run').reason, 'access-revoked', trigger);
assert.equal(code('a', 'message.receive'), 'thread-revoked', trigger);
}
});
// The control (Dewey's C2 in dewey-0918): the first call after a pending limit stop answers from
// #limitStop and never reaches #agent, so only the run's next call checks how its claim ended.
test('row 306 T2: after the sweep, a run the human stopped and a run the limit stop ended still answer not-holder', async (t) => {
const { b, call, code, edit, claim, refused, B } = setup(t, { stops: [{ stop: true, check: 'token-limit', hit: HIT }] });
edit(withoutAlice);
assert.deepEqual(b.accessSweep().map((h) => h.run), ['a-run']);
// The human's stop takes the human's own thread only: H.
assert.deepEqual(call('human', 'assistant.stop', { instance: 'assistant' }).stopped.map((s) => s.run), ['h-run']);
assert.equal(code('h', 'message.receive'), 'not-holder', 'stopped by the human');
assert.equal(code('h', 'state'), 'not-holder', 'stopped by the human, again');
// Bob's turn ends at the limit, and the run's next receive ends its claim.
const { id } = call('bob', 'thread.send', { thread: B, body: 'look' });
call('b', 'message.receive');
await call('b', 'usage.begin', { turn: id });
await call('b', 'usage.end', { turn: id });
assert.equal(code('b', 'message.receive'), 'not-holder', 'the limit stop');
assert.equal(claim('b-run').by, 'limit-check');
assert.equal(code('b', 'message.receive'), 'not-holder', 'the limit-stopped run\'s next call');
assert.equal(code('b', 'state'), 'not-holder');
assert.deepEqual(refused('h-run'), ['not-holder', 'not-holder']);
assert.deepEqual(refused('b-run'), ['not-holder', 'not-holder', 'not-holder']);
});
+228
View File
@@ -0,0 +1,228 @@
// Row 306 (#1813, row 295's N1): the access sweep ends a lost user thread's claim in the threadsState
// op, and the launcher sends SIGTERM only after the op returns. A runner call the broker answers in
// between used to get not-holder, and the run ended session-invalid/22 instead of stopped/0. This test
// holds the op open until a call has landed in that window and the runner has exited, so it doesn't
// depend on timing. The launcher skips a tick while one is running, so nothing else signals a run
// while the op is held.
//
// thread-revoke.test.mjs's host, with the access file, and idle-stop-race.test.mjs's short tick and
// poll, with threadsState replaced by the caller. BUILD.md (agents/morgana/work/queue-306) names the
// mutant each test kills.
import { test } from "node:test";
import assert from "node:assert/strict";
import { spawnSync } from "node:child_process";
import { existsSync, readFileSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { fileURLToPath } from "node:url";
import { launchDoc } from "../../business/tests/helpers.mjs";
import { BusError } from "../../bus/src/broker.mjs";
import { startBroker } from "../../bus/src/runtime.mjs";
import { Store } from "../../bus/src/store.mjs";
import { gitEnv } from "../../seat/src/checkout.mjs";
import { sandboxProblem } from "../../seat/src/sandbox.mjs";
import { launchLogFile, SESSION_CREDENTIALS } from "../../seat/src/session.mjs";
import { bootConfig, loadSystem } from "../src/config.mjs";
import { createLauncher } from "../src/launcher.mjs";
import { fakeHarnesses, fixture, tmp } from "./helpers.mjs";
const ADAPTER = fileURLToPath(new URL("./fixtures/thread-adapter.mjs", import.meta.url));
const skip = sandboxProblem() ?? false;
// A mutant's kill is an assertion failure, not a timeout (sage-2707): the wait returns what it last
// saw and the assertions after it decide.
async function settle(fn, ms = 20000) {
const end = Date.now() + ms;
let v;
while (Date.now() < end) {
v = await fn();
if (v) return v;
await new Promise((r) => setTimeout(r, 50));
}
return v;
}
function gitIn(cwd, ...args) {
const r = spawnSync("git", ["-c", "user.name=test", "-c", "[email protected]", "-C", cwd, ...args], { env: gitEnv(), encoding: "utf8" });
assert.equal(r.status, 0, r.stderr);
}
// The assistant is the thread instance. Alice holds a collaborator grant on it in the access file;
// `grant(false)` is the hand edit that removes it. The idle stop is an hour, so it never runs here.
function prepare(t) {
const root = tmp(t, "mosaic-revoke-window-");
const f = fixture(root, "acme", (doc) => {
doc.roles.chief.vars = { harness: "pi", model: "claude-opus-5-5", thinking: "high" };
doc.roles.assistant = { definition: "assistant", vars: { harness: "pi", model: "claude-sonnet-5-5", thinking: "high" } };
doc.launch = launchDoc("chief", ["coder", "assistant"], { opus: 1, sonnet: 2 });
doc.launch.threadIdleSeconds = 3600;
return doc;
});
for (const k of SESSION_CREDENTIALS.flat()) delete f.env[k];
const project = f.doc.projects.stack.root;
gitIn(project, "init", "-q", "-b", "main");
writeFileSync(join(project, "file.txt"), "one\n");
gitIn(project, "add", "file.txt");
gitIn(project, "commit", "-q", "-m", "one");
const adapter = join(root, "adapter.sh");
writeFileSync(adapter, `exec '${process.execPath}' '${ADAPTER}'\n`, { mode: 0o644 });
const file = join(root, "access.json");
let revision = 0;
const grant = (on) =>
writeFileSync(file, JSON.stringify({
accessVersion: 1,
revision: ++revision,
users: [{ id: "alice", home: "local", subjects: [{ provider: "authentik", sub: "alice-sub" }] }],
grants: on ? [{ id: "g-alice", user: "alice", business: "acme", projects: ["*"], instances: ["assistant"], level: "collaborator" }] : [],
}), { mode: 0o600 });
grant(true);
const context = { providers: ["authentik"], peers: [], businesses: { acme: { human: f.doc.human, instances: Object.keys(f.doc.roles) } }, ssoSubjects: [] };
return { root, f, adapter, access: { file, context }, grant };
}
// A host and its launcher, ticking every 100 ms, with runners that poll every 100 ms, so a run's
// call lands in the held window.
async function start(t, { f, adapter, access }, threadsState) {
const system = loadSystem({ env: f.env });
const { trackers, ...boot } = bootConfig({ system, businessId: "acme", env: f.env });
assert.equal(trackers, undefined);
const runtime = await startBroker({ ...boot, access });
const ops = {
identity: (m) => runtime.identity(m.cap),
authorizeLaunch: (m) => runtime.authorizeLaunch(m.cap, m.instance),
refuse: (m) => runtime.refuse(m.cap, m.code, m.subject),
endLaunch: (m) => runtime.endLaunch(m.record),
credentialStatus: (m) => runtime.credentialStatus(m.business, m.role),
threadsState: (m) => threadsState(runtime, m),
threadIdle: (m) => runtime.threadIdle(m.record),
mayLaunch: (m) => runtime.mayLaunch(m),
landHeld: (m) => runtime.landHeld(m.record),
landHolders: (m) => runtime.landHolders(m.business),
landRelease: (m) => runtime.landRelease(m.record),
sessionClears: (m) => runtime.sessionClears(m.business),
};
const refusing = (what, fn) => async (m) => {
try {
return await fn(m);
} catch (e) {
const code = e instanceof BusError ? e.code : `${what}-refused`;
throw Object.assign(new Error(`${what} refused: ${code}`), { code });
}
};
const hooks = [];
let closing = null;
const host = {
business: "acme",
path: runtime.path,
dataRoot: f.dataRoot,
op: refusing("launch-op", (m) => {
if (!Object.hasOwn(ops, m.op)) throw new BusError("invalid-host-request");
return ops[m.op](m);
}),
bindLaunch: refusing("launch bind", (r) => runtime.bindLaunch(r)),
beforeClose: (fn) => void hooks.push(fn),
};
const launcher = createLauncher({
host,
system,
env: f.env,
makeLoader: await fakeHarnesses(t, { pi: adapter, "claude-code": adapter }),
sessionDefaults: { pollInterval: 100 },
harnessVersion: "0.85.1",
readOnly: [ADAPTER],
threadTickMs: 100,
log: () => {},
});
const close = () =>
(closing ??= (async () => {
for (const fn of hooks) await fn(0);
await runtime.close();
})());
t.after(close);
await launcher.listen();
const human = runtime.broker.bindHuman({ business: "acme", human: f.doc.human, via: "cli", outsideAgent: true });
let alice = null;
const call = (verb, args = {}) => runtime.broker.request(human, { verb, args });
const as = (verb, args = {}) => runtime.broker.request((alice ??= runtime.broker.bindUser({ business: "acme", user: "alice" })), { verb, args });
return { runtime, launcher, call, as, close };
}
const launchLog = (f) =>
existsSync(launchLogFile(f.dataRoot, "acme"))
? readFileSync(launchLogFile(f.dataRoot, "acme"), "utf8").trim().split("\n").map((l) => JSON.parse(l))
: [];
const runnerLog = (f, run) => {
const p = join(f.dataRoot, "launches", "acme", run, "runner.log");
return existsSync(p) ? readFileSync(p, "utf8") : "";
};
const ended = (f, run) => launchLog(f).find((e) => e.event === "end" && e.run === run);
const launched = (f, thread) => launchLog(f).find((e) => e.event === "launch" && e.thread === thread)?.run ?? null;
// The runner's own verdict on a refusal: the revoke line, the launcher-release line, or a lost session's.
const verdict = (f, run) =>
/runner: (thread revoked by the access file|session released by the launcher|session stopped working: [a-z-]+)\n/.exec(runnerLog(f, run))?.[1] ?? null;
// Send on the thread and wait for the run's RESULT, so the run holds the thread.
async function ask(send, read, thread, body) {
const sent = send("thread.send", { thread, body });
assert.ok(await settle(() => read("thread.messages", { thread }).find((m) => m.in_reply_to === sent.id && m.class === "RESULT")), `no RESULT on ${thread}`);
}
test("row 306 REQ-LAUNCH-1 R4 a revoked run whose call lands before the SIGTERM ends stopped/0; a run the human stopped in the same window still ends session-invalid/22", { skip, timeout: 120000 }, async (t) => {
const prepared = prepare(t);
const { f } = prepared;
let A = null;
let window = null;
let host = null;
// The first pass that sees A revoked: the sweep in runtime.threadsState has ended A's claim. Inside
// the held window the human stops their own thread's run, which no pass can signal while the op is held.
const threadsState = async (runtime, m) => {
const rows = runtime.threadsState(m.business);
if (window || !rows.some((x) => x.thread === A && x.revoked)) return rows;
window = { run: launched(f, A) };
window.stopped = host.call("assistant.stop", { instance: "assistant" }).stopped;
// Both runners decide on their own before the op returns and the launcher can signal.
window.revoked = await settle(() => ended(f, window.run) && verdict(f, window.run));
window.control = window.stopped[0]?.run ?? null;
window.human = window.control ? await settle(() => ended(f, window.control) && verdict(f, window.control)) : null;
window.done = true;
return rows;
};
host = await start(t, prepared, threadsState);
const project = host.call("project.create", { name: "stack work", repo: "stack" }).id;
A = host.as("thread.create", { project, name: "alice work" }).id;
const B = host.call("thread.create", { project, name: "owner work" }).id;
await Promise.all([ask(host.as, host.as, A, "for A"), ask(host.call, host.call, B, "for B")]);
// The hand edit. No user request follows, so the launcher's threadsState is what sweeps.
prepared.grant(false);
await settle(() => window?.done, 60000);
assert.ok(window?.done, JSON.stringify(launchLog(f)));
const { run, control } = window;
assert.equal(run, launched(f, A));
assert.deepEqual(window.stopped.map((s) => [s.thread, s.run]), [[B, launched(f, B)]], "the human's stop took only the human's thread");
await settle(() => ended(f, run) && ended(f, control), 60000);
// The revoked run refused in the window and exited by itself before the op returned.
assert.equal(window.revoked, "thread revoked by the access file", runnerLog(f, run));
const log = launchLog(f);
const end = (r) => log.find((e) => e.event === "end" && e.run === r);
assert.deepEqual([end(run).reason, end(run).exitCode, end(run).signal], ["stopped", 0, null]);
// The launcher removed the run before it recorded the end, so the pass after the op had nothing to
// signal (Dewey's C1 in dewey-0918).
assert.deepEqual(log.filter((e) => e.event === "thread-revoked" && e.run === run), []);
assert.doesNotMatch(runnerLog(f, run), /session stopped working/);
// The sweep already ended the claim, so the runner doesn't release it at exit.
assert.doesNotMatch(runnerLog(f, run), /runner: role\.release:/);
assert.match(runnerLog(f, run), /runner: exiting 0\n/);
// The control: a real not-holder in the same window still ends 22, with no signal.
assert.equal(window.human, "session stopped working: not-holder", runnerLog(f, control));
assert.deepEqual([end(control).reason, end(control).exitCode, end(control).signal], ["session-invalid", 22, null]);
assert.match(runnerLog(f, control), /runner: exiting 22\n/);
await host.close();
const store = new Store(f.dataRoot);
t.after(() => store.close());
const codes = (r) => store.all("SELECT body FROM events WHERE kind='action.refused' AND actor_run=? ORDER BY seq", r).map((e) => JSON.parse(e.body).code);
assert.ok(codes(run).includes("thread-revoked"), JSON.stringify(codes(run)));
assert.ok(!codes(run).includes("not-holder"), JSON.stringify(codes(run)));
assert.ok(codes(control).includes("not-holder"), JSON.stringify(codes(control)));
});
+1 -1
View File
@@ -293,7 +293,7 @@ it never touches the disk and isn't in the environment or argv.
| Exit | Meaning | Launch end reason |
|---|---|---|
| 0 | stopped: by a signal, or the launcher's idle stop or land-relaunch released the claim (`launcher-released`) | `stopped` |
| 0 | stopped: by a signal, the launcher's idle stop or land-relaunch released the claim (`launcher-released`), or the access sweep ended a lost user thread's claim (`thread-revoked`, row 306) | `stopped` |
| 2 | bad run directory or stdin | `failed` |
| 20 | founder credentials | `founder-credentials` |
| 21 | `role.claim` refused | `claim-refused` |
+7 -3
View File
@@ -56,6 +56,9 @@ const SESSION_GONE = new Set(["unauthenticated", "not-holder", "run-ended"]);
// Row 302 (#1809): the launcher's idle stop or land-relaunch released the claim and will stop the run.
// That is a stop, not a lost session, so the run exits stopped even when its call lands before the signal.
const LAUNCHER_RELEASED = "launcher-released";
// Row 306 (#1813): the access sweep ended the claim of a thread whose user lost the grant, and the
// launcher will stop the run. That is a stop too, when the run's call lands before the signal.
const THREAD_REVOKED = "thread-revoked";
const BODY_MAX = 32000;
const DEFAULTS = Object.freeze({ turnTimeout: 900, pollInterval: 2000, brokerRetries: 30 });
@@ -485,12 +488,13 @@ export async function main(runDir, { stdin = process.stdin, env = process.env, l
let code = EXIT.stopped;
let failures = 0;
// Whether a broker refusal ends the run, and how: a launcher release stops it, a gone session is 22.
// Whether a broker refusal ends the run, and how: a launcher release or an access revoke stops it,
// a gone session is 22. Either stop already ended the claim, so `released` skips the exit release.
// The reply site has logged its failure already, so it passes say=false.
let released = false;
const ended = (err, say = true) => {
if (err.code === LAUNCHER_RELEASED) {
log("runner: session released by the launcher");
if (err.code === LAUNCHER_RELEASED || err.code === THREAD_REVOKED) {
log(err.code === LAUNCHER_RELEASED ? "runner: session released by the launcher" : "runner: thread revoked by the access file");
released = true;
return true;
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"prd": "docs/prd/mosaic-stack.md",
"version": "1.15",
"version": "1.16",
"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" },
+1 -1
View File
@@ -21,7 +21,7 @@ test("the list holds the PRD's requirement ids, in its order, at its version", (
assert.equal(ids.length, 85);
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.16']);
});
test('the committed list loads frozen', () => {