Commit Graph
239 Commits
Author SHA1 Message Date
jason.woltje c7ddc7d31c fix(harness): mark first streamed model output (#797) 2026-11-06 02:02:43 -06:00
jason.woltje 5df42478b6 fix(cli): answer native dialogs in the tester browser (#797)
A click on the test Console's Resume button opened window.confirm and the
browser daemon hung: the mouse release, screenshots and the frame tree all
block until the dialog is answered, and ui-browser had no way to answer it.

A click that opens a dialog now returns {dialog:{type,message}}. The new
command `dialog accept|dismiss` answers it and records the type, message
and answer in the receipt. While a dialog is open other commands except
stop refuse (journaled), and no screenshot or URL check is attempted.
A real-Chromium confirm test covers accept, dismiss and the refusals.
2026-11-06 00:13:16 -06:00
jason.woltje 22e3d21889 fix(cli): require owner-named pin targets and fixed serve paths (#797)
A pin corroborates a ledger target only when its binding names its own
campaign and the owner campaign. serveBudget freezes the startup campaign
and ledger paths and retains the ledger with its startup target; a running
service accepts its exactly unchanged startup ledger. Without retained
evidence an owner business/config retarget now refuses as ambiguous.
2026-11-05 23:22:32 -06:00
jason.woltje 85e1ec5d15 fix(cli): refuse conflicting ledger targets before halt (#797)
A valid owner pin and a v2 ledger that disagreed on target still halted
the ledger's binding, so a business-only edit or a foreign ledger could
redirect the stop. The ledger target now needs owner corroboration;
otherwise the owner-verified pin replaces it, or the check refuses.
2026-11-05 22:55:43 -06:00
jason.woltje fce831c053 fix(cli): confine browser mounts and keep halt on binding damage (#797) 2026-11-05 22:34:36 -06:00
jason.woltje 905d313cdf fix(cli): isolate browser network and halt on ledger loss (#797) 2026-11-05 21:52:54 -06:00
jason.woltje 19e6cb0f1e fix(cli): address ui797 support review findings (#797) 2026-11-05 21:21:50 -06:00
jason.woltje bd8340b9b8 feat(cli): add isolated ui797 acceptance support (#797) 2026-11-05 20:53:44 -06:00
jason.woltje 51525a31d6 test(lifecycle): cover three delivery paths and crash recovery (#1839) 2026-11-04 14:47:45 -06:00
jason.woltje f7378f365c fix(release): read inline migration pairs in the release chain reader (#811) 2026-11-04 13:20:11 -06:00
jason.woltje 647626bdd1 feat(bus): resume product requests through typed role continuations (#1839) 2026-11-04 12:18:10 -06:00
jason.woltje b5a58b48b4 feat(tasks): bind requirement and git admission to product scope (#1839) 2026-11-04 11:24:39 -06:00
jason.woltje 793f3b157d fix(cli): upgrade and roll back Case 2 proxy hubs (#772) 2026-11-04 11:07:57 -06:00
jason.woltje c558498062 feat(bus): bootstrap a confirmed new project and admit it at runtime (#1839)
Lifecycle Task 2 (#797). A confirmed new-project selection now becomes a
usable product: the code checkout, the organization mapping, the records
repository with the original intent as the owner's spec commit, the chat
association and the working repository, each journaled as its own receipt
(bootstrap:<plan_digest>:<step>) and recoverable after a kill.

- business: addProject is a private exact-add writer under the existing
  organization lock and receipt discipline; hold runs a synchronous check
  under that lock; findAddition recovers a prepared receipt. Ordinary
  writers still refuse every project change.
- bus: prepareBootstrap and executeBootstrap; activateManagedProject
  reloads only a receipt-backed additive root and admits it to the broker
  after readiness; request.admission host IPC op for the launcher.
- #800: the bound organization revision and association are re-verified
  inside the organization lock at the start of execution; a mismatch
  records request-plan-stale and performs no effect.
- cli: trackerFor skips reserved products; the launcher refuses to clone a
  product the bus has not admitted.
- seat: initializeWorking seeds the working repository, host-only, with no
  work ref or push authority.
- schema: append-only migration 3o to 3p widens the request_events kind
  list with bootstrap.stale and bootstrap.completed.
2026-11-03 19:50:32 -06:00
jason.woltje 3b071cac7b feat(bus): persist pre-task request intake and selection (#1839) 2026-11-03 17:53:45 -06:00
jason.woltje 18a0bd47d7 Merge Console writes: factory Console takes the paired --sso --send; .53 launches through the proxy (Vikunja #415) 2026-11-02 22:16:25 -06:00
jason.woltje bd79daffdd fix(case2-unit): factory Console takes the paired --sso --send; .53 launches through the proxy (Vikunja #415, #416)
The factory profile of scripts/case2-unit.sh now takes the bare pair
--sso --send, ported from the lane's serve_flags rule (b00019548). Either
flag alone refuses, and the proxy preview set and the proof pair still
refuse. Before any unit write, a bounded query run as the stack user,
through the existing config-query supervisor, checks that the stack
user's system config has console.sso; the Console refuses --sso without
it at start (packages/webui/src/cli.mjs:95). The server needs no change.

The library profile is unchanged: still read-only, still refusing --send
and --sso. Taking library --send with forward-auth and proof would need
the #385 refusal reverted in cli.mjs:63, serve.mjs:681 and the service,
release and upgrade scripts, so it is not done here.

docs/guides/case1-business.mosaic-stack.json now launches
claude-opus-5-5 with provider proxy, route anthropic, under account
factory with credential proxy.
2026-11-02 22:09:01 -06:00
jason.woltje b9811c492f Merge #774 R2: the first proxy check gates the route the final check picks (Vikunja #774) 2026-11-02 21:52:46 -06:00
jason.woltje b8f01a189f fix(row 332 R2): proxy first check gates the route the final check picks (Vikunja #774)
Route selection moves into one helper, pickRoute(proxyOf), that both checks call: the
primary preflight, and the fallback with its own preflight only when the primary's
fails, with the same messages. The final check passes proxyFor and is otherwise
unchanged. The first check of a proxy launch passes a stand-in session proxy (marker
key PENDING_ADMISSION_KEY and the configured loopback base URL), which reaches only
the preflights, then runs gate() with a null session proxy on the predicted route only.
The round 1 union over both routes is gone.

The managed fixture takes extra (more harnesses switched on), real (harnesses loaded
unfaked) and hostEnv. Seven tests in proxy-launch-order.test.mjs.
2026-11-02 21:37:48 -06:00
jason.woltje 180fb8ab00 fix(row 333 follow-ups R3): a spread before import is a dynamic import (Vikunja #779)
The negative lookbehind in DYNAMIC and in the dynamic branch of IMPORT excluded any dot
before `import`. That also skipped the last dot of the spread punctuator, so
`${({...import('../x.mjs')})}` returned [] for an existing, a missing and an outside
target, and `{...import(name)}` in plain code was neither returned nor refused.

Both patterns now share one fragment: a word character or $ before `import`, or a single
dot (x.import, x?.import), makes it a property call; a dot that follows another dot ends a
spread and does not exclude it. `1..import(` is read as an import too, which errs toward
refusal; the header names it.

Tests: a spread inside a substitution refuses for an existing, a missing and an outside
target and for array spread; a spread in plain code is returned, reaches the target
checks, and is refused when its argument is not a plain string; x.import and x?.import
stay property calls in plain code and in a substitution.
2026-11-02 21:13:56 -06:00
jason.woltje d3b6ab11da test(row 333 follow-ups R2): refuse a dynamic import inside a template substitution, read division after ++ and -- (Vikunja #779)
The business-imports helper blanked a whole template literal, so a dynamic import inside a
${...} substitution was neither found nor refused and skipped the existence and containment
checks. The scanner now reads a substitution to its closing brace, refuses it with
"unsupported import inside a template substitution" when it holds a dynamic import, and drops
it otherwise, so a nested template and a brace inside a string no longer end it early.

A slash after a postfix ++ or -- was read as the start of a regular expression, so
`n++ / 2` threw "unterminated regular expression". After a ++ or -- pair that follows an
operand the slash is division; after one that follows an operator it still starts a regular
expression. The header names the rare form this still misreads.

Output on the real tree is byte-identical.
2026-11-02 20:59:35 -06:00
jason.woltje 85ecdfbde5 fix(row 332): proxy first check runs every key-independent refusal; testProxy test option (Vikunja #774)
F1: with system.proxy set, the first launcher check no longer returns
before the account, sandbox, capacity and limit checks. It skips only the
harness preflight and the session proxy key match, which need the key P2
admits in startLocked. A launch that can never start now refuses before
authorizeLaunch, the workspace and checkouts, and modelPreflight. The first
proxy pass accepts only credential "proxy" for a declared account, tries
the fallback model when the primary refuses, and lets mayLaunch
key-quota-no-model-key through so P2 can issue the first key. The final
check is unchanged and still runs before newRun and spawn.

F4: the proxy test option is renamed testProxy and createLauncher throws
test-proxy-refused when it is given with system.proxy.
launch-account.test.mjs is a second caller, so the option stays.

Tests: proxy-launch-order.test.mjs (6), launcher.test.mjs F4 throw test;
the managed launch fixture gains bwrap, admit and trace.ops.
2026-11-02 20:51:51 -06:00
jason.woltje 5fbf3d2b51 test(row 333): hold the port a refusal test uses instead of probing and closing it (Vikunja #782)
control-board serve.test: the non-loopback refusal test took a port from a
probe-and-close helper and then called startServer on it. It now binds its
own listener, keeps it for the whole test, and closes it in finally, so the
port cannot be taken by another process in between.

stack-release.test T-I4: the free port goes only to webui-service.sh install
rows that refuse before any listen, so it is now a closed lease
(leaseClosedPort), which refuses connects and blocks other binds.

The 22 other freePort callers hand the number to `stack-release.sh rehearse`,
which probes it and starts a Console later. That needs a script change and
is left as a design, with a comment above freePort naming the window.
2026-11-02 20:22:14 -06:00
jason.woltje 0e7e203db8 test(row 333): harden the business-imports helper and test it on small trees (Vikunja #779)
The helper read imports with a regex that treated a commented import as live, missed
`import (` written with a space, skipped a missing target inside packages/business/src
before checking it existed, and resolved targets lexically. It now blanks comments
(and ignores import forms inside strings and regular expressions) before matching,
counts a spaced or line-broken dynamic import, throws on a dynamic import whose
argument is not a plain string and on a file with an unterminated string, comment,
template or regular expression, checks every target exists and is a regular file
before the inside-own-directory skip, and refuses a target whose real path is outside
the real repository root. The output for the real tree is unchanged.

business-imports.test.mjs builds small trees under a private temp directory.
2026-11-02 20:14:25 -06:00
jason.woltje 1ff45c4ad6 Merge row 333: proxy usage and human model-key quotas, R4 (Gitea #1831) 2026-11-02 19:40:46 -06:00
jason.woltje 1009bbfaf9 Hold closed fixture ports for the test's life (Vikunja #781)
leasePort({closed:true}) ignored its option: it probed an ephemeral port and
closed it, so a parallel test file could bind it and answer a request the
test expected to fail (preview.test.mjs:209 saw 200 instead of 502).

leaseClosedPort holds a bound, non-listening socket in a perl child until the
test's after hook. Connects still get ECONNREFUSED, bind() from another
process gets EADDRINUSE, and the kernel's ephemeral allocation skips the port.
Lane mode keeps its band and per-port lock, and releases the socket before
the lock. leasePort now refuses a closed option, so a stale call cannot get
the unheld port again.

Unanswerable callers (webui preview, serve, service) move to leaseClosedPort(t).
Callers that listen on the port themselves (stack-release rehearse, control-board
serve, tester-cli) keep leasePort and drop the ignored option.
2026-11-02 18:25:27 -06:00
jason.woltje 3692fca522 fix(row333 R3): per-key quota follows the agent's key lineage across rotation and re-issue (#1831)
Ruling 1: model records keep a bounded previous list (64 ids, oldest dropped)
of ids that left by rotation, grace expiry or re-issue; a fire removes the
record. A tokens.keys leaf matches and counts every id in the lineage that
holds it. Lineage ids are unique host-wide. An orphaned leaf limits nothing,
logs one value-free line when it becomes orphaned, and the Console usage
view lists it.
Ruling 2: an agent with no model key under a key quota refuses
key-quota-no-model-key, passed through the broker, launcher and stop reason.
Ruling 3: covered by the lineage; no mayLaunch change.
Ruling 4: the usage module receives a frozen { readUsageQueue } only.
Ruling 5: every telemetry fixture wait races a 5 s real-timer deadline.
2026-11-02 17:54:07 -06:00
jason.woltje c0c291cda2 merge: join row 333 P5 quotas onto landed row 332 (#1831)
Joins row 333 R2 head 0ef269da9 (base 09a847eda: R1 503b91e56, overlay
2627321f6, docs c012b2e0a and ddb3e961f, R2 fixtures 12eba4b59 and
0ef269da9) onto refactor with row 332 landed at 5df0e9d6f. Run with the
union attributes for BUILD-LOG.md and docs/SESSIONS.md. Two files
conflicted; no other path did.

packages/business/src/launch.mjs, import block: 332 changed the errors
import to `{ BusinessError, refuse }` for the proxy route refusals; 333
added `isDailyModelQuota` from plugins/src/model-quota.mjs for the daily
model leaves under limits.tokens.keys. Kept both: the model-quota import
and the `{ BusinessError, refuse }` import. The rest of launch.mjs merged
without conflict (332's checkModels route handling and checkAccount
credential "proxy"; 333's checkTokenLimits keys block).

packages/plugins/README.md, end of file: 332 appended "Per-session proxy
context (P3)" and 333 appended "Proxy usage telemetry (row333 / P5)" at
the same spot. Kept both sections, P3 first, one blank line between.

The resolved files match the earlier 332 R1 join resolution
(join-resolution.patch) line for line apart from hunk offsets.
2026-11-02 16:33:47 -06:00
jason.woltje 12eba4b599 test(row333 R2): release fixtures carry the plug-in files business imports (#1831)
Row 333 made packages/business/src/launch.mjs and organization.mjs import
packages/plugins/src/model-quota.mjs. The stack-release fixtures copy
packages/business/src and added only plugins/src/kinds.mjs, so their copies
failed with 'Cannot find module .../model-quota.mjs'. Whole cli runs on the
row 333 tip gave stack-release 56 pass 168 fail, stack-release-external
4/21 and stack-upgrade 7/14.

business-imports.mjs reads the imports of packages/business/src and returns
the files outside it that they reach, so both fixture builders copy what
business needs instead of a hard-coded name. No product code, schema or
assertion changes.
2026-11-02 16:27:43 -06:00
jason.woltje 5df0e9d6fa Merge row 332 (P3, #1830) R2 with the lead fix: pi harness config from the proxy, hermetic pi launches in tests 2026-11-02 15:48:51 -06:00
jason.woltje da1f0ceda6 Row 332 R2 (#1830): give the federation acceptance hosts a fake pi key
GPT review F1: prepare() built the host env from HOME, PATH, TMPDIR,
MOSAIC_CONFIG and NODE_EXTRA_CA_CERTS only, so the pi credential preflight
refused the assistant launch (no-session-credential) and the RESULT wait
failed. scripts/test-federation-acceptance.sh red on 6e9f3d723, green with
the fake ZAI_API_KEY the cli tests use.
2026-11-02 15:46:57 -06:00
jason.woltje 39eadf8ba8 Row 332 R2 (#1830): hermetic pi launches in cli tests, pi bundle default, review F2 and F3
The cli tests that launch pi deleted only the session login names, so pi's
preflight passed or refused by whatever provider keys the host exported. A
shared helper now deletes every credential pi's preflight reads and gives pi
launches one made-up key. The refusal itself is unchanged.

pi bundle() takes a default argument again, so a call with none returns the
non-proxy bundle, as before P3. pi.bundle leaves out a launch.models entry
whose provider has no proxy route instead of failing every pi launch (F2);
malformed proxy entries still refuse. The invalid session proxy context
BundleError gets the code invalid-proxy-context. New tests cover F2, the code,
and the three proxy account branches in the launcher (F3).
2026-11-02 15:22:17 -06:00
jason.woltje c78f225433 test(cli): row 334 byte-identity baseline after #385, proxy refusal text (#1832) 2026-11-02 13:10:29 -06:00
jason.woltje 2b3e3ec83b Merge row 334 (#1832): Case 2 proxy unit in case2-unit.sh and case2-install.sh 2026-11-02 12:50:15 -06:00
jason.woltje 418f00bce2 Merge PR #1836: Require verified OIDC for Console human writes (#385) 2026-11-02 12:31:19 -06:00
jason.woltje 484aef7e2a fix(upgrade): refuse a pre-#385 library Console unit before units stop (#385) 2026-11-02 12:19:07 -06:00
jason.woltje d0ddfa8de2 fix(upgrade): refuse legacy library --send before units stop (#385) 2026-11-02 12:03:59 -06:00
jason.woltje ab2bc23c7f fix(console): keep preview deployment profiles read-only (#385) 2026-10-29 00:54:30 -05:00
jason.woltje 7fff6a20e6 fix(testing): bind image receipts to pinned build base (#470) 2026-10-29 00:33:01 -05:00
jason.woltje d6dc04e84f Join P3 harness context to landed P2 admission with private same-key delivery 2026-10-26 18:02:58 -05:00
jason.woltje c4bba5d2a3 row334: render P1 proxy system unit in Case 2 installs 2026-10-26 17:39:34 -05:00
jason.woltje 362893d043 feat: integrate reviewed proxy page and managed model keys
Source-candidate: poe d9a564e6d20f5f0fd75ce45b12cbbf8bb4c9d568\nSource-candidate: magica38ba5762b06716db1dee00d0afec162656488f5c\nValidated321whole-file phase plus whole bus1349/model-proxy100/webui490; final gate tooling checks pending, not landed.
2026-10-26 12:04:21 -05:00
jason.woltje 2d3458695a test: reap owned copy children on external gate termination 2026-10-26 10:44:35 -05:00
jason.woltje 6efc4a6921 fix: make timing regressions depend on explicit probe and child outcomes 2026-10-26 10:40:04 -05:00
jason.woltje 94cde633e2 WIP row329: preserve P1 draft before required base rebase (#1827) 2026-10-24 18:30:11 -05:00
jason.woltje 1edf4acfd1 row224: await citation hydration in new launch test 2026-10-24 14:19:17 -05:00
jason.woltje 380b9810dc row224: supply chief Gitea reference in new launch fixture 2026-10-24 14:19:17 -05:00
jason.woltje a41cfd491e row224: draft broker library lookups and typed tools (unrun) 2026-10-24 14:19:17 -05:00
Steelbeak dc8f552819 Row 287: grant library collaborators with declared scopes 2026-10-24 10:55:31 -05:00
jason.woltje 1f3d0350f3 row 285: preserve credential bindings for approved creative changes and verify r4 (#1790, mos-1585, mos-1586) 2026-10-24 08:12:02 -05:00