Files
marqdo-view/CHANGELOG.md
T
Marqdo View a802f96b6e
ci/woodpecker/push/woodpecker Pipeline was successful
feat: migrate View 0.3.0 to marqdo 3.0.0-rc.4 contracts
Replace the retired rc.2 Analysis v2/Trace v2/Execution Events v1 stack with the
single current contract family:

- Analysis v3 (ADR-0069 public boundary): one check --emit artifact carries the
  exact source, Markdown AST, heading scopes (heading_span + complete span),
  anchors, state-bearing references, calls, resources and diagnostics; the old
  revision-3 shape is rejected with a rebuild hint.
- Observation v1: one run/call --output jsonl stream (+ atomic
  --observation-file snapshot) decoded by one decoder and projected into the
  reader/SSE/export layers; stale/malformed/truncated/incomplete never render
  as success.
- CLI Tool revision 1: requires {api_revision:1, analysis:3, observation:1},
  product range >=3.0.0-rc.3,<4.0.0, only MARQDO_BIN and
  MARQDO_API_REVISION are consumed.
- Remove compatibility branches, retired flags/env vars and duplicate decoders;
  re-record Analysis v3 and Observation v1 fixtures; rewrite contract,
  integration and security tests (173 passing locally).
- Add check-no-legacy/check-docs/check-observation gates, rc.4 pins in the
  CI pipelines, 0.3.0 Tool bundle and evidence manifest support.

See issues #4, #5 and #6; acceptance baseline is CLI source
452e9a32bd9e40dba427d4180691c58bab74449e, archive
9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8.
2026-11-25 21:58:15 +08:00

