Skip to content

docs(domain): reconcile the SDK documentation - #225

Merged
allisonmahmood merged 1 commit into
mainfrom
sdk/209-docs-map
Sep 12, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
sdk/209-docs-map

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

The SDK stack landed its docs ticket by ticket, leaving stale tier-0-only claims and conflicting terminology. This pass reconciles the product, glossaries, ADRs, guides and skills against the completed stack, including the seven migration records and post-merge concurrency gate. It also fixes nullable-array notation in the generated API reference.

Stacked on sdk/208-ci-e2e (#224). This PR contains only the #209 reconciliation commit above that branch.

The prototype PRs remain closed with build-ticket pointers, their remote branches are deleted, and the SDK map has its final build record. Existing schema-revision and dev-inventory differences from the spec are documented without changing runtime behavior.

Closes #209.

Verification

  • pnpm lint and pnpm typecheck passed (18 packages).
  • pnpm test: 701 tests passed across 74 files.
  • Generated API-doc test and before/after renderer smoke passed.
  • Standards and spec reviews: no actionable findings remain.

Model: GPT-6 Astra. Harness: Oh My Pi.

@github-actions github-actions Bot added area:server Touches the server area area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area size:l 501-1,000 changed lines labels Sep 11, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Astra review

Reviewed 75be7cd against origin/sdk/208-ci-e2e (f873310), using git diff origin/sdk/208-ci-e2e...HEAD and issue #209. One pass, no subagents; merge-blocking findings only.

Standards

No merge-blocking method or YAGNI findings. The small renderer change corrects generated documentation at its source; it does not introduce a new runtime capability or future-facing abstraction.

Spec

[P2] Intent — Do not advertise downloads on public tier 1 patches

docs/product.md:183 newly says a public tier 1 patch “may still use the shell's routes and downloads.” Routes work, but downloads do not: the broker translates download into files.get, and public runtime admission rejects every operation except me with not_available_on_public, including for signed-in members. The shell never reaches the download step.

This sends builders down an unsupported workflow and violates #209's explicit acceptance criterion: “A reader of docs/product.md, the glossaries and the ADRs finds no sentence the code contradicts.” Remove downloads from the public-capabilities promise and clarify that store downloads require an admitted company runtime. Do not add public-download machinery in this docs reconciliation.

Verification

  • Generated API reference test: passed.
  • Renderer smoke: nullable-row arrays and nested SQL-parameter unions preserve array precedence.
  • Focused runtime file-read admission test: passed; public reads return 403/not_available_on_public (10 unrelated tests skipped).
  • Global skill hash matches; SDK map is closed with its final comment; both prototype PRs are closed with build-ticket pointers and both remote prototype branches are absent.
  • Full lint/typecheck/test suites were not rerun in this review; some PR checks were still pending when inspected.

Summary: Standards: 0 blockers. Spec: 1 blocker; worst: P2, unsupported public-download promise.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Sol review

Reviewed 75be7cdf3ff37e3ac69649394e6b41d32a594bfe against origin/sdk/208-ci-e2e (f8733101a82ff989fb25ad0bf0cc93e2193f3980) and issue #209 / parent spec #193 §§14–15.

Standards

No findings. No hard documented violations or unsuppressed smell-baseline concerns appear in the diff. The nullable-array renderer change fixes precedence at the source with clear local names and no speculative abstraction. The repeated product, CLI, recovery, and serving prose is required contract mirroring under AGENTS.md’s “Hit every surface” rule; each document serves a distinct audience rather than introducing a second implementation convention.

Spec

[P2] Do not advertise downloads on public tier 1 patches

docs/product.md:183 newly says a public tier 1 patch “may still use the shell's routes and downloads.” Routes work, but the only shell download operation is an own-file download: the broker maps download to files.get, while Runtime rejects every public operation except me with not_available_on_public. ADR-0010 explicitly preserves only the route bridge publicly.

This violates #209’s acceptance criterion: “A reader of docs/product.md, the glossaries and the ADRs finds no sentence the code contradicts.” Replace “It may still use the shell's routes and downloads.” with “It may still use the shell's route bridge.” Do not add public-file access in this documentation reconciliation.

Verification

Summary: Standards: 0 findings. Spec: 1 finding; worst is P2, the unsupported public-download promise.

@allisonmahmood

allisonmahmood commented Sep 11, 2026 •

Copy link
Copy Markdown
Owner Author

Current review pair: Astra + Opus. Opus replaces Sol as the cross-family pass; the earlier public-route wording fix remains in 3ef9a84.

Fixed

Kept as is — and why

  • Public runtime/broker behavior and ADR-0010: public company-data calls already fail with not_available_on_public, while the browser-owned route bridge remains available. The product says exactly “It may still use the shell's route bridge.” No public-download capability was added.
  • Seven migration records: the docs match source, including 0004 invites-expiry and 0005 company-database → 0006 runtime → 0007 integrations. Changing them to match the stale spec would be wrong.
  • Runtime behavior, wire shapes and repository rulesets: these review fixes are documentation/renderer changes. No ruleset was changed; the stacked base currently reports no configured required checks, so all eight emitted checks were verified rather than treating that as a green gate.

Verification

  • Merge: pnpm typecheck (34 tasks) and pnpm lint passed; formatting and 45 relative documentation links passed.
  • Final fix: seven in-memory renderer boundary cases passed, including scalar, nullable/literal unions, nested arrays and an object containing a union. Focused API-reference and serving-header tests passed (2 passed, 14 unrelated skipped); formatting and renderer lint passed.
  • Local full-suite limitation: pnpm test hit three timeouts. Server startup and Postgres runtime passed in the isolated rerun; repo initialization still exceeded its unchanged 30-second limit. No deadlines, assertions or implementation were changed to hide it.

Latest-commit CI — c50e307: Run 34608408984 completed successfully on c50e307. All eight checks pass: cli-smoke, clerk-live, dependency-review, label, lint (including formatting/typecheck), postgres-concurrency, test (22) and test (24). Both complete CI test suites passed despite the documented local initialization timeout. GitHub reports the PR CLEAN against sdk/208-ci-e2e.

No unresolved review or CI blockers remain. PR #225 is ready to merge; it has not been merged.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Opus review

Reviewed d0933c4a1232d0dac5cc3272db113d7452906c87 against origin/sdk/208-ci-e2e, using git diff origin/sdk/208-ci-e2e...HEAD, issue #209 and parent spec #193 §§14–15. I read Astra's and Sol's reviews and the implementer's reply first; the public-download promise they both blocked on is fixed in 3ef9a84 and I re-verified the replacement wording against the code. This pass verified the load-bearing claims against the implementation rather than against the other docs.

Standards

0 blocking findings.

The one code change, packages/api/src/markdown.ts:104-110, parenthesises array element types that are unions. It is correct at its source, has clear local names and no speculative shape; docs/API.md:470 and :484 now read (string | number | boolean | null | (string | number | boolean | null)[])[] and ({ [key: string]: unknown } | null)[] instead of the previously ambiguous precedence.

Spec

0 blocking findings.

#209's acceptance is "a reader of docs/product.md, the glossaries and the ADRs finds no sentence the code contradicts", plus §15's glossary coverage. I sampled the promises that would send an agent down a wrong path and checked each against source or tests. Everything held:

  • Public tier 1. docs/product.md:183 now reads "It may still use the shell's route bridge." packages/serving/src/broker.ts:445-449 handles route.set locally before any runtime call, so the bridge genuinely survives; packages/runtime/src/Runtime.ts:377-379 still refuses every non-me op with PublicUnavailable. packages/serving/CONTEXT.md:36 ("Public patches retain this browser-only capability") and docs/product.md:222 agree.
  • Migration ids and count. AGENTS.md:74 and the new docs/adr/ADR-0003-postgres-only.md:27-37 table say seven records across six owners, 0001 companies → 0007 integrations. That matches packages/{companies,auth,patches,company-database,runtime,integrations}/src/migrations.ts exactly, including 0004_invites_expiry under Companies, and the spread order in apps/server/src/Server.ts:86-93 and scripts/dev/src/supervisor.ts:159-164. Note this deviates from SDK: primitives, integrations, init and the dev loop on tier 1 #193 §15's "six records … company-database, integrations, runtime" — the doc is right and the spec text was stale on both the count and the tail order. Worth recording on the map rather than "fixing" back.
  • CLI --json documents. Every shape in docs/adr/ADR-0004-cli-contract-for-agents.md:161-165 and :206-208 matches what the CLI emits: init (packages/patchy/src/Project.ts:640-650), refresh and add/remove (Project.ts:425-460), dev/dev status (devLifecycle.ts:91-104), dev stop/reset (devLifecycle.ts:343-350), dev logs (devLifecycle.ts:331). The command tree in packages/patchy/src/commands.ts:732-869 matches the documented flags, including init's tier-1 default and --tier 0.
  • Runtime codes. Every code named across docs/product.md, ADR-0004 and skills/patchy/SKILL.md resolves to a real string in source: not_available_on_public, busy, not_additive, has_primitives, stale_generated, release_mismatch, name_taken, patch_not_openable, connection_not_connected, offset_exhausted, shape_mismatch, invalid_query, row_not_found, too_large, not_running, publish_key_conflict, principal_changed, session_expired, source_unavailable, slow_down, access_denied. No invented code.
  • What publish provisions and refuses. docs/product.md:412-435 matches packages/primitives/src/Tables.ts: required-column-without-default (:355-359), optionality change (:382), default add/change/remove (:386-393), unique index on an existing table (:406-410), index redefinition (:417-423), omitted required column (:441-442), the 2,000-byte index preflight (:47) and the row-expansion refusal (:213-217). has_primitives for file mode onto cumulative inventory is real (packages/patches/src/PatchesApi.ts).
  • The operation surface. "me, seven owned-table operations, three shared-table reads, four file operations and four Postgres operations" (docs/product.md:219-221) is exactly the set in packages/api/src/runtime.ts:133-240 and packages/api/src/postgres.ts:69-88.
  • Numbers. 300/min (Runtime.ts:245), 32 outstanding and 64 MiB held (broker.ts:17-19), 1 MiB row / 8 MiB result / 20 MiB file (packages/api/src/runtime.ts:10-14), 10 MiB bundle (repoBuild.ts:30), 10,000 offsets and MAX_EXCLUSIONS (postgres/Operations.ts:142, postgres/Snapshot.ts:5), 500 relations / 200 columns / 1,000 enums / 8 MiB snapshot (postgres/Snapshot.ts:3-8), 4 backends / 64 per process / 60 s idle / 10 s statement (postgres/Execution.ts:108-114), 8 KiB of SQL text (ConnectionPage.ts:100), 90-day retention with the 30-day visit extension (packages/patches/src/Patches.ts:52-55), 90-day/30-idle-day tokens (MachineTokens.ts:122,182), the one-day object grace (OrphanSweep.ts:212).
  • The dev loop. docs/product.md:80-89 matches devLifecycle.ts: detached and idempotent, not_running on an unhealthy status, and reset wiping everything under the state dir except baseline.json and lock (devLifecycle.ts:335-341). docs/DEVELOPMENT.md:140-200 still carries the two company-database URLs, the keyring and the patchy dev recipe §15 asked for.
  • ADR-0002. "the auth, patches, sdk and runtime groups" is the complete set (packages/api/src/api.ts:474), and the schema files named are the only three that define wire shapes.
  • §15 glossary coverage. Every term §15 lists exists once in its owning CONTEXT.md, each with an _Avoid_ line. Upload contract is gone (replaced by Publish contract), Call log and Patches' Inventory are pointers, Patch cache survives for file mode, Connect door and Patch identity are marked future. The two cross-glossary repeats (Publish key in packages/patchy/CONTEXT.md:67, Inventory in packages/patches/CONTEXT.md:63) are pointers, not second definitions.
  • No product comparisons. Nothing in skills/, packages/sdk/skills/ or the product doc likens Patchy to another product. packages/integrations/CONTEXT.md:9 names Zapier/Retool/Windmill only inside an _Avoid_ vocabulary line, which is the intended use.
  • Global skill SHA-256 is 0d3487bf…5e39 and matches skills-lock.json. All eight checks pass on d0933c4.

Non-blocking notes

Neither is worth another round; record them or ignore them.

  1. packages/serving/CONTEXT.md:16 — the Serving guarantee rewrite dropped "pages are kept out of search results", and no document under docs/ now states it. The behaviour is real (packages/serving/src/shell-headers.ts:2, asserted in Pages.test.ts:196) and the same entry's _Avoid_ line still warns against "unlisted as a synonym for private", which now dangles. One clause restores it.
  2. packages/api/src/markdown.ts:107 — the guard is items.anyOf rather than "more than one arm after filtering". Since renderType drops Effect's non-finite-number arm and dedupes, a future Schema.Array(Schema.Number) would render (number)[]. Nothing in today's API hits it.

Summary: Standards: 0 blocking findings. Spec: 0 blocking findings; the earlier public-download blocker is resolved and verified against the broker and runtime. The only thing I would carry forward is the migrator count divergence from #193 §15 — the docs are right, the spec text is stale.

Base automatically changed from sdk/208-ci-e2e to main September 12, 2026 13:07
@allisonmahmood
allisonmahmood merged commit dfc2e94 into main Sep 12, 2026
8 checks passed
@allisonmahmood
allisonmahmood deleted the sdk/209-docs-map branch September 12, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area area:server Touches the server area size:l 501-1,000 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(domain): the map after the SDK

1 participant