-
Notifications
You must be signed in to change notification settings - Fork 664
feat(lab): CL-04 CLI and management read surfaces #1378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # CL-04 implementation record — Lab CLI and management read surfaces | ||
|
|
||
| ## Programme position | ||
|
|
||
| - **Phase:** CL-04 (read-surface only) | ||
| - **Starting `upstream/dev` SHA:** `68c71a4e9cdf882d812f09fd94783a28749db629` (merge #1352) | ||
| - **Branch:** `feat/cl-04-lab-read-surfaces` | ||
| - **PR:** [#1378](https://github.com/lidge-jun/opencodex/pull/1378) → `lidge-jun/opencodex:dev` | ||
| - **CL-05:** not started | ||
|
|
||
| ## Scope delivered | ||
|
|
||
| ### Shared query layer (`src/lab/query/`) | ||
|
|
||
| - Read-only SQLite open via `openLabReadConnection()`; never creates DB or rebuilds projection | ||
| - Schema/spec validation (`LAB_SQLITE_SCHEMA_VERSION`, `LAB_PROJECTION_SPEC_VERSION`) | ||
| - Explicit `lab_projection_unavailable` / `lab_projection_incompatible` errors | ||
| - Parameterized SQL, deterministic keyset cursors, bounded pagination (default 50, max 100) | ||
| - Privacy-safe DTO mapping (`dto-map.ts`) — no raw `payload_json` or artifact bytes | ||
| - Catalogue from packaged CL-01/CL-03 authorities (`catalog.ts`) | ||
|
|
||
| ### Management API (`src/server/management/lab-routes.ts`) | ||
|
|
||
| - `GET /api/lab/status` | ||
| - `GET /api/lab/verdicts` | ||
| - `GET /api/lab/subjects`, `GET /api/lab/subjects/:subjectId` | ||
| - `GET /api/lab/observations` | ||
| - `GET /api/lab/events`, `GET /api/lab/events/:eventId` | ||
| - `GET /api/lab/artifacts`, `GET /api/lab/artifacts/:digest` | ||
| - `GET /api/lab/catalog` | ||
|
|
||
| ### CLI (`src/cli/lab.ts`) | ||
|
|
||
| - `ocx lab status|verdicts|subjects|subject|observations|events|event|artifacts|artifact|catalog` | ||
| - `--json` machine output; skips Codex shim autorestore; no daemon/network | ||
|
|
||
| ## Validation (local) | ||
|
|
||
| - `bun x tsc --noEmit` — passed | ||
| - `bun test tests/lab-read-surfaces.test.ts` — 17/17 passed | ||
| - `bun test tests/lab-conformance-harness.test.ts` — 17/17 passed | ||
| - `bun test tests/lab-evidence-ledger.test.ts` — 37/41 passed; 4 pre-existing Windows SQLite `EPERM`/file-lock flakes in `wipeSqlite` during repeated `rebuildLabProjection` (same failures on base `68c71a4` without CL-04) | ||
| - `bun test tests/lab-live-probe.test.ts` — 19/19 passed | ||
| - `bun test tests/lab-live-sandbox.test.ts` — 17/17 passed | ||
| - `bun run privacy:scan` — passed | ||
|
|
||
| ## Acceptance blockers | ||
|
|
||
| - PR #1378 requires final CI after review remediation | ||
| - Independent acceptance review not performed | ||
| - Reviewer findings must be reconciled before CL-04 acceptance | ||
|
|
||
| ## Out of scope (confirmed) | ||
|
|
||
| - CL-05 GUI, CL-06 routing profile fields, CL-07 fabric, CL-08 probes/public publish | ||
| - Automatic projection rebuilds, probe execution, raw artifact download APIs |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -264,6 +264,20 @@ const helpEntries: Record<string, HelpEntry> = { | |
| "Invalid or unknown arguments exit 64. Not-ready, pending, failed, timeout, and unreachable exit 1.", | ||
| ], | ||
| }, | ||
| lab: { | ||
| usage: "ocx lab <status|verdicts|subjects|subject|observations|events|event|artifacts|artifact|catalog> [options] [--json]", | ||
| summary: "Read-only Compatibility Lab projection inspection (local SQLite; no daemon).", | ||
| details: [ | ||
| "status Projection availability, schema versions, and row counts.", | ||
| "verdicts Paginated derived compatibility verdicts with filters.", | ||
| "subjects List subjects; subject <id> returns one typed subject.", | ||
| "observations Paginated observation rows from the projection.", | ||
| "events Event history; event <id> returns one safe typed event.", | ||
| "artifacts Artifact metadata only (no content download).", | ||
| "catalog Packaged protocol/live scenario catalog metadata.", | ||
| "Reads never rebuild the projection, trigger probes, or require the proxy.", | ||
| ], | ||
| }, | ||
|
Comment on lines
+267
to
+280
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use one spelling of "catalog" in the user-facing text. Line 268 names the subcommand The subcommand name is ✏️ Proposed fix- "catalog Packaged protocol/live scenario catalogue metadata.",
+ "catalog Packaged protocol/live scenario catalog metadata.",Apply the same change in - return lines.length > 0 ? lines : ["No catalogue scenarios"];
+ return lines.length > 0 ? lines : ["No catalog scenarios"];🤖 Prompt for AI Agents |
||
| }; | ||
|
|
||
| function packageVersion(): string { | ||
|
|
@@ -318,6 +332,7 @@ Usage: | |
| ocx grok <sub> Grok Build model selection and apply | ||
| ocx system <sub> Runtime settings, startup, sync, and updates | ||
| ocx config <sub> Validated configuration show/get/set/import/export | ||
| ocx lab <sub> Read-only Compatibility Lab projection inspection | ||
| ocx claude [args...] Launch Claude Code wired to the proxy (model discovery on) | ||
| ocx claude desktop [sub] Manage and apply Claude Desktop's four-family profile | ||
| ocx opencode [args...] Launch opencode wired to the proxy (runtime provider config) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.