Commit Graph
6 Commits
Author SHA1 Message Date
cflmy 8c00ae3ea1 fix: finish View SSE responses after terminal events 2026-11-22 20:59:12 +08:00
cflmy 0fceb40088 feat(PR-06): RFC §13.3 examples, export closure, acceptance and docs finalization
- add examples/{welcome,branch-loop,function-params,knowledge-only,
  unsafe-side-effect}.mq.md + explicit examples/view.json; all validated against
  the frozen CLI (double(5)=Int 10, branch-loop Int 0 with loop/return Trace,
  knowledge-only sem.no_entry_function, unsafe write only with explicit project
  grants) via scripts/check-examples.sh
- add scripts/test-no-exec.sh sentinel suite: browse/list/search/reload/export of
  the write fixture keeps source+lock hashes unchanged, writes no sentinel and
  produces exported HTML with no run controls/CSRF/external URLs
- static export no longer renders run controls (no run dock button/tab/call
  buttons/run dialog); only settings/more remain
- extend scripts/acceptance.sh with examples_check and no_exec_suite gates and
  extend the evidence manifest tests map
- rewrite docs/ACCEPTANCE.md against RFC §9/§10 with E01-E16/N01-N22 mapping;
  finalize STATUS/CONFORMANCE/README/COMPATIBILITY/CHANGELOG for 0.2.0
- record PR-06 evidence logs (examples, no-exec, pre-commit acceptance)
2026-11-22 14:54:23 +08:00
cflmy 807c24b952 feat(PR-05): Trace provenance annotations, grouped chips and stale semantics
- mark static anchors data-annotation-source=analysis and observed run chips
  data-annotation-source=trace with run seq/kind; group events per source anchor
  into one chip (>3 events collapse to ×N with a truthful title)
- add controller tests for source edits during a run (stale=true and all
  anchors/source ids null), mismatched Trace digest (run succeeds,
  trace.status=invalid, no events) and truncated Trace (event_budget preserved)
- ADR-0010 records the annotation/staleness strategy and the allowed inline-chip
  degradation instead of SVG curves
- extend browser suite with provenance/grouping assertions and dark-theme run
  screenshot; record PR-05 evidence (real Chromium, RFC width matrix)
- unit 63 + contract 41 + integration 43 + security 11 pass; clippy clean
2026-11-22 14:36:09 +08:00
cflmy 046834bcb6 feat(PR-04): SSE execution loop, 7-route server and session security
- replace src/server.rs with src/server/{mod,routes,security,sse}.rs implementing
  exactly the RFC-0002 §6.2 routes: GET /, GET /file, GET /assets, GET
  /api/documents, POST /api/runs, GET /api/runs/{id}/events, POST
  /api/runs/{id}/cancel; old /api/health, /api/document, /api/run and
  /api/clear-run are gone (404)
- SSE writes the event-stream directly to the socket and flushes every frame and
  heartbeat (tiny_http's chunked writer would delay frames); Last-Event-ID
  replay or authoritative snapshot, 128-event ring, terminal close, heartbeat
  comments, at most two observers per run, no polling route
- per-session HttpOnly SameSite=Strict cookie + X-View-CSRF, exact same-origin
  Origin, loopback Host, Sec-Fetch-Site cross-site rejection, JSON-only 64 KiB
  run POSTs; cancel is an authenticated bodyless control POST
- reader.js: Analysis-driven function form with text-only command preview,
  pure/project mode + explicit fs grants with second confirmation, one POST then
  EventSource, cancel, live result/stdout/stderr/Trace panel and keyed source
  anchors (skipped when stale); no innerHTML of CLI data and no status polling
- render: hidden live run shell, generic explicit-run dialog, function call
  buttons carrying Analysis function ids/params, data-analysis-digest/document
  attributes; remove the old run-confirm dialog and run-page reload path
- add tests/security/ suite, rewrite HTTP/SSE integration tests, update browser
  suite for EventSource/dark theme/RFC width matrix (incl. 2048x1133)
- ADR-0009 + docs/evidence/PR-04 with real Chromium log/screenshots and a real
  frozen-CLI SSE run (285 Trace v2 events, CLI SHA unchanged)
- unit 63 + contract 41 + integration 40 + security 11 pass; clippy clean
2026-11-22 14:30:40 +08:00
cflmy e13c1828a4 feat(PR-03): execution controller, cancellable process adapter and budgets
- add src/execution/{request,process,controller,events}.rs implementing RFC-0002
  §6.3 request validation, function_id->CLI name resolution, single-job
  lifecycle, dedupe by client_request_id+payload digest, 409 busy/conflict,
  unique terminal states, idempotent cancel and Trace v2 binding against the
  exact pre-run Analysis bytes
- route all Core subprocess spawning through one bounded, cancelable adapter
  with process-group TERM->2s->KILL, spawn hook, 4 MiB output caps and explicit
  --fuel/--max-output/--timeout/trace budgets; CoreClient check/--version reuse it
- add marqdo.view-run-events v1 event log: 128 frame ring, Last-Event-ID replay
  or authoritative snapshot, numeric seq/id, heartbeat constant
- add bounded --run-timeout (default 30s, max 120s
- add ADR-0008 (lifecycle/cancel race/trace-missing semantics) and PR-03
  evidence; execution tests use a real fake-Core executable
- unit 58 + contract 41 + integration 42 pass; clippy clean
2026-11-22 13:39:17 +08:00
cflmy 5c9a313424 refactor(PR-02): protocol/reader architecture, /api/documents and reader IA
- migrate crate to RFC-0002 §5.3 Reader layout: src/protocol/{analysis_v2,
  trace_v2,tool_v1}.rs, src/reader/{source,markdown,model,assemble,render,
  assets}.rs, src/config.rs; lib.rs is the composition root; delete app/project/
  semantic/trace/document/presentation/source_map/render/assets top-level files
- split presentation into model (types) and assemble (merge/stale/DocumentService)
- merge controlled project root/path boundary and UTF-8 byte spans into
  reader/source.rs; move view.json config to config.rs
- replace GET /api/document with read-only GET /api/documents (documents list +
  current outline/function/analysis summary) and add contract tests
- reading UI: drop variable/memory placeholder actions, keep one explicit
  unsupported explanation, add simple dark theme toggle over the single token
  layer; assert via rendering test
- reorganize tests into Cargo [[test]] suites tests/contract and
  tests/integration; record docs/evidence/PR-02
- unit 41 + contract 41 + integration 33 all pass; clippy clean
2026-11-22 13:08:09 +08:00