Skip to content

Commit 768f029

Browse files
committed
test: verify model-free first run and recovery
1 parent 1772b8d commit 768f029

9 files changed

Lines changed: 133 additions & 7 deletions

File tree

‎docs/COMMONS.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ untrusted context, never authority to alter model roles or execution capabilitie
114114
The optional field is additive to the existing JSON document; no SQL schema or
115115
applied migration is changed. API tests use an explicitly mocked model.
116116

117+
**Create task from issue** links the retained issue and suggests an editable task
118+
instruction naming its number and title. The issue description enters the model
119+
context through the existing validated link; the suggested text does not replace
120+
that retained context. Selecting the suggestion never starts inference.
121+
117122
## Projects, issues and owned agents
118123

119124
[The release contract](RELEASE.md) describes project creation/fork/archive, normalized

‎docs/CONTEXT.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Recheck these observations before acting:
8484
- Existing Commons run 49092854-f9bd-4b7a-8d12-4ac5ea0e5f70 retains the approved,
8585
unmerged safe-timer change from job 811bdb98-bcbb-4b65-80b9-f19693aef6b4.
8686
Preserve it. 29 earlier lab experiments were verified before this release work.
87-
- Public source: antropos17/commit-zero at 3371395 (04:35 UTC); use clean .cache/publication and preserve histories.
87+
- Public source: antropos17/commit-zero at 1772b8d (04:42 UTC), CI green; use clean .cache/publication and preserve histories.
8888
README GIF is a 15.8s condensed walkthrough of retained Sequence Kit work,
8989
not a continuous live recording. Static fallback included; desktop/mobile and all
9090
three CI jobs passed. Evidence: runtime/verification/github-readme-gif-2026-10-19.json.

‎docs/DEVELOPMENT.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ limits. Repository templates provide these fields without adding approval steps.
9191
For backend/database changes, [backend performance](BACKEND-PERFORMANCE.md) owns
9292
the storage contract, migration safety and `npm run benchmark:backend` procedure.
9393
The benchmark uses a disposable database and one bounded output report.
94+
[Current workflow and history-size measurements](WORKFLOW-MEASUREMENTS.md)
95+
record observed command costs and the limits of those comparisons.
9496

9597
- [Anthropic: effective harnesses for long-running agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents)
9698
motivates incremental tasks, persistent handoffs and browser verification. Here,

‎docs/MISSION-2026-10-19.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Start: 03:46:17 UTC. Deadline: 15:46:17 UTC. Final integration reserve begins 14
1212

1313
## Current action
1414

15-
Verify and commit the public onboarding and distribution notes. Then copy only reviewed source/doc changes into the clean publication checkout, recheck `origin/main`, push without rewriting history, and inspect CI.
15+
Finish the browser-tested model-free first-run unit and workflow measurements; run frozen full gate, commit and publish the next coherent increment. Then strengthen the next-agent handoff and assess remaining scoped product gaps.
1616

1717
## Decisions and limits
1818

