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 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
marqdo-view dev 1f34daffb0 feat(PR-05): pure static export and hardened Live boundary
- export.rs: marqdo view export PATH --out DIR through the same ReaderRenderer;
  index.html + pages/<relative>.html + hash-named assets + manifest.json
- export never calls Core run; refuses output inside project root and unrelated
  non-empty dirs; staging + atomic rename replaces only prior View exports
- offline by construction: embedded asset bytes, data-URI images, relative
  links, no remote subresources; --no-annotations hides anchors only
- HTTP hardening: max 32 concurrent requests (503), detail-free public error
  JSON/pages (no absolute paths/subprocess text), 30s page check budget
- tools/test-export.sh (manifest hashes + file:// Chromium offline check),
  tools/test-security.sh, adversarial security-project browser fixture
- tests/export.rs export contracts; ADR-0005; docs updated
2026-11-22 11:52:22 +08:00
marqdo-view dev 80ce564f09 feat(PR-02): DocumentModel, Analysis v2 projection, single renderer and Live browsing
- document.rs: comrak marqdo.md.v1 parse -> DocBlock/Inline with exact UTF-8 spans
- semantic.rs: typed Analysis v2 validation (schema/profile/root_id/source_digest,
  units/functions/statements/resources/imports/references/calls/diagnostics,
  per-span UTF-8 checks with explicit view.source_span_invalid warnings)
- presentation.rs: one PresentationModel/Outline with source status matrix
- render.rs: one ReaderRenderer; sanitized GFM, statement anchors, heading mode
  badges (display-only prefix strip), source pane, docs/Live|Static link policy,
  CSP meta, no inline scripts, no raw HTML execution
- server.rs: loopback-only Live reader with Host/DNS-rebinding checks, strict
  percent decoding, project path boundary, security headers, read-only APIs
- app.rs: AppContext degradation (core missing -> prose-only, check error ->
  diagnostics + revoked semantics, protocol mismatch -> hard error)
- assets: single reader.css/reader.js + embedded SHA-256 AssetBundle, copied
  legacy logo/blossom/feather with provenance
- examples + frozen-CLI Analysis goldens + rendering/HTTP/asset/no-coupling tests
- ADR-0003 heading prefix/anchor identity; docs updated
2026-11-22 11:19:11 +08:00
marqdo-view dev 8ba20a5c67 feat(PR-01): single Rust package, Tool Protocol v1 bundle and PublicCoreClient
- src/lib.rs module layout + thin main.rs dispatcher; CLI owns browse/export/verify
- core_client: MARQDO_BIN only, explicit argv (no shell), 0700 scratch dirs,
  wall-clock timeout killing the whole process group, version/protocol negotiation
- project/source_map: canonical path boundary, SafeRelativePath, exact UTF-8
  byte <-> line/column <-> UTF-16 mapping, SHA-256 of exact bytes
- stable view.* error codes with 0/1/2 exit classes; BindDenied for non-loopback
- verify use case: Analysis v2 schema/profile/root_id/source_digest binding, no execution
- tool.json + tools/package.sh + tools/install-smoke.sh; frozen-CLI install smoke PASS
- contract tests with a real fake-core executable + architectural coupling gates
- COMPATIBILITY/CHANGELOG/STATUS updated
2026-11-22 10:33:14 +08:00