From 9af4c03b6d21ba46abb4a1513f542f865216ad58 Mon Sep 17 00:00:00 2001 From: tegwick Date: Wed, 8 Jul 2026 14:32:19 +0200 Subject: [PATCH] Seeded INTENT.md and stuff --- AGENTS.md | 176 +++++++++++++++++++ INTENT.md | 20 +++ SCOPE.md | 38 ++++ workplans/JSUI-WP-0001-statehub-bootstrap.md | 59 +++++++ 4 files changed, 293 insertions(+) create mode 100644 AGENTS.md create mode 100644 INTENT.md create mode 100644 SCOPE.md create mode 100644 workplans/JSUI-WP-0001-statehub-bootstrap.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..96f8db3 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,176 @@ +# testdrive-jsui — Agent Instructions + +## Repo Identity + +**Purpose:** TestDrive-JSUI is a standalone, JavaScript-first markdown editor and UI library (with an optional Python integration adapter) that is being packaged for npm distribution. + +**Domain:** infotech +**Repo slug:** testdrive-jsui +**Topic ID:** `cee7bedf-2b48-46ef-8601-006474f2ad7a` +**Workplan prefix:** `JSUI-WP-` + +--- + +## State Hub Integration + +The Custodian State Hub tracks work across all domains. Interact via HTTP REST — +there is no MCP server for Codex agents. + +| Context | URL | +|---------|-----| +| Local workstation | `http://127.0.0.1:8000` | +| Remote via tunnel | `http://127.0.0.1:18000` | +| Optional local edge relay | http://127.0.0.1:18080 | + +When an operator has enabled the edge relay, set API_BASE to the relay URL. +Queueable writes return an explicit queued receipt if the central hub is +unreachable. Treat that as pending local evidence, then ask the operator to run +statehub outbox status/replay after connectivity returns. + +### Orient at session start + +```bash +# Offline brief — works without hub connection +cat .custodian-brief.md + +# Active workplans for this domain +curl -s "http://127.0.0.1:8000/workplans/?topic_id=cee7bedf-2b48-46ef-8601-006474f2ad7a&status=active" \ + | python3 -m json.tool + +# Check inbox +curl -s "http://127.0.0.1:8000/messages/?to_agent=testdrive-jsui&unread_only=true" \ + | python3 -m json.tool +``` + +Mark a message read: +```bash +curl -s -X PATCH "http://127.0.0.1:8000/messages//read" \ + -H "Content-Type: application/json" -d '{}' +``` + +### Log progress (required at session close) + +```bash +curl -s -X POST http://127.0.0.1:8000/progress/ \ + -H "Content-Type: application/json" \ + -d '{ + "summary": "what was done", + "event_type": "note", + "author": "codex", + "workplan_id": "", + "task_id": "" + }' +``` + +Omit `workplan_id` / `task_id` when not applicable. + +### Update task status + +```bash +curl -s -X PATCH "http://127.0.0.1:8000/tasks/" \ + -H "Content-Type: application/json" \ + -d '{"status": "progress"}' +# values: wait | todo | progress | done | cancel +``` + +### Flag a task for human review + +```bash +curl -s -X PATCH "http://127.0.0.1:8000/tasks/" \ + -H "Content-Type: application/json" \ + -d '{"needs_human": true, "intervention_note": "reason"}' +``` + +--- + +## Session Protocol + +**Start:** +1. `cat .custodian-brief.md` — domain goal and open workplans (offline-safe) +2. Check inbox: `GET /messages/?to_agent=testdrive-jsui&unread_only=true`; mark read +3. Scan workplans: `ls workplans/` — note `status: ready`, `active`, or `blocked` files and open tasks +4. Check human-needed tasks: `GET /tasks/?needs_human=true` + +**During work:** +- Update task statuses in workplan files as tasks progress +- Record significant decisions via `POST /decisions/` + +**Close:** +1. Update workplan file task statuses to reflect progress +2. Log: `POST /progress/` with a summary of what changed +3. After workplan file changes, run: + ```bash + statehub fix-consistency + ``` + Coding agents should run this directly; ask the operator only if the CLI or + State Hub API is unavailable. This syncs task status from files into the hub DB. + +--- + +{CREDENTIAL_ROUTING} + + + + +--- + +## Workplan Convention (ADR-001) + +Work items originate as files in this repo — not in the hub. The hub is a +read/cache/index layer that rebuilds from files. + +**File location:** `workplans/JSUI-WP-NNNN-.md` + +**Archived location:** finished workplans may move to +`workplans/archived/YYMMDD-JSUI-WP-NNNN-.md`. The `YYMMDD` prefix is +the completion/archive date; the frontmatter `id` does not change. + +**Ad Hoc Tasks:** small opportunistic fixes discovered during a session use +`workplans/ADHOC-YYYY-MM-DD.md` with task ids `ADHOC-YYYY-MM-DD-T01`, etc. Use +this only for low-risk work completed directly; create a normal workplan for +anything needing analysis, design, approval, dependencies, or multiple phases. + +**Frontmatter:** + +```yaml +--- +id: JSUI-WP-NNNN +type: workplan +title: "..." +domain: infotech +repo: testdrive-jsui +status: proposed | ready | active | blocked | backlog | finished | archived +owner: codex +topic_slug: ... +created: "YYYY-MM-DD" +updated: "YYYY-MM-DD" +state_hub_workstream_id: "" # written by fix-consistency — do not edit (legacy name; holds the workplan id) +--- +``` + +Use `proposed` for a new draft, `ready` after review against current repo +state, and `finished` after implementation. `stalled` and `needs_review` are +derived health labels, not frontmatter statuses. + +**Task block format** (one per `##` section): + +``` +## Task Title + +` ` `task +id: JSUI-WP-NNNN-T01 +status: wait | todo | progress | done | cancel +priority: high | medium | low +state_hub_task_id: "" # written by fix-consistency — do not edit +` ` ` + +Task description text. +``` + +Status progression: `todo` → `progress` → `done`; use `wait` for waiting/blocked work and `cancel` for stopped work. + +To create a new workplan: +1. Write the file following the format above +2. Run `statehub fix-consistency` locally; ask the operator only if the CLI or + State Hub API is unavailable. diff --git a/INTENT.md b/INTENT.md new file mode 100644 index 0000000..fd37666 --- /dev/null +++ b/INTENT.md @@ -0,0 +1,20 @@ +# INTENT.md + +## What this is + +TestDrive-JSUI is a JavaScript-first, standalone markdown editor and UI library. It provides interactive, section-based markdown editing that runs in any browser without a backend, depending only on `marked.js` for parsing. Python (and planned Ruby/Java) adapters are optional integration helpers for asset serving and backend hookup — they are not required for core functionality. + +## Why it exists + +Originally built as a capability inside the MarkiTect project, it has completed a full migration to being the single source of truth for markdown-editing UI (legacy copies removed from the host app). It is now being prepared for standalone distribution as an npm package (bundling via Rollup, dual CJS/ESM/UMD output, browser test coverage). + +## Current focus + +- Finishing NPM publication readiness (see `TODO.md` / `NPM_PUBLICATION_PLAN.md`) +- Verifying bundle formats via browser test files +- Establishing CI (Forgejo smoke workflow) as an enablement template + +## Boundaries + +- Core logic lives entirely in JavaScript (`js/`); language adapters must not carry functional logic, only integration glue. +- No hard dependency on any specific backend or framework. diff --git a/SCOPE.md b/SCOPE.md new file mode 100644 index 0000000..e0cee4e --- /dev/null +++ b/SCOPE.md @@ -0,0 +1,38 @@ +# SCOPE + +> This file was generated by `statehub register`. Refine it as the repository +> boundaries become clearer. + +## One-liner + +TestDrive-JSUI is a standalone, JavaScript-first markdown editor and UI library (with an optional Python integration adapter) that is being packaged for npm distribution. + +## Core Idea + +testdrive-jsui exists to provide the capability described in INTENT.md. + +## In Scope + +- Standalone JavaScript markdown editor core (js/testdrive-jsui.js) +- Section-based editing, edit/view modes, theming +- Rollup build producing CJS/ESM/UMD bundles for npm distribution +- Jest test suite for JS components, controls, and utilities +- Optional Python adapter for asset serving / backend integration and Python-JS test bridging +- CI smoke workflow (Forgejo) + +## Out of Scope + +- Providing backend/server functionality (adapters only assist, they don't own core behavior) +- Ruby/Java adapters (planned, not implemented) +- MarkiTect application logic outside the editor capability +- General-purpose WYSIWYG editing beyond markdown/section model + +## Current State + +- Functional JS-first markdown editor library (v1.0.0) with Rollup bundling, Jest tests, and an optional Python adapter; recently completed a migration to a single-source capability layout and is mid-way through NPM publication prep (per TODO.md) with a new CI smoke workflow just added. + +## Getting Oriented + +- Start with: INTENT.md +- Agent instructions: AGENTS.md +- Workplans: workplans/ diff --git a/workplans/JSUI-WP-0001-statehub-bootstrap.md b/workplans/JSUI-WP-0001-statehub-bootstrap.md new file mode 100644 index 0000000..b6e928c --- /dev/null +++ b/workplans/JSUI-WP-0001-statehub-bootstrap.md @@ -0,0 +1,59 @@ +--- +id: JSUI-WP-0001 +type: workplan +title: "Bootstrap State Hub integration" +domain: infotech +repo: testdrive-jsui +status: ready +owner: codex +topic_slug: custodian +created: "2026-07-08" +updated: "2026-07-08" +state_hub_workstream_id: "a5b3a5bc-9f84-4227-9e19-d7962f56b35b" +--- + +# Bootstrap State Hub integration + +TestDrive-JSUI is a standalone, JavaScript-first markdown editor and UI library (with an optional Python integration adapter) that is being packaged for npm distribution. + +## Review Generated Integration Files + +```task +id: JSUI-WP-0001-T01 +status: todo +priority: high +state_hub_task_id: "38e4aa05-9029-44cc-aba0-143c73b30a22" +``` + +Review `INTENT.md`, `SCOPE.md`, `AGENTS.md`, and `.custodian-brief.md`. +Replace generated placeholders with repo-specific facts where needed. + +## Verify Local Developer Workflow + +```task +id: JSUI-WP-0001-T02 +status: todo +priority: high +state_hub_task_id: "c88f1cf4-54da-4874-8b1e-690becea0ede" +``` + +Identify the repo's install, test, lint, build, and run commands. Add or refine +those commands in the agent instructions so future coding sessions can verify +changes confidently. + +## Seed First Real Workplan + +```task +id: JSUI-WP-0001-T03 +status: todo +priority: medium +state_hub_task_id: "cea89446-78af-415e-b0b5-cab8d75f66b6" +``` + +Create the first implementation workplan for the repository's most important +next change. After workplan file updates, run the sync locally from this repo +checkout: + +```bash +statehub fix-consistency +```