feat: add material asset workspace

This commit is contained in:
user
2026-04-26 18:52:16 +09:00
parent 7866f6dcb3
commit b570c93d94
12 changed files with 381 additions and 17 deletions

View File

@@ -0,0 +1,28 @@
# Phase 9 Context: Material and Asset Workspace
**Status:** Ready for execution
**Started:** 2026-04-26
## Goal
Expose material ingestion, ontology inspection, and teaching asset prompt
candidate generation in the web app.
## Requirements
- WEB-05: Operator can ingest source material from the web app.
- WEB-06: Operator can inspect ontology candidate concepts, edges, and gaps.
- WEB-07: Operator can generate and inspect teaching asset prompt candidates.
- WEB-08: Web UI includes loading, empty, and error states for the MVP flows.
## UX Direction
Keep content operations as a secondary workspace below the diagnostic answer
surface. The operator flow should show provenance and candidate status without
turning the page into an admin dashboard.
## Out of Scope
- Full ontology editor.
- Human review promotion controls.
- Actual image generation.

View File

@@ -0,0 +1,34 @@
# Phase 9 Plan: Material and Asset Workspace
**Status:** Ready for execution
**Phase Goal:** Let operators use ontology and teaching asset prompt workflows
from the web app.
## Tasks
### 1. Add material ingestion UI
- Add title/source/body fields.
- Call material ingestion API.
- Show loading and error states.
### 2. Add ontology inspection UI
- Render concept, edge, and gap counts.
- Show candidate concept labels and review states.
- Populate asset concept selector.
### 3. Add teaching asset prompt UI
- Generate prompt candidate for selected concept and asset type.
- Show prompt text, model key, review state, and verification guard.
### 4. Verify
- Update tests for content-operation frontend wiring.
- Run Go tests, OpenSpec validation, line-count check, and smoke.
## Out of Scope
- Real image generation.
- Ontology graph editor.

View File

@@ -0,0 +1,20 @@
# Phase 9 Research: Material and Asset Workspace
## Findings
The existing APIs are sufficient for a browser proof:
- `POST /api/v1/materials`
- `GET /api/v1/ontology`
- `POST /api/v1/teaching-assets/prompts`
- `GET /api/v1/teaching-assets`
The frontend should make candidate state obvious and preserve evidence in
compact text. A full graph canvas would be premature.
## Recommendation
- Use a text ingestion form.
- Render candidate concepts as selectable options for asset prompt generation.
- Show counts for concepts, edges, gaps, and prompts.
- Show model verification guard in the generated prompt output.

View File

@@ -0,0 +1,35 @@
# Phase 9 Summary
**Status:** Complete
**Completed:** 2026-04-26
## Delivered
- Added material ingestion workspace to the web app.
- Added ontology candidate summary with concept, edge, and gap counts.
- Added candidate concept selector for teaching asset prompt generation.
- Added asset type selector and prompt generation UI.
- Rendered prompt text, model key, review state, evidence, and model-id
verification guard.
- Added frontend asset test coverage for teaching asset API wiring.
## Verification
```powershell
gofmt -w cmd internal
go test ./...
openspec validate frontend-mvp --strict
```
Additional smoke check:
- Static app script includes material and teaching asset API wiring.
- Material ingestion returned 4 concepts and 3 edges.
- Teaching asset prompt generation returned `asset-prompt-1` with verification
guard enabled.
## Deferred
- Browser screenshot audit because Chrome DevTools MCP timed out.
- Full ontology graph editor.
- Real image generation.

View File

@@ -0,0 +1,31 @@
# Phase 9 Verification
## Verdict
PASS
## Requirement Coverage
- WEB-05: PASS. The web app includes material ingestion UI wired to the real
backend API.
- WEB-06: PASS. The web app renders ontology candidate concept, edge, and gap
counts and candidate concept labels.
- WEB-07: PASS. The web app can generate and inspect teaching asset prompt
candidates.
- WEB-08: PASS. The MVP frontend includes loading, empty, and error states for
diagnostic, progress, material, and asset prompt flows.
## Evidence
- `go test ./...` passed.
- `openspec validate frontend-mvp --strict` passed.
- Live material ingestion and teaching asset prompt smoke passed.
- Static app script contains material and teaching asset API integration.
- Source files remain under 600 lines.
## Residual Risk
Chrome DevTools MCP timed out while opening the local page, so browser
screenshot verification is still pending. HTTP/API smoke confirms the served
assets and backend flows, but a visual pass should be repeated when the browser
tool is responsive.