diff --git a/.gitignore b/.gitignore index 09d6210..f7608da 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules/ packages/*/dist/ coverage/ reference/ +.scratch/ diff --git a/.scratch/browser-gateway-renderer/implementation-report.md b/.scratch/browser-gateway-renderer/implementation-report.md deleted file mode 100644 index ff0a819..0000000 --- a/.scratch/browser-gateway-renderer/implementation-report.md +++ /dev/null @@ -1,90 +0,0 @@ -# Browser gateway renderer implementation report - -## Result - -The whole `browser-gateway-renderer` spec and its only ticket are implemented -on the `browser-gateway-renderer` branch. The containerized HTTP Service now -delegates explicit browser rendering to the server-local Browser Rendering -Gateway (`POST /api/render`), while Web Core continues to own HTML extraction, -navigation, links, and content limits. CLI, MCP, Pi, and DSH keep the existing -direct `agent-browser` renderer. Review fixes make the boundary image-only: -`GUIONAI_HTTP_IMAGE=1` is set by the Docker runtime, while a normal npm/local -`web serve` preserves its supplied direct operations. - -## Acceptance criteria - -- [x] Configured gateway Fetch and Links requests send `{ url, waitMs }`, use - returned raw DOM and final URL, preserve navigation/link response contracts, - and accept `waitMs` from 0 through 30,000. -- [x] Gateway delegation is limited to the explicitly marked image path; - normal npm/local servers with direct operations retain direct browser - rendering. -- [x] Missing, overloaded, unreachable, timed-out, malformed, oversized, or - failed gateway work is translated to explicit `render_*` capability errors; - cancellation propagates and HTTP rendering remains independent. -- [x] The production image uses the slim Node runtime without Chromium or - `agent-browser`; direct browser users outside the HTTP image retain their - existing capability. -- [x] README, HTTP-service/operator documentation, glossary, Dockerfile - comments, release documentation, and ADRs describe the gateway boundary and - `BROWSER_GATEWAY_URL` configuration. -- [x] Tests cover the fetch transport seam, HTTP routes, failure/cancellation - behavior, and the image contract without a live browser, cluster, - credentials, or production service. - -## Verification - -All checks completed successfully from the final implementation: - -- `pnpm typecheck` -- `pnpm build` -- `pnpm test` — 20 files, 153 tests passed -- `pnpm test:release` -- `pnpm test:pack` — web, Pi, and DSH package smoke checks passed -- `pnpm test:image` — builds a disposable image, runs a fake `/api/render`, - verifies browser Fetch, and probes browser binaries are absent -- `pnpm format:check` -- `git diff --check` -- `docker build --tag guionai-web:browser-gateway-test .` -- Test-owned gateway plus image smoke request — HTTP Fetch returned rendered - content and the gateway log confirmed `/api/render` with `{ url, waitMs }`. -- Runtime binary probe — `no-browser-binaries` for `agent-browser`, Chromium, - and Google Chrome. - -## Fixed-point LOC accounting - -The fixed point is `ed74871`. Generated files and lockfiles are excluded. -Actual additions and deletions are: - -| Category | Additions | Deletions | -| --- | ---: | ---: | -| Product code | 343 | 8 | -| Tests | 590 | 0 | -| Configuration and docs | 118 | 37 | -| **Total** | **1,051** | **45** | - -The total (1,096 changed lines) exceeds the original 570–960 estimate because -the review required a repeatable 193-line Docker contract harness, explicit -image-mode selection, CI/release invocation, and corresponding documentation. -The added paths remain test-owned and bounded; no compatibility layer or -unfinished infrastructure was added. - -## Commits and scope - -- `9c9a088 feat(http): delegate container browser rendering to gateway` -- `aec662e fix(http): keep gateway rendering image-only` -- Changed implementation paths: `packages/web-core/src/`, - `packages/web-core/test/`, `packages/web/src/http.ts`, - `packages/web/src/program.ts`, `packages/web/test/http.test.ts`, - `scripts/test-image-contract.mjs`, `Dockerfile`, `README.md`, `CONTEXT.md`, - `docs/http-service.md`, `docs/adr/`, `package.json`, and CI/release workflows. - -The required report is intentionally kept under `.scratch` and is excluded -from the implementation LOC table above. - -## Remaining operational boundary - -The separately deployed Browser Rendering Gateway must be reachable and -configured through `BROWSER_GATEWAY_URL`; its deployment, capacity, proxy, -authentication, and rollout remain outside this repository. Code review and -deployment are excluded from this implementation task. diff --git a/.scratch/deepseek-search-provider/implementation-report.md b/.scratch/deepseek-search-provider/implementation-report.md deleted file mode 100644 index 80adf0a..0000000 --- a/.scratch/deepseek-search-provider/implementation-report.md +++ /dev/null @@ -1,141 +0,0 @@ -# DeepSeek search provider implementation report - -## Scope - -- Repository: `guionai/web` -- Branch: `deepseek-search-provider` -- Fixed point: `987f664b1d43d2b3325849a8ed818c7332bf8808` -- Implementation commit: `6826d3ead70eafaca21965b125041dc95ef63a7a` (`feat(search): add explicit DeepSeek provider`) -- Delivery boundary: the complete `deepseek-search-provider` spec and tickets - 01, 02, and 03. Code review and deployment were excluded. - -The tickets were implemented in dependency order: the shared Core adapter and -selection seam first, then CLI/MCP/Pi and DSH, followed by the server-local -HTTP selection and OpenAPI contract. - -## Review repair batch - -- Repair commit: `e7ef2fc` (`fix(search): tighten DeepSeek review contracts`). -- The review-again gate classified these as local contract/test repairs: the - runtime method and risk surface are unchanged, so focused verification was - sufficient and a second broad code review was not required. -- Removed the three DeepSeek packed-artifact source-string assertions from the - artifact test. Existing runtime, provider, and rendered-settings tests remain - the behavior coverage for those contracts. -- DeepSeek's seven endpoint/model/version/token/tool protocol constants are now - implementation-private in web-core. The Core fixture asserts the expected - protocol through test-local constants instead of importing production - implementation details. -- DSH alpha.3 deployed-entrypoint acceptance was unavailable on this host. The - documented path `/home/neil/.local/share/dsh-runtime/node_modules/@deepseek-ai/dsh/lib/bin.js` - failed the availability check (`test -f` returned `unavailable`), and the - direct probe `node --expose-internals /home/neil/.local/share/dsh-runtime/node_modules/@deepseek-ai/dsh/lib/bin.js --help` - failed with `MODULE_NOT_FOUND`. Consequently, no Host/browser acceptance was - run, and no host state or credentials were created or modified. - -## Ticket outcomes - -### 01 — Add explicit DeepSeek search outside DSH - -- Core recognizes `deepseek` only when explicitly selected and requires - `DEEPSEEK_API_KEY`; Exa/Brave implicit selection remains unchanged, so a - DeepSeek key alone never changes the default. -- The adapter posts one fixed Anthropic-compatible Messages request to - `https://api.deepseek.com/anthropic/v1/messages` using - `deepseek-v4-flash`, `max_tokens: 4096`, the fixed auxiliary search prompt, - and `web_search_20250305` with `max_uses: 5`. The endpoint/model/tool details - are not host request fields. -- Only structured `web_search_tool_result` / `web_search_result` blocks are - mapped. URL-keyed `cited_text` excerpts become snippets, duplicate URLs are - removed, and prose-only responses are provider errors. Requests use the - existing bounded timeout/cancellation and secret-safe response handling. -- CLI and MCP flags, Pi's existing provider environment mechanism, runtime - credentials, and MCP error redaction recognize DeepSeek. Their search inputs - remain provider-neutral where applicable. -- README and host documentation describe explicit selection, normalized - results, and the one auxiliary model-call cost. - -### 02 — Add DeepSeek to DSH provider settings - -- DSH's live provider union/picker includes `deepseek` and its label. -- The settings client manages the namespaced write-only - `GUIONAI_DSH_WEB_DEEPSEEK_API_KEY` credential alongside Exa and Brave. The - UI has no DeepSeek endpoint field; the existing endpoint control remains - explicitly a Kepos Bridge setting. -- The host adapter resolves only the selected DeepSeek credential for each - operation and forwards `provider: "deepseek"` through Core. Kepos-only tool - registration and non-DeepSeek provider behavior remain unchanged. -- DSH host, browser-client, packed-artifact, settings, and provider-fake tests - cover selection, DeepSeek metadata-only status, the existing write/remove - flow, and artifact presence without live credentials. -- The DSH README and package metadata document the picker/key workflow, no - DeepSeek endpoint input, normalized results, and call cost. - -### 03 — Select DeepSeek for the personal HTTP service - -- With no `WEB_SEARCH_PROVIDER`, HTTP retains its Bridge-first policy and one - Exa retry, including the existing Exa startup requirement. -- With server-local `WEB_SEARCH_PROVIDER=deepseek`, startup requires a - non-empty `DEEPSEEK_API_KEY`; each request calls DeepSeek exactly once and - never falls back to Bridge or Exa. HTTP clients still send only - `{ "query": "..." }`. -- HTTP validation and generated OpenAPI include the `DeepSeek` response label - without adding a request provider field. Fakes cover selected success, - failure/no-fallback, startup key validation, cancellation treatment, and - unchanged default behavior. -- The HTTP reference, README, glossary, and ADR document the server-local - selection, credential boundary, normalized contract, and no-fallback rule. - -## Verification - -All implementation and review-repair checks completed successfully: - -- Focused `pnpm exec vitest run packages/web-core/test/search.test.ts - packages/dsh-web/test/artifact.test.ts` — 2 files and 14 tests passed. - -- `pnpm format:check` and explicit Prettier checks for the changed Markdown - references; `git diff --check`. -- `pnpm typecheck`. -- `pnpm test` — 19 test files and 132 tests passed. The existing missing DSH - primitive source-map warning was non-fatal. -- `pnpm build` — all four workspace packages built and generated - `packages/web/dist/openapi.yaml` with the DeepSeek response enum. -- `pnpm test:release` — release version synchronization fixtures passed. -- `pnpm test:pack` — packed-installation/host-loading checks passed for - `@guionai/web`, `@guionai/pi-web`, and `@guionai/dsh-web`. - -No live DeepSeek service, credentials, production services, or persistent host -state were used. - -## Changed paths and size - -Against the fixed point, excluding generated `dist` output, lockfiles, and -this report: - -- Product code: 209 additions and 12 deletions (221 changed lines) across - Core, CLI, MCP, Pi, DSH, and HTTP. -- Tests: 372 additions and 2 deletions (374 changed lines), including Core - request/mapping/error seams, adapter forwarding, DSH credential/UI checks, - HTTP selection, and OpenAPI assertions. -- Documentation/configuration: 71 additions and 37 deletions (108 changed - lines), including README, HTTP reference, glossary, ADR, DSH README, and - package metadata. -- Total: 652 additions and 51 deletions (703 changed lines), within the spec's - 580–970 total-line estimate. Product code is below its 260–410 estimate - because the implementation reuses the existing bounded-request, normalized - result, host-selection, settings, and artifact seams; the tests and - documentation remain within their estimated ranges. - -## Remaining concerns - -- A live DeepSeek capability/account probe remains intentionally deferred by - the spec; tests use injected local fetch fixtures only. -- Public or multi-tenant HTTP hardening remains out of scope as documented by - ADR 0001 and the existing deferred security note. -- A second broad code review and deployment were intentionally not run; the - review-again gate classified this batch as local repairs. - -## Acceptance result - -Tickets 01, 02, and 03 and the complete `deepseek-search-provider` spec are -implemented and verified. diff --git a/.scratch/defered/public-http-service-security.md b/.scratch/defered/public-http-service-security.md deleted file mode 100644 index 9ebcf91..0000000 --- a/.scratch/defered/public-http-service-security.md +++ /dev/null @@ -1,16 +0,0 @@ -# Public HTTP service hardening - -Before Guion Web's container is presented as a public or multi-tenant service, define and implement the security boundary for outbound requests and rendered browsing. The current first release is a Personal Web Service only. - -Required decisions and work: - -- Block private, loopback, link-local, and otherwise non-public network targets across redirects and DNS resolution, including DNS rebinding. -- Run `agent-browser` in an isolated browser/process and restrict its network egress consistently with direct fetch. -- Set resource and concurrency limits appropriate for a remotely reachable renderer. -- Define the authentication and tenant boundary when the service stops being personal. - -This deferred work does not change the v1 search policy: the Personal Web -Service tries the server-configured Bridge Route first, preserves successful -empty results, and falls back exactly once to the server-configured Exa -credential only for a non-cancellation Bridge failure. Typed Bridge Data -Operations report Bridge failure directly. diff --git a/.scratch/dsh-alpha5-upgrade/implementation-report.md b/.scratch/dsh-alpha5-upgrade/implementation-report.md deleted file mode 100644 index e042a12..0000000 --- a/.scratch/dsh-alpha5-upgrade/implementation-report.md +++ /dev/null @@ -1,110 +0,0 @@ -# DSH Web 0.1.2-rc.1 implementation report - -## Scope - -- Repository: `guionai/web` -- Branch: `dsh-alpha5-upgrade` -- Fixed point: `d65ad78` -- Delivery boundary: the Target Amendment in `spec.md`, including tickets 01 - and 02. Code review and deployment were excluded. - -The Target Amendment reopened the previously completed tickets and superseded -their prior target. Ticket 01 was retargeted first, followed by ticket 02's -documentation and loader guidance. Both tickets and the spec are now recorded -as complete. - -## Ticket outcomes - -### 01 — Run Guion DSH Web on the rc.1 package contract - -- Replaced every owned DSH peer and development dependency in - `packages/dsh-web/package.json` with the exact `0.1.2-rc.1` version. Cordis, - Schemastery, React, and the ordinary Web/Pi package contracts were unchanged. -- Regenerated `pnpm-lock.yaml` atomically. The owned DSH Web importer entries - and package snapshots now resolve the rc.1 family, with no alpha.5 entries. -- Updated the package and provider seam assertions to name rc.1. Existing - provider search, credentials, browser rendering, settings, and tool-card - behavior required no source migration, compatibility adapter, or runtime - override. -- The packed-artifact smoke continues to exercise host registration, search, - HTTP and browser rendering, links, tool registration, patch metadata, and the - lazy browser client against the exact rc.1 package contract. - -### 02 — Document Guion DSH Web's rc.1 package contract - -- Updated the DSH package description, README, profile-patch comment, and - package-facing test wording to identify `0.1.2-rc.1`. -- Updated `AGENTS.md` with the verified official rc.1 CLI/Loader workflow: - install the CLI in a disposable directory, use a disposable `DSH_HOME`, - invoke its `lib/bin.js` entrypoint with Node 24 `--expose-internals`, and use - no live credentials or custom runtime overrides. -- Inspected the root `README.md`; it makes no DSH release-version promise, so - no root README change was needed. - -## Verification - -All checks passed on Linux: - -- `pnpm install --frozen-lockfile --ignore-scripts` -- `pnpm --filter @guionai/dsh-web run typecheck` -- `pnpm --filter @guionai/dsh-web run test` — 6 files, 26 tests passed -- `pnpm --filter @guionai/dsh-web run build` -- `pnpm --filter @guionai/dsh-web run test:pack` — packed artifact passed -- `pnpm typecheck` -- `pnpm format:check` -- `pnpm test:release` -- `pnpm test` — 20 files, 153 tests passed -- `pnpm build` — all four workspace packages built -- `pnpm test:pack` — Web, Pi, and DSH packed smokes passed -- `git diff --check` - -The official CLI check used an isolated temporary install of -`@deepseek-ai/dsh@0.1.2-rc.1` (213 DSH packages in its installed graph) and a -separate disposable `DSH_HOME`. The Node entrypoint reported `0.1.2-rc.1`, -installed the packed Guion artifact into the disposable `web` profile, -composed `--dump-config` with the Guion patch and bundle, and booted the web -profile successfully with `--help` and the local server path. No live -credentials, deployed profiles, browsers, or production services were used. - -Vitest emitted the existing non-failing missing source-map warning from the -DSH primitives package. Package smokes used injected operations, local -fixtures, and test-owned temporary package/cache paths. - -## Changed paths - -- `AGENTS.md` -- `packages/dsh-web/package.json` -- `packages/dsh-web/README.md` -- `packages/dsh-web/cordis.patch.yml` -- `packages/dsh-web/test/artifact.test.ts` -- `packages/dsh-web/test/package.test.ts` -- `pnpm-lock.yaml` -- `.scratch/dsh-alpha5-upgrade/implementation-report.md` - -No DSH product source, ordinary Web package, or Pi Web package contract -changed. The local spec and issue files were updated in place; they remain -project scratch records and are ignored by the repository's global scratch -ignore rule. - -## LOC accounting - -Against fixed point `d65ad78`, excluding the lockfile, generated artifacts, -the report, and ignored tracker files: - -| Category | Additions | Deletions | -| --- | ---: | ---: | -| Product code | 0 | 0 | -| Tests | 3 | 3 | -| Configuration and docs | 33 | 33 | -| **Total** | **36** | **36** | - -The 72 touched lines are within the spec's 25–75 changed-LOC estimate. The -focused size reflects a dependency/documentation contract update that reuses -the existing provider, UI, artifact, and CLI verification seams. - -## Acceptance result - -The rc.1 Target Amendment, tickets 01 and 02, and the existing DSH Web -behavior are implemented and verified. Guion DSH Web now publishes one exact -`0.1.2-rc.1` peer/dev contract with a refreshed lockfile, package/test/docs -assertions, and passing packed validation against the official rc.1 CLI graph. diff --git a/.scratch/dsh-managed-presets/implementation-report.md b/.scratch/dsh-managed-presets/implementation-report.md deleted file mode 100644 index d66e182..0000000 --- a/.scratch/dsh-managed-presets/implementation-report.md +++ /dev/null @@ -1,143 +0,0 @@ -# DSH compatible presets implementation report - -## Scope - -- Repository: `guionai/web` -- Branch: `dsh-managed-presets` -- Fixed point: `1bb01fd` (`main`) -- Final implementation commit: `3d7d4a1` (`refactor(dsh): simplify compatible preset sync`) -- Delivery boundary: the complete `dsh-managed-presets` spec and tickets 01–04. - -## Outcome - -Guion's DSH bundle now owns the complete research surface: -`web_search`, `web_fetch`, `web_links`, `web_docs`, and -`web_source_search`. The official Web registry/provider integration and -dependency are gone. The Guion implementations retain the selected search -providers, namespaced credentials, fetch navigation/rendering options, -cancellation, bounded output, and conditional Kepos tools. - -The bundle patch disables the official Web stack and hides shipped presets. -It exposes only the user preset root, with `standard` as the default. The -effective Guion schemas remain: - -- `web_search`: required `queries` -- `web_fetch`: required `url`; optional `mode`, `section_id`, `render`, and - `waitMs` - -## Compatible preset workflow - -`web dsh sync` creates or refreshes `standard`, `ptc`, `cordis`, and `minimal` -under the DSH user preset root. Each copy comes from the installed official -`@deepseek-ai/dsh-agent-presets` package with the official `tool-web` entry -removed structurally. - -There is no Guion marker file or persistent ownership metadata. For each -same-ID directory, sync compares the complete tree with two snapshots: - -- an exact current compatible copy is safe to refresh; -- an exact official copy is safe to convert; -- any other content is treated as user-modified and requires interactive - confirmation, or `--yes` in automation. - -Non-interactive sync refuses modified same-ID directories unless `--yes` is -present. Unrelated user presets are untouched. Replacement is staged per -preset, with a local backup restored if installation fails; there is no global -four-preset transaction or speculative race-hook machinery. - -`web dsh doctor` is read-only and reports each compatible preset as `ok`, -`missing`, `stale` (an exact official copy), or `conflict` (any other content). - -## Documentation - -The workflow and the requirement to sync before selecting a compatible preset -are documented in the root README and `packages/dsh-web/README.md`. -`CONTEXT.md` defines the vocabulary, ADR 0004 records the ownership decision, -and `AGENTS.md` records the test-state and real-Linux verification rules. - -## Verification - -Final local checks passed: - -- `pnpm test` — 20 files, 161 tests -- `pnpm typecheck` -- `pnpm build` — all four packages -- `pnpm test:pack` — Web, Pi, and DSH package smoke checks -- `pnpm format:check` -- `pnpm test:release` -- `git diff --check` - -The packed Web smoke no longer contains a fake DSH installation or a second -sync/doctor test graph. Runtime discovery is covered by focused temporary -filesystem tests, including a standard `node_modules/.bin/dsh` shim. - -The real integration check ran on `nuc-kep` from the existing checkout -`/home/neil/code/projects/guionai/web`. `og pull` first fast-forwarded its -current `main`; because `og pull` only fetches the current branch, the new -remote feature ref was then fetched and checked out. The checkout was built -with its installed pnpm, and the built Web CLI called the NUC's installed -`dsh` executable. All mutable DSH state was isolated under: - -```text -/tmp/guion-dsh-checkout.q3UxVE/dsh-home -``` - -The disposable profile linked the checkout's current `@guionai/dsh-web` -package. No live yuki profile, credentials, preset root, or service was read or -changed. - -Observed results: - -```text -DSH compatible presets created all four presets from @deepseek-ai/dsh-agent-presets@0.1.2-rc.1. -DSH doctor: OK -- standard: ok -- ptc: ok -- cordis: ok -- minimal: ok -``` - -The same run then exercised the overwrite policy: - -1. Replacing `standard` with the exact installed official preset was accepted - and converted without a prompt. -2. Adding a user edit to `ptc` made non-interactive sync exit with status 1: - `refusing to overwrite modified same-id preset ptc; rerun interactively or pass --yes`. -3. Re-running with `--yes` refreshed all four presets, after which doctor was - fully green again. - -The same disposable profile was then composed by the installed official Loader -with a read-only probe bundle. The reconciled config contained -`includeShippedRoot: false`, `includeUserRoot: true`, and `default: standard`; -the installed `@guionai/dsh-web` link resolved exactly to the NUC checkout. -The Loader booted successfully and was stopped immediately after the probe: - -```text -standard user rows=26 broken=absent tool-web=0 -ptc user rows=27 broken=absent tool-web=0 -minimal user rows=8 broken=absent tool-web=0 -cordis user rows=27 broken=absent tool-web=0 -web_fetch properties=url,mode,section_id,render,waitMs required=url -web_search properties=queries required=queries -``` - -The probe output is `/tmp/guion-dsh-checkout.q3UxVE/probe.json`. The disposable -Loader process was confirmed stopped, and its token-bearing launch URL was not -recorded. - -Vitest emits the existing non-failing missing source-map warning from the DSH -primitives package. - -## Size - -Against `1bb01fd`, excluding the lockfile and this report, the final diff is -2,144 additions and 521 deletions (2,665 changed lines). The simplified sync -removed 901 lines and added 392 relative to the previously reviewed branch: -the marker protocol, global transaction, injected rename hooks, shim-text -parser, and packed fake-DSH smoke were deleted. - -## Acceptance result - -The whole spec is implemented and verified. The final workflow uses content -comparison plus explicit confirmation, keeps upstream DSH unchanged, and uses -the NUC's real CLI for Linux integration verification. diff --git a/.scratch/http-web-service/implementation-report.md b/.scratch/http-web-service/implementation-report.md deleted file mode 100644 index 364ea8e..0000000 --- a/.scratch/http-web-service/implementation-report.md +++ /dev/null @@ -1,141 +0,0 @@ -# Guion Web page-reading contract implementation report - -## Scope - -- Repository: `guionai/web` -- Branch: `http-web-service` -- Fixed point: `9fff0766001f5ebcad91045c34958af72841da09` -- Implementation commits: `bb4900a5dba9b5d71fdd64363ce860953b2dc098` (`feat(http): unify page-reading contract`), `90de2fa9d77a6dc2ac8c34284f469e1d722e3d12` (`fix(http): repair navigation and renderer validation`), and `19b63287601c5c7472cb85cf0dae1080513b212d` (`fix(core): guard automatic tree without headings`) -- Delivery boundary: the complete `http-web-service` spec and tickets 01 and 02. - Code review and deployment were excluded. - -The tickets were implemented in dependency order: the shared Core page-reading -seam first, then every adapter, HTTP/OpenAPI contract, tests, and documentation. - -## Ticket outcomes - -### 01 — Unify the page-reading module interface - -- Core Fetch and Links now accept only `render: "http" | "browser"`. - HTTP is the default; browser requires `waitMs` from 0 through 30,000, while - HTTP forbids `waitMs`. Capability errors suggest `render: "browser"` with - `waitMs: 2000`. -- Public `tree` and `tree_threshold` inputs were removed. The module owns the - fixed 5,000-character policy: non-full, unsectioned long content with - navigable headings returns a navigation tree, while headingless long content - uses the normal bounded response. `full: true` returns complete extracted - Markdown without the Core 30,000-character truncation, and `section_id` - retrieves one tree section. -- `full: true` with `section_id` is rejected. Core validation also rejects - unknown legacy fields and invalid navigation values. -- Core tests use injected cache, HTTP, and browser seams; no live provider or - browser state is required. -- H1-only long documents now list their H1 as a selectable tree node with a - stable `section_id`; a Core behavior test retrieves the emitted ID and checks - the complete section content. - -### 02 — Align adapters, HTTP, and reference documentation - -- CLI flags/help, stdio MCP schemas, Pi TypeBox schemas/prompts, DSH tool - definitions, and HTTP schemas now expose the same renderer and navigation - vocabulary without compatibility aliases. -- HTTP remains exactly `/v1/search`, `/v1/fetch`, and `/v1/links`. Search keeps - server-selected Kepos Bridge-first behavior with one Exa retry; Fetch and - Links enforce the shared renderer rules. -- The build generates the version-matched OpenAPI 3.1 artifact at - `packages/web/dist/openapi.yaml`; the release artifact test parses a - test-owned generated file and asserts exactly the three retained routes and - the unified request schemas. -- Added [`docs/http-service.md`](../../docs/http-service.md), a standalone - human-readable reference covering requests, responses, validation, provider - behavior, renderer behavior, errors, and the OpenAPI release asset. README - and ADR 0001 link to and describe the same contract. Operator setup may still - name the installed browser executable. -- CONTEXT.md now uses the public `render: "http" | "browser"` vocabulary for - glossary and HTTP guidance; `agent-browser` appears only as an operator - implementation/setup detail. Pi and DSH each consolidate their repeated - renderer/wait checks in one local helper while preserving validation order, - messages, and forwarding behavior. - -## Review-fix batch - -The post-review repairs were applied in the scoped commits `90de2fa` and -`19b6328`: - -- Core tree output for an H1-only long document emits its deterministic heading - ID, and the behavior test uses that ID to retrieve the section. -- CONTEXT.md describes the public HTTP/browser renderer contract and reserves - the `agent-browser` name for operator implementation/setup wording. -- Pi and DSH each own a local `validateRenderOptions` helper; no - cross-adapter abstraction was added. -- Core now enters automatic tree mode only when headings exist. A headingless - long document stays in bounded `mode: "full"`, while `full: true` still - returns the complete content; the Core behavior test covers both paths. - -## Verification - -All checks completed successfully against the implementation commit: - -- `pnpm format:check` and explicit Prettier checks for the ADR, DSH README, and - standalone HTTP reference. -- `pnpm typecheck`. -- `pnpm test` — 19 test files and 117 tests passed. The existing DSH source-map - warning was non-fatal. -- `pnpm build` — all workspace packages built and generated - `packages/web/dist/openapi.yaml`. -- `pnpm test:release` — release version synchronization fixtures passed. -- `pnpm test:pack` — packed-installation/host-loading checks passed for - `@guionai/web`, `@guionai/pi-web`, and `@guionai/dsh-web`. -- Docker validation with the supported image: `docker build --tag -guionai-web-http-smoke .` passed; a disposable container returned HTTP 400 - for invalid Fetch input and HTTP 200 for a real browser-rendered - `https://example.com` Fetch with `full: true`. - -No live credentials were used. The Docker smoke used a disposable container -and a non-secret placeholder startup key; it was stopped after verification. - -The final Core edge repair was additionally verified with: - -- `pnpm exec vitest run packages/web-core/test/markdown.test.ts` — 4 tests - passed. -- `pnpm typecheck`, `pnpm format:check`, and explicit Prettier checks for the - changed Core source/test files and HTTP/CONTEXT documentation. - -The review-fix commit was additionally verified with: - -- `pnpm typecheck`. -- `pnpm format:check` and explicit Prettier checks for the changed source files, - CONTEXT.md, and the HTTP reference. -- `pnpm test` — 19 test files and 118 tests passed. The existing DSH source-map - warning was non-fatal. -- `pnpm build` — all workspace packages built and generated - `packages/web/dist/openapi.yaml`. -- `pnpm test:release` — release version synchronization fixtures passed. -- `pnpm test:pack` — packed-installation/host-loading checks passed for - `@guionai/web`, `@guionai/pi-web`, and `@guionai/dsh-web`. - -## Changed paths and size - -Against the fixed point, excluding generated `dist` output, lockfiles, and -this report: - -- Product code: 328 additions and 254 deletions (582 changed lines) across - Core, CLI, MCP, Pi, DSH, and HTTP. -- Tests: 227 additions and 166 deletions (393 changed lines), including Core - navigation/renderer seams, adapter forwarding/validation, and OpenAPI - artifact parsing. -- Documentation/configuration: 229 additions and 53 deletions (282 changed - lines), including the 154-line standalone HTTP reference and aligned README, - ADR, package metadata, and DSH guide. -- Total: 784 additions and 473 deletions (1,257 changed lines), within the - spec estimate of 780–1,400 total changed lines. Product code is modestly - above its 250–450 estimate because each owned adapter now performs explicit - input normalization and legacy-field rejection at its boundary; the review - repair remains a small local delta. - -## Remaining concerns - -- Public or multi-tenant HTTP hardening remains out of scope as documented by - ADR 0001 and the existing deferred security note. -- Code review and deployment were intentionally not run for this implementation - task. diff --git a/.scratch/web-cli-version/implementation-report.md b/.scratch/web-cli-version/implementation-report.md deleted file mode 100644 index 1609816..0000000 --- a/.scratch/web-cli-version/implementation-report.md +++ /dev/null @@ -1,82 +0,0 @@ -# Embedded Web CLI version implementation report - -## Scope - -- Repository: `guionai/web` -- Branch: `web-cli-version` -- Fixed point: `89cfe70cc33ccb10d403444fcaa2ee0ec083c2fa` -- Implementation commit: `1092788229ff08d25577b77bec8b8000c67cea83` - (`feat(cli): report embedded package version`) -- Delivery boundary: the complete `web-cli-version` spec and ticket 01. - Code review and deployment were excluded. - -## Ticket outcome - -### 01 — Report the embedded Web CLI version - -- The root Commander program now exposes the standard `-V, --version` option. - Both flags write exactly the Web package version and a newline to stdout, - return success, and bypass all research operations and credential loading. -- The Web tsup build reads `packages/web/package.json` while building and - replaces a dedicated compile-time token with that manifest version. The - bundled CLI contains the literal and does not read Git or package metadata at - invocation time. Release checkout synchronization therefore supplies the - tag-derived value, while local builds use the local manifest value. -- The packed Web smoke test invokes both flags, compares stdout with the - packed manifest version, changes the test-owned installed manifest, and - verifies that both flags still report the original packed value. -- The root README documents `web --version` and `web -V` in the CLI guidance. - -## Verification - -All relevant checks passed on Linux: - -- `pnpm format:check` — all repository formatting checks passed. -- `pnpm exec prettier --check vitest.config.ts packages/web/src/version.ts` — - the root config and new source module also match Prettier. -- `git diff --check` — no whitespace errors. -- `pnpm typecheck` — TypeScript completed successfully. -- `pnpm exec vitest run packages/web/test/program.test.ts` — 17 tests passed, - including both Commander version flags and the no-operation/no-credential - contract. -- `pnpm test` — 19 files and 144 tests passed. The existing missing DSH - primitive source-map warning was non-fatal. -- `pnpm build` — all four workspace packages built and Web generated - `packages/web/dist/openapi.yaml`. -- `pnpm test:release` — release version synchronization fixtures passed. -- `pnpm test:pack` — Web, Pi, and DSH packed-installation/host-loading checks - passed; the DSH artifact suite passed its 2 tests. - -The packed smoke uses test-owned temporary package, cache, and browser-fixture -paths. No live credentials, production services, or persistent user state were -used. - -## Changed paths and size - -Against the fixed point, excluding generated `dist` output, lockfiles, and -this report: - -- Product code: 12 additions and 1 deletion across the Commander adapter, - runner, and embedded-version module. -- Build/test configuration: 21 additions in the Web tsup define and Vitest - test define. -- Tests: 58 additions covering both flags, output routing, no credentials or - operations, and packed-manifest mutation. -- Documentation: 1 addition in the root README. -- Total: 92 additions and 1 deletion (93 touched lines). This is 25 lines - above the spec's 28–68-line estimate because the implementation includes - both a direct Commander contract test and a two-stage packed smoke assertion - plus the manifest-derived test define needed for synchronized release - versions. - -## Remaining concerns - -- Code review and deployment were intentionally not run, as excluded by the - request. -- Version commands are scoped to the Web executable; MCP metadata and the Pi, - DSH, and Web Core package versions remain unchanged as required. - -## Acceptance result - -Ticket 01 and the complete `web-cli-version` spec are implemented, committed, -and verified. diff --git a/.scratch/web-dsh-alpha-compat/implementation-report.md b/.scratch/web-dsh-alpha-compat/implementation-report.md deleted file mode 100644 index 4d5969c..0000000 --- a/.scratch/web-dsh-alpha-compat/implementation-report.md +++ /dev/null @@ -1,68 +0,0 @@ -# DSH Web alpha.3 implementation report - -## Scope - -- Repository: `guionai/web` -- Branch: `web-dsh-alpha-compat` -- Fixed point: `bafb7cb0b2c3ad0987c98a1ae95f80f7272992d6` -- Implementation commit: `3e83537` (`feat(dsh-web): migrate plugin to DSH alpha.3`) -- Authority: published DSH `0.1.2-alpha.3` packages and current official Harness source. The browser settings scope follows alpha's `packages/client/ui-settings/src/client/settings-contract.ts` and `settings-scope.ts` contract. - -The complete dependency frontier was implemented in ticket order: - -### 01 — Run the Web provider on alpha.3 - -- Replaced the retired `@deepseek-ai/dsh-client-runtime` import, client injection, peer dependency, dev dependency, and bundle external with the alpha UI renderer seam. -- Updated the declared DSH peer and development dependency family to `0.1.2-alpha.3`, with Cordis `4.0.2` and Schemastery `3.18.2`. -- Migrated credential calls to the alpha direct `remote.credentials` API and alpha `RemoteResult` shape while preserving search, fetch, link, provider, tool-result, and error behavior. - -### 02 — Run Web tool and settings surfaces on alpha.3 - -- Migrated browser client context and settings scope imports to alpha owners. -- Uses alpha browser services (`remote`, `remote.credentials`, `settingsScope`, and `slots`) and the alpha credentials event `credentials/reference-updated`. -- Keeps the existing Web tool renderer registration, settings card interactions, native slot seam, and CSS/theme behavior; no official conversation DOM or compatibility adapter was introduced. -- Registers the package settings namespace through the alpha literal namespace contract. - -### 03 — Verify the packed alpha Web artifact - -- Extended the existing isolated packed-artifact test to assert alpha peer versions, absence of the retired Runtime and `0.1.1-rc.2` paths, Host registration, and lazy browser-client loading. -- Temporary package installs and host fakes remain test-owned; no live credentials, browsers, profile state, or research services are used. - -## Changed paths - -- `packages/dsh-web/package.json` -- `packages/dsh-web/src/client.ts` -- `packages/dsh-web/src/index.ts` -- `packages/dsh-web/tsup.config.ts` -- `packages/dsh-web/test/client.test.ts` -- `packages/dsh-web/test/artifact.test.ts` -- `packages/dsh-web/test/package.test.ts` -- `packages/dsh-web/README.md` -- `packages/dsh-web/cordis.patch.yml` -- `pnpm-lock.yaml` - -## Verification - -All checks completed successfully on Linux: - -- `pnpm install --frozen-lockfile` -- `pnpm --filter @guionai/dsh-web run typecheck` -- `pnpm --filter @guionai/dsh-web run build` -- `pnpm --filter @guionai/dsh-web run test:pack` — 2 tests passed -- `pnpm --filter @guionai/dsh-web test` — 5 files, 17 tests passed -- `pnpm run typecheck` -- `pnpm run build` — all 4 packages built -- `pnpm test` — 15 files, 83 tests passed -- `pnpm test:release` -- `pnpm format:check` -- `git diff --check` - -The alpha primitives package emits a non-failing missing source-map warning during Vitest; it does not affect the results. No code review or deployment was performed, as excluded by the request. - -## LOC variance - -Excluding the lockfile and generated artifacts, the implementation changed 139 lines added and 110 removed (249 total changed lines). The estimate was 270–510 changed lines, so the result is 21 lines below the lower bound. The variance is due to a focused contract migration that reuses the existing provider, UI, test, and artifact infrastructure instead of adding adapters or new product behavior. - -## Acceptance result - -Tickets 01, 02, and 03 are complete. The packed artifact has no bundled DSH internals, no retired Runtime path, and no old `0.1.1-rc.2` contract; Host and lazy browser client loading are verified in isolated temporary state.