@@ -35,7 +35,10 @@ Verify and commit the public onboarding and distribution notes. Then copy only r
3535
- 04:31 UTC: Commons' one-shot provider health check was an observed recovery gap: an operator starting the local provider later could not refresh the form without reloading. Added explicit health refresh, clear unavailable/busy/request-error states, and disabled task execution until health is ready. `npm run check:ui` passed; installed Chrome `npm run test:ui` passed 4/4, including offline, failed request, available, busy and stopped fixtures plus narrow layout. Browser fixture changes only the health response; no model task was started. Complete full gate and commit next.
3636
- 04:34 UTC: provider recovery committed as `3d18575` after full gate 64/64 (stable source hash `4477ad67`); browser 4/4. Receipt `runtime/verification/commons-provider-full-2026-10-19.json`. GitHub remote read returned `3371395`, matching the initial public checkout; its Verify workflow succeeded. GitHub API confirms existing description, eight topics and push access.
3737
- First-run guide, accurate catalog capture and distribution research/drafts added. [Product Hunt's guide](https://www.producthunt.com/launch/preparing-for-launch) permits a GitHub URL but requires prepared images and a maker comment. [Show HN](https://news.ycombinator.com/showhn.html) accepts runnable local software, while [HN rules](https://news.ycombinator.com/newsguidelines.html) forbid generated text. DEV's [AI article rules](https://dev.to/guidelines-for-ai-assisted-articles-on-dev) disallow AI-assisted promotion. No promotional submission made.
38+
- 04:42 UTC: onboarding committed locally as `50bca07` after full gate 64/64, stable hash `ef19fde8`. All 33 changed files matched by SHA-256 in the separate publication checkout and both Git trees were `3316dbd`. Public `main` advanced without force from `3371395` to `1772b8d`; [all three CI jobs](https://github.com/antropos17/commit-zero/actions/runs/39200782129) passed (full gate, Chromium, runtime dependency audit).
39+
- 04:46 UTC: real Chrome first-run test creates a model-free project, issue and discussion, checks task linkage and reload persistence, and checks 390px layout. The issue action now suggests its actual number/title in the editable task instead of leaving the generic instruction; issue status text is separated at narrow width. `npm run check:ui` passed, and `npm run test:ui` passed 5/5. Captures are under `runtime/verification/commons-first-run-{desktop,narrow}-2026-10-19.png`.
40+
- Backend benchmark: disposable PGlite fixture with 5 projects and 1000 messages, 20 write samples per path. Current normalized p50 9.09 ms versus retained legacy pattern 42.99 ms, SQL parameters 7,212 versus 48,825,423 bytes. This confirms the earlier implementation on the fixture, not a new speedup or external load result. Before/after diagnostics show 84 GB free and no material growth. Details: [workflow measurements](WORKFLOW-MEASUREMENTS.md).
3841

3942
## Next checkpoint
4043

41-
Run the full frozen gate and commit onboarding. Publish through the separate public checkout only after comparing the remote ref and file changes. Do not start a substantial feature after 14:16:17 UTC. Run `npm run check` on frozen final source.
44+
Run the full frozen gate and commit the first-run unit. Recheck and publish through the separate public checkout; inspect CI. Keep the final 90-minute reserve from 14:16:17 UTC. Run `npm run check` on frozen final source.

‎docs/WORKFLOW-MEASUREMENTS.md‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Verification and history-size measurements
2+
3+
Recorded 2026-10-19 on Windows, Node 24.11.1, the repository's installed npm
4+
dependencies and local Chrome. Commands ran from `X:\ai-github`; no model call
5+
or normal user database write was part of these measurements.
6+
7+
## Feedback loop
8+
9+
| Command | Observed samples | What it covers |
10+
| --- | --- | --- |
11+
| `npm run check:fast` | One current run: lint 689 ms, repository 95 ms, pure tests 1,334 ms (9/9) | Useful for quick pure-code feedback; excludes databases, build, DOM and serving. Not acceptance. |
12+
| `npm run check:ui` | Current run: lint 863 ms, repository 115 ms, build 501 ms, DOM 32,220 ms (2/2), serving 2,182 ms | The DOM/axe integration dominates this focused suite. It has no real layout engine. |
13+
| `npm run check` | Four milestone receipts: 107.4, 132.6, 122.3 and 137.2 s; the first had 60 Node tests, later runs 64 | Serial PGlite/integration tests and DOM dominate. These runs have different source and test counts, so they do not measure a speedup or regression. |
14+
| `npm run test:ui` with `CZ_BROWSER_EXECUTABLE` | Post-setup runs observed at 14.3, 15.1 and 15.4 s for the then-current 4- or 5-test suite | Real Chrome desktop and narrow layout. Playwright global setup now awaits child-service shutdown; before that change, a successful assertion left the Windows process attached and the command did not exit in the observation window. There is no comparable old completion time, so only reliable termination is established. |
15+
16+
The full gate remains serial to bound embedded database memory. Replacing it
17+
with focused results or parallelizing shared-port suites solely for a shorter
18+
number would lose coverage or isolation. `npm run map -- <area>` and one focused
19+
suite are the intended edit loop; the full gate is run on frozen source.
20+
21+
## Larger retained history
22+
23+
`npm run benchmark:backend` seeded five projects, 1,000 messages and a 1,192,327
24+
byte Commons snapshot in an isolated in-memory PGlite store. Twenty samples
25+
per write path compared the retained legacy monolithic SQL pattern with the
26+
current normalized pattern. The raw receipt is local at
27+
`runtime/verification/backend-benchmark-2026-10-19-mission.json` and
28+
intentionally ignored by Git; its values are reproduced here so the public
29+
document is self-contained.
30+
31+
| Measure | Legacy pattern | Current normalized path |
32+
| --- | ---: | ---: |
33+
| Message write p50 | 42.99 ms | 9.09 ms |
34+
| Message write p95 | 53.31 ms | 13.97 ms |
35+
| SQL parameter bytes, 20 writes | 48,825,423 | 7,212 |
36+
37+
An unchanged read had p50 0.76 ms in 20 samples and a zero-byte response body.
38+
The event page query returned 20 rows through `commons_events_pkey`; this was
39+
a synthetic local EXPLAIN, not an external PostgreSQL load test. These values
40+
verify the prior normalized-storage decision under this fixture. The older
41+
[backend note](BACKEND-PERFORMANCE.md) reports its own run (38.74/7.29 ms p50);
42+
machine load and fixture revision differ, so comparing those timings as a new
43+
optimization would be unsound. Parameter bytes are SQL inputs, not physical
44+
disk or WAL bytes.
45+
46+
The seeded [Commons simulation](SIMULATIONS.md) separately exercised 40 history
47+
messages, 80 events and 27 cursor pages over actual HTTP handlers. Its size is
48+
limited by the normal 180-request/minute API rate limit; the 80-message trial
49+
correctly returned HTTP 429. These fixtures do not establish UI frame time or
50+
production throughput.
51+
52+
`npm run diagnostics` before/after the benchmark showed 84 GB free and no
53+
material growth: `.cache` changed from 917,287,031 to 917,287,061 bytes.
54+
Runtime databases, backups, the local model and verification receipts were
55+
preserved. The next performance target, if measurements warrant it, is the
56+
client's full-snapshot refresh on a changed Commons revision. Event cursor
57+
reads already exist; switching the UI requires a separate correctness design
58+
for cache invalidation, revision changes and reading position.

‎prototype/app/pages/commons-projects.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export function Issues({ project, events, jobs, pending, act, onTask }) {
203203
{issues.map((issue) => (
204204
<article className="commons-pull" key={issue.id}>
205205
<h2>
206-
#{issue.number} {issue.title}
206+
#{issue.number} {issue.title}{" "}
207207
<span className="commons-meta">{issue.status}</span>
208208
</h2>
209209
<p>{issue.description}</p>

‎prototype/app/pages/commons.jsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ function CommonsRoom({
414414
setIssueId(issue.id);
415415
setSourcePrId("");
416416
setTarget(current.id);
417+
setTask(`Investigate and resolve issue #${issue.number}: ${issue.title}`);
417418
taskInput.current?.focus();
418419
}}
419420
/>

‎scripts/project-map.mjs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export const areas = {
2525
"prototype/app/components/project-contributions.jsx",
2626
"prototype/app/components/project-timeline.jsx",
2727
],
28-
tests: ["tests/interface.dom.mjs", "tests/agent-catalog.test.mjs"],
29-
docs: ["DESIGN.md", "docs/AGENT-CATALOG.md"],
28+
tests: ["tests/interface.dom.mjs", "tests/agent-catalog.test.mjs", "tests/browser/commons-first-run.spec.mjs"],
29+
docs: ["DESIGN.md", "docs/AGENT-CATALOG.md", "docs/FIRST-RUN.md"],
3030
},
3131
commons: {
3232
purpose:
@@ -63,6 +63,8 @@ export const areas = {
6363
"tests/project-timeline.test.mjs",
6464
"tests/agent-catalog.test.mjs",
6565
"tests/simulate-commons.test.mjs",
66+
"tests/browser/commons-first-run.spec.mjs",
67+
"tests/browser/commons-provider.spec.mjs",
6668
],
6769
docs: ["docs/COMMONS.md", "docs/BACKEND-PERFORMANCE.md", "docs/RELEASE.md", "docs/AGENT-CATALOG.md", "docs/SIMULATIONS.md"],
6870
},
@@ -153,7 +155,7 @@ export const areas = {
153155
"scripts/sandbox-contract.mjs",
154156
],
155157
tests: ["tests/tooling.test.mjs", "tests/store-snapshot.test.mjs", "tests/sandbox-contract.test.mjs"],
156-
docs: ["docs/DEVELOPMENT.md", "docs/SANDBOX-ADAPTER.md"],
158+
docs: ["docs/DEVELOPMENT.md", "docs/SANDBOX-ADAPTER.md", "docs/WORKFLOW-MEASUREMENTS.md"],
157159
},
158160
};
159161

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { mkdir } from "node:fs/promises";
2+
import { test, expect } from "@playwright/test";
3+
4+
test("model-free first run creates and retains project, issue, and discussion", async ({ page }) => {
5+
const errors = [];
6+
page.on("pageerror", (error) => errors.push(error.message));
7+
await page.setViewportSize({ width: 1440, height: 900 });
8+
await page.goto("/#/commons");
9+
await page.getByRole("group", { name: "Project sections" })
10+
.getByRole("button", { name: "Projects", exact: true }).click();
11+
const form = page.getByRole("region", { name: "New project" });
12+
await form.getByLabel("Project address").fill("browser-first-run");
13+
await form.getByLabel("Project name").fill("Browser First Run");
14+
await form.getByLabel("Description").fill("A disposable project created without model inference.");
15+
await form.getByRole("button", { name: "Create project" }).click();
16+
await expect(page).toHaveURL(/#\/commons\/browser-first-run$/);
17+
await expect(page.getByRole("heading", { name: "Browser First Run", exact: true })).toBeVisible();
18+
await page.getByRole("group", { name: "Project sections" })
19+
.getByRole("button", { name: /Issues/ }).click();
20+
await page.getByLabel("Issue title").fill("Handle empty input");
21+
await page.getByLabel("Problem and expected behavior")
22+
.fill("An empty argument should return a bounded error rather than throwing.");
23+
await page.getByRole("button", { name: "Open issue" }).click();
24+
await expect(page.getByRole("heading", { name: /#1 Handle empty input/ })).toBeVisible();
25+
await page.getByRole("button", { name: "Create task from issue" }).click();
26+
await expect(page.getByRole("region", { name: "New task" })).toContainText("Issue #1: Handle empty input");
27+
await expect(page.getByLabel("Task", { exact: true }))
28+
.toHaveValue("Investigate and resolve issue #1: Handle empty input");
29+
await expect(page.getByRole("button", { name: "Run agents", exact: true })).toBeDisabled();
30+
await page.getByRole("group", { name: "Project sections" })
31+
.getByRole("button", { name: "Chat", exact: true }).click();
32+
await page.getByLabel("Message", { exact: true }).fill("A model-free project discussion.");
33+
await page.getByRole("button", { name: "Send", exact: true }).click();
34+
await expect(page.getByRole("region", { name: "Saved messages" }))
35+
.toContainText("A model-free project discussion.");
36+
if (process.env.CZ_CAPTURE_BROWSER === "1") {
37+
await mkdir("runtime/verification", { recursive: true });
38+
await page.screenshot({ path: "runtime/verification/commons-first-run-desktop-2026-10-19.png" });
39+
}
40+
await page.reload();
41+
await expect(page.getByRole("heading", { name: "Browser First Run", exact: true })).toBeVisible();
42+
await page.getByRole("group", { name: "Project sections" })
43+
.getByRole("button", { name: "Chat", exact: true }).click();
44+
await expect(page.getByRole("region", { name: "Saved messages" }))
45+
.toContainText("A model-free project discussion.");
46+
await page.getByRole("group", { name: "Project sections" })
47+
.getByRole("button", { name: /Issues/ }).click();
48+
await expect(page.getByRole("heading", { name: /#1 Handle empty input/ })).toBeVisible();
49+
await page.setViewportSize({ width: 390, height: 844 });
50+
expect(await page.evaluate(() => document.documentElement.scrollWidth <= document.documentElement.clientWidth)).toBe(true);
51+
if (process.env.CZ_CAPTURE_BROWSER === "1") {
52+
await page.screenshot({ path: "runtime/verification/commons-first-run-narrow-2026-10-19.png", fullPage: true });
53+
}
54+
expect(errors).toEqual([]);
55+
});

0 commit comments

Comments
 (0)