Skip to content

v0.3.0 — agent-first: contracts, verification machine, unattended queue, limited delivery, migration

Choose a tag to compare

@Acfufu Acfufu released this 25 Sep 23:37
· 321 commits to main since this release

v0.3.0 — agent-first

Six-milestone release (M0–M5) turning the goal loop into an agent-first runtime: humans approve contracts and boundaries, the agent plans and executes inside them, and every external action is gated, metered, and verifiable.

Added

  • Requirement contracts (ADR-0024): register a goal against an immutable contract file (lzy loop register --contract <file>; contractHash = sha256 of the bytes). The UPS approval phrase binds the contract short code; in-contract replans re-run the review gate but never re-approve. New withdrawal phrase 「撤回 <短码>」 appends an append-only withdrawal record; already-occurred external effects stay honestly recorded. Goals without a contract keep the legacy planHash gate byte-identical.
  • Project manifest: versioned lzy.project.json — six capability classes (prepare/start/check/observe/cleanup/delivery), explicit argv arrays (shell strings rejected), timeouts, env-name whitelists, root-confined write paths. lzy project check / lzy project discover.
  • Verification receipts (ADR-0025): lzy verify run executes a manifest check under a controlled executor (argv array, shell:false, SIGTERM timeout kill, env-name whitelist) and records a checksum-protected receipt bound to the candidate identity. Scope-tier reuse (lzy verify reuse) grants declared-input reuse only after a live adversarial qualification, with named conservative fallbacks. Integration verification runs real checks at the workers-wave barrier (re-anchor is not re-verification — that path is retired). CI identity (lzy verify ci) binds read-only GitHub check-run results to a sha — honest about not-current/blocked, never a silent pass.
  • Bounded queue & cumulative budget (ADR-0027): lzy queue runs multiple approved contracts serially across interruptions with a state-machine authorization gate and dispatch-transaction crash recovery (reconcile before action — never blind re-dispatch, never resetting another goal). The cumulative budget ledger binds (slug, contractHash) and never refreshes across restarts; point enforcement follows the approved approximate-limit semantics — metering absence / unpriced models / killed-inflight consumption are explicitly recorded, never counted as zero, until a human resumes.
  • Limited delivery B/C (ADR-0028): lzy delivery — merge-to-main (B) and Pages live verification (C) via per-endpoint delivery contracts riding the UPS approval channel unchanged (hook approval branch: zero changes). Merge is machine-gated on dual B∧C authorization + PR head/base drift re-check + green CI, bound to the PR head, reads back the actual merge SHA and polls CI on it. An intent ledger records identity before any external call and read-back classifies outcomes — done is final, no blind re-execution after timeouts or disconnects.
  • Complete migration machine (ADR-0029): lzy migrate preview / apply / status. Apply = backup (six legacy record families, sha256 manifest) → staging → validation → atomic switch, with .lazyzcode/state.json as the version entry written last as the commit point. Crash-safe and idempotent per task identity via a per-run journal. In-flight goals become drafts carrying authorization NONE with no scope — old approvals never escalate. A live lease/process refuses migration; a corrupt goal.json stops before any write; corrupt preserve-family records are warned and kept byte-exact. lzy update/sync never migrate automatically.
  • Knowledge routing: the zw skill splits into a ≤8 KiB resident entry plus eight per-phase recipes; the root AGENTS.md slims to ≤12 KiB with history, the decision table, and the glossary relocated. Nothing deleted — entry → recipe → cited ADR.

Verification

618/618 tests, CI four legs green (node 22/24 × ubuntu/windows), docs site builds with zero broken links (86 pages), per-milestone comparator records with final LOOP_COMPLETE attestations (M1–M5 goals), three-repo replay regression matrix (3 replays per repo, including interrupt-recovery forms).

Coverage boundary

Live evidence covers arm64 guests (Parallels VMs on an Apple Silicon host). x64 coverage follows the official ZCode download matrix (three platforms × dual arch) by documentation; the detection paths are architecture-independent (environment-based).

Upgrade

From 0.2.x: lzy update (spawns a fresh child process to deploy the new plugin payload). From older versions: manual two-step (npm i -g lazyzcode && lzy install). Requires the ZCode desktop app (logged in), Node ≥ 22, git.

Migration is always explicit: lzy migrate preview first, lzy migrate apply when you decide — update/sync never migrate for you.

Full changelog: https://github.com/Acfufu/lazyzcode/blob/main/CHANGELOG.md