344 lines
20 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Changelog
All notable changes to `marqdo-view` are documented here. The format follows
Keep a Changelog and the project uses SemVer for the View product version.
The current public protocol axes are versioned separately by the CLI: CLI Tool
revision 1 (`api_revision` 1), Analysis revision 3 and Observation revision 1.
`0.3.0` is the one-step migration to the current pre-release contracts of
`marqdo 3.0.0-rc.4`. There is no compatibility layer for the retired formats:
old code paths, fixtures and documents were replaced, not branched.
## [0.3.0] - 2026-11-25
### Added
- CLI Tool revision 1 manifest: `tool.json` now declares exact
`requires {api_revision: 1, analysis: 3, observation: 1}` with no
`compatibility` field; the bundle release info records the same `requires`
plus product range `>=3.0.0-rc.3,<4.0.0`.
- Observation v1 consumption: `run`/`call --output jsonl` is the live source and
`--observation-file` publishes the equivalent atomic snapshot. One decoder
validates schema/revision, `run_id`, contiguous `seq`, unique terminal event,
`observation.truncated`, source binding, module identity and UTF-8 half-open
spans. View SSE forwards/summarises the protocol sequence; it never
renumbers, reorders or synthesises events.
- Analysis v3 consumption through the ADR-0069 public boundary: one
`check --emit` artifact carries exact `source`, Markdown `document`, heading
scopes (`heading_span` + complete section `span`), `anchors`, functions,
imports, calls, resources, diagnostics and state-bearing references.
`inspect --ast` is no longer a machine source for rendering.
- Reference states `resolved`, `not_loaded`, `missing`, `ambiguous`, `external`,
`outside_scope` and `invalid`; `not_loaded` is rendered as "未核验", never as a
broken link, and `ambiguous` lists candidates instead of silently choosing one.
- `scripts/check-no-legacy.sh` (G01): fails on any retired protocol name,
retired run/call argv, Tool negotiation/migration, dual-state/fallback branch
or `schema_version` use in the reader across `src/`, `tool.json` and current
docs. Historical evidence and ADRs are exempt.
- `scripts/check-docs.sh` (G12): README/COMPATIBILITY/CHANGELOG/STATUS/ACCEPTANCE
must describe the rc.4 baseline; old CHANGELOG entries are allowed only under
the explicit `## History` heading.
- `scripts/check-observation.py`: machine probes for stream/snapshot
equivalence, truncation, exact Analysis binding and fail-closed retired input.
- `docs/architecture/observation-v1-and-analysis-v3.md`: final layering
(CLI adapter → decode/validate → domain projection → reader/execution/SSE/
export) with no version branch outside protocol modules.
- ADR-0012 records the rc.3 → rc.4 supersession: issue #5's rc.3 baseline is
superseded by issue #6's rc.4 public Analysis boundary; evidence pins the
rc.4 source/archive/binary SHAs.
### Changed
- Frozen CLI pin moved to `marqdo 3.0.0-rc.4`: source
`452e9a32bd9e40dba427d4180691c58bab74449e`, archive
`9c3f166b5e5b8840d39d10019074e4e1c42432fc23e26c69670e64fdcf4e15d8`, binary
`a7306962689c635445a59043971ea2eb09298e01feeee81f0ba07b1f3e10306e`.
- Acceptance manifest replaced by the issue #5 §0 schema
`marqdo.view.acceptance` revision 1: SHA-256-prefixed identities, frozen CLI
product/source/archive/binary, gates G01–G12 with
`state/command/exit_code/log`, and an explicit `unverified` list. A gate that
has not run is never recorded as PASS.
- Scripts (`frozen-beta`, `package`, `install-smoke`, `check-examples`,
`gen-golden`, `acceptance`, `test-*`, `acceptance-run.py`,
`test-complete-reader.py`) use the current flags and report the current
contracts; golden data moved to Analysis revision 3 and Observation revision 1
stream/snapshot fixtures.
- CI (`.github/workflows/ci.yml`, `.woodpecker.yml`) pins rc.4 through
`scripts/frozen-beta.sh` and adds a distinct blocking no-legacy job that runs
G01 and G12 before quality and acceptance.
- README, COMPATIBILITY, STATUS, ACCEPTANCE, CONFORMANCE and the frozen-CLI
contract audit now describe the current behavior; 0.2.0 material is marked
historical.
### Fixed
- Values are never fabricated: the protocol supports explicit
`--observe-variable`/`--observe-parameter` (Text needs `--observe-text-values`),
but View 0.3.0 requests none by default and never displays memory or handles.
- Truncated or incomplete observation transport is displayed as
`TRUNCATED`/`未完成`, never as success. `UNSUPPORTED`, `PARTIAL` and `WARN`
are never written as `PASS`.
## History
## [Unreleased]
- Read safe project-local images, standard Markdown fragments and equations rendered as offline MathML.
- Consume Analysis v2/v3 and stream source-bound Execution Events v1 from the published RC.2 Core.
- Call functions beside their headings and inspect the current result inline.
- Download one selected, session-owned result as a script-free static ZIP after reviewing the included fields. Ordinary export retains its document-only behavior.
## [0.2.0] - 2026-11-22
### Fixed during issue #2 acceptance
- Terminate the HTTP/1.1 SSE body after the terminal frame, including a
replayed terminal frame. Preserve View Run Events v1 and flush every frame.
- Verify Chromium reconnects with the received event ID without resubmitting
the run. Exercise the installed Tool's Int, Unicode Text and List controls.
- Pin the official Beta archive in CI. Run the installed Tool, browser trace,
no-side-effect and artifact integrity checks in the acceptance gate.
### Added (RFC-VIEW-0002 PR-05)
- Trace v2 evidence binding hardened end to end: the SSE trace summary carries
per-event `source_id` only for verified entry-module spans, observed chips are
marked `data-annotation-source="trace"`, static anchors
`data-annotation-source="analysis"`, and grouped chips collapse >3 events per
anchor with a real count in `title`.
- Stale/invalid/truncated Trace semantics covered by tests: editing source during
a run yields `stale=true` with all anchors/source ids null; a mismatched Trace
digest yields `trace.status=invalid` while the run still succeeds; truncated
traces are reported without claiming complete coverage.
- ADR-0010 records the annotation/staleness strategy (inline keyed chips instead
of SVG curves, per RFC §4.4's allowed degradation).
- Browser regression at the RFC width matrix incl. 2048x1133, provenance/grouping
assertions, dark-theme run screenshot; evidence in `docs/evidence/PR-05/`.
### Added (RFC-VIEW-0002 PR-04)
- `src/server/{mod,routes,security,sse}.rs`: the fixed 7-route Live API with one
explicit execution entry. Removed `/api/health`, `/api/document`,
`/api/run` and `/api/clear-run`.
- SSE transport writes the `text/event-stream` response directly to the socket
and flushes every frame/heartbeat (tiny_http's chunked writer would delay
frames); heartbeats, `Last-Event-ID` replay, authoritative snapshots, 128-event
ring, terminal close and a max of two observers per run.
- Per-session `HttpOnly; SameSite=Strict` cookie + per-session CSRF token
(`X-View-CSRF`), exact same-origin `Origin`, loopback `Host` validation,
`Sec-Fetch-Site` cross-site rejection, JSON-only bounded run POSTs (64 KiB).
- Reader front-end now runs through one POST + EventSource: target form built
from Analysis signatures, text-only command preview, pure/project mode with
explicit fs read/write globs and second confirmation, cancel button, live
result/stdout/stderr/Trace panel, keyed source anchors (skipped when stale),
and no status polling. Run shell is hidden until an explicit run.
- New `tests/security/` suite (cookies/CSRF/CORS/symlink/Markdown/SSE session
isolation) and rewritten HTTP/SSE integration tests; browser suite updated for
EventSource, dark theme and the RFC width matrix (incl. 2048x1133).
- ADR-0009 records the SSE transport, session model and route decisions; evidence
in `docs/evidence/PR-04/` includes real Chromium logs/screenshots and a real
frozen-CLI run (285 Trace v2 events).
### Added (RFC-VIEW-0002 PR-03)
- Execution layer: `src/execution/{request,process,controller,events}.rs`.
- request validation per §6.3 (size/path/target/parameter/mode/fs grants) and
exact `function_id` -> CLI name resolution from Analysis v2;
- one cancellable process adapter (explicit argv, process group,
SIGTERM→2s→SIGKILL, bounded stdout/stderr, spawn hook, wall clock); the
CoreClient now uses the same adapter for `check`/`--version`;
- single active job, `client_request_id` + payload digest idempotency/409,
unique terminal states, cancellation, 128-event ring buffer with
`Last-Event-ID` replay/snapshot, and `marqdo.view-run-events` v1 frames;
- Trace v2 verification against the exact pre-run Analysis bytes with safe
event summaries; missing/invalid trace is reported without faking evidence.
- Explicit budgets on every run/call (`--fuel`, `--max-output`, `--timeout`,
trace limits) plus 4 MiB JSON/Trace bounded reads and `view.output_limit`.
- New `--run-timeout` option clamped to 1..=120 seconds (default 30).
- ADR-0008 records lifecycle/cancel-race/Trace-missing semantics.
- Tests: `tests/integration/execution.rs` with a real fake-Core executable
(accepted/running/terminal SSE-ready events, call argv, dedupe, busy, cancel,
session isolation, stale digest, grants, unavailable trace).
### Changed (RFC-VIEW-0002 PR-02)
- Restructured the crate into the RFC-VIEW-0002 §5.3 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 and `app.rs`/`project.rs`/`semantic.rs`/`trace.rs`/`document.rs`/
`presentation.rs`/`source_map.rs`/`render.rs`/`assets.rs` are gone.
- Replaced `GET /api/document` with the read-only `GET /api/documents`
(documents list + current outline/function/analysis summary).
- Reading UI: removed variable/memory placeholder menu entries (one explicit
"unsupported capability" explanation remains), added a simple dark theme
toggle with a single token override layer and persisted preference.
- Reorganized tests into Cargo `[[test]]` suites: `tests/contract/` (CLI/Tool/
Analysis/Trace/coupling/assets) and `tests/integration/` (Live HTTP/renderer/
Unicode/export); `tests/fixtures`, `tests/golden`, `tests/browser` unchanged.
### Changed (RFC-VIEW-0002 PR-01)
- View product version is now `0.2.0` (`Cargo.toml`, `tool.json`, binary
`--version`), still independent from the CLI product version.
- Scripts moved from `tools/` to `scripts/` per RFC-VIEW-0002 §5.3; added
`scripts/verify-frozen-cli.sh` (records version/SHA and fails if the frozen
CLI changes across a command sequence).
- Added `.github/workflows/ci.yml`: quality lane (fmt/clippy/test/build) plus a
frozen-CLI acceptance lane that verifies the release archive SHA, runs the
one-command acceptance and uploads evidence. `.woodpecker.yml` updated to the
new script paths.
- Tool v1 packaging now emits `0.2.0`; install/dispatch/tamper behaviour is
re-verified against the frozen `3.0.0-beta.1` CLI.
### Added (RFC-VIEW-0002 PR-06)
- Five RFC §13.3 example documents at `examples/{welcome,branch-loop,
function-params,knowledge-only,unsafe-side-effect}.mq.md` plus explicit
`examples/view.json`; all are checked with the frozen CLI and recorded via
`scripts/check-examples.sh` (double(5)=Int 10, branch-loop=Int 0 with
loop/return Trace, knowledge-only has no main, unsafe-side-effect writes only
with explicit project grants).
- `scripts/test-no-exec.sh`: opens/lists/searches/reloads/exports the
unsafe-side-effect document, hashes every example source and the lock file,
asserts no write sentinel appears and that exported HTML contains no run
controls, CSRF material or external URLs.
- Static export no longer renders run controls: no run Dock button, no run tab,
no call buttons and no run dialog; only settings/more remain offline.
- `scripts/acceptance.sh` extended with `examples_check` and `no_exec_suite`
gates and refreshed evidence manifest schema (`tests.examples`, `tests.no_exec`).
- Final documentation closure: `docs/ACCEPTANCE.md` rewritten against
RFC-VIEW-0002 §9/§10, STATUS/CONFORMANCE/README/COMPATIBILITY updated, final
evidence manifest generated from the frozen CLI release (CLI SHA unchanged).
### Changed (RFC-VIEW-0002 PR-00)
- Adopted `docs/architecture/RFC-VIEW-0002.md` as the sole implementation
baseline for execution, scope, SSE, UI routes and release gates; RFC-0001 is
archived as historical design (ADR-0007).
- Moved specs to `docs/architecture/` and decisions to `docs/decisions/`.
- Added `docs/audits/legacy-view.md` (static legacy evidence with
`KEEP_ASSET/REIMPLEMENT/DROP/UNKNOWN` decisions and `LEGACY_RUNTIME_UNVERIFIED`
declaration), `docs/audits/protocol-contract-0002.md` (frozen CLI black-box
contract), `docs/CONFORMANCE.md` (living RFC-VIEW-0002 matrix) and refreshed
`docs/STATUS.md` with the remaining 0002 gaps.
- No source behaviour changed in this step; the tracked 0001 implementation is
unchanged and still passes its tests while PR-02..PR-06 migration proceeds.
### Added
- PR-00: legacy View static audit (`docs/audits/legacy-render-paths.md`), visual
tokens, run-state matrix, ADR-0001/0002, MIT/Apache-2.0 licensing, STATUS.
- PR-01: single Rust package with a testable library boundary; `marqdo-view`
CLI (`browse`, `export`, `verify`) owned entirely by View; Tool Protocol v1
manifest (`tool.json`) and packaging/install smoke scripts.
- PR-01: `PublicCoreClient` over `MARQDO_BIN` with explicit argv arrays, private
0700 scratch artifacts, wall-clock timeout that kills the whole process group,
product-range and protocol negotiation, and stable `view.*` error codes.
- PR-01: `verify` command/use case that checks CLI version, Analysis v2 schema,
Markdown profile, project identity and exact source digest without executing.
- PR-01: contract tests with a real fake-core executable (argv, exit codes,
stderr preservation, missing emit, timeout, invalid JSON) and architectural
coupling gates.
### Added (PR-02)
- Reader-oriented `DocumentModel` over the frozen `marqdo.md.v1` Comrak profile:
headings, GFM tables/task lists, blockquotes, code fences, math literals,
exact UTF-8 byte spans, source line index.
- Typed `SemanticProjection` with full Analysis v2 validation: schema/product/
profile checks, project identity, exact `source_digest`, unit/function/
statement/resource/import/reference/call/diagnostic projection and
per-span UTF-8 boundary validation with explicit warnings.
- One `PresentationModel` + one `ReaderRenderer`; Live and Export share the same
bytes and differ only by `LinkPolicy` and control availability.
- Single `assets/reader.css` + `assets/reader.js` theme (layered tokens, warm
paper, serif prose, gold/olive semantics, source pane, dialogs, responsive,
print, reduced motion) and `src/assets.rs` SHA-256 asset bundle.
- Local Live reader: loopback Host validation, strict request limits,
single-pass percent decoding, safe project paths, CSP/security headers,
read-only `/`, `/file`, `/assets/*`, `/api/document`, `/api/health`.
- `AppContext` degradation: missing core → prose-only with `CORE_UNAVAILABLE`;
failed check → diagnostics + revoked semantics; protocol mismatch → hard error.
- Examples (`welcome`, `mixed-modes`, `control-flow`, `tables-math`,
`diagnostics`) and real Analysis v2 goldens generated from the frozen CLI.
- Tests: rendering contracts, XSS/URL sanitization, Live/Export link parity,
raw HTTP server security tests, asset integrity, architectural gates.
### Added (PR-04)
- `trace.rs`: Trace v2 validation (schema/product, `analysis_digest`,
`root_id`, module references, strictly increasing seq, span bounds) and
projection with explicit `NOT_RUN/STATIC_ONLY/RUNNING/SUCCEEDED/FAILED/
STALE/TRUNCATED/UNSUPPORTED` states.
- Explicit-run flow: in-page confirmation, CSRF token + strict Origin check,
JSON body limits, one active run per session, `pure`-only mode, process-group
timeout, run cache keyed by validated Analysis digest.
- Server-rendered run panel (stdout/stderr escaped, Core error code, public
final value only, event list capped with explicit truncation) and inline
run chips anchored to real statement spans; never per-assignment values.
- Real Trace v2 goldens from the frozen CLI (success, truncated, failed arity)
and contract/HTTP tests proving refresh never runs and rejected requests
never spawn a process.
- ADR-0004 for the run/CSRF/cache design.
### Added (PR-03)
- Browser acceptance harness (`tests/browser/reader.browser.cjs`,
`tools/test-browser.sh`) against real Chromium + the frozen core: single
CSS/script, no external requests, no console errors, document/source switch,
search, settings, 7 viewport widths without horizontal overflow or dock
clipping, no-JS reading, print mode, explicit run + clear.
- Screenshot evidence for the Welcome page (1664×920, 390×844) and a real
Trace run page in `docs/evidence/0001-pr03/`.
- Meta CSP no longer carries the ignored `frame-ancestors` directive (the HTTP
header still enforces framing).
### Added (PR-05)
- Static export (`marqdo view export PATH --out DIR`) through the same
`ReaderRenderer`: `index.html` + `pages/<relative>.html` + hash-named assets +
`manifest.json` (relative paths, per-file SHA-256, protocols, `executed:false`).
- Pure read-only guarantee: export never calls Core `run`, never writes into the
project root, never overwrites unrelated non-empty directories; staging +
atomic rename, previous successful export replaced safely.
- Offline by construction: same embedded asset bytes, data-URI images, no remote
fonts/CDN; relative internal links; `--no-annotations` hides semantic anchors
without changing prose.
- HTTP hardening: bounded concurrent requests (503 beyond 32), detail-free
public error JSON/pages (no absolute paths or subprocess text), 30s page check
budget.
- `tools/test-export.sh`, `tools/test-security.sh`, adversarial browser fixture
(`tests/fixtures/security-project`) proving no script execution and no
external requests; `tests/export.rs` export contracts; ADR-0005.
### Added (PR-06)
- `tools/acceptance.sh`: one-command RFC §18.1 acceptance running the frozen CLI
from the release archive in an isolated tool home (fmt/clippy/test/build,
bundle, archive install, view help/verify/export, Live browse, explicit
CSRF-confirmed real run, export/security/browser suites, CLI SHA check) and
generating `docs/evidence/<CLI-SHA>/manifest.json` from real exit statuses.
- `tools/test-contract.sh`, `.woodpecker.yml` (code/contract/export/browser/
release-bundle lanes; remote CI execution not verified).
- `docs/ACCEPTANCE.md` gate table, `docs/audits/protocol-conformance.md`,
ADR-0006 (documented RFC deviations), final README/STATUS/COMPATIBILITY.
- Unicode/CRLF/duplicate-text goldens and `tests/unicode_spans.rs` (S-04);
`tests/presentation_states.rs` degradation matrix (S-05..S-07); hostile
stdout escaping test (X-05); keyboard accessibility browser checks (U-03).
### Known limitations
- First Beta: run is `pure`-only; project/strict grants UI, SSE streaming,
cancellation and multi-run history are not implemented.
- Variables/memory/proof states remain `UNSUPPORTED`; debugger/Notebook are
non-goals.
- No incremental export or multi-project site; one project per invocation.
- Pixel-level comparison with the reference screenshot remains manual
UNVERIFIED; SVG curve side notes are not implemented (inline keyed chips).
- Remote CI is not executed in this environment; `.woodpecker.yml` is provided
and local acceptance evidence is complete.
- `project`/`strict` grant UI, streaming output, cancellation and debugger are
not implemented; variables/memory/proof states remain `UNSUPPORTED`.
- Pixel-level comparison with the reference screenshot remains a manual
UNVERIFIED item; automated geometry/DOM/network/print/no-JS checks pass.