You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: AI-authoring mode (--author) with base-validation anti-hallucination filter (#1)
Adds 'einsiedler --author --repo <r> --base <ref> [--engine <cmd>]': an LLM
proposes fast-check invariants for changed files, and every proposal is
validated against the BASE version of the code so a hallucinated invariant
(wrong about existing behavior) is discarded before it can produce a false
signal. Surviving, base-validated invariants run against HEAD; falsifications
there are real behavior changes worth review.
Pipeline (einsiedler/author-mode.mjs): derive changed source files (core/diff),
AI-author via ask-opencode (Qwen, free/local) with ask-codex fallback and a
--engine override, parse+normalize+syntax-check the returned module, base-
validate in a clean git worktree, head-run survivors via the fast-check lane,
report fail-closed stats. Type-aware generator prompt guards the README false-
positive lesson. v2 note: marmorkrebs mutation-filter left out of this first cut.
- einsiedler/author-mode.mjs: full pipeline + pure helpers (export detection,
LLM-output extraction, import normalization, syntax check).
- einsiedler/cli.mjs: --author/--engine/--out-dir/--no-keep-authored wiring;
existing --modules/--validate unchanged.
- fixtures/author-demo/mock-engine.mjs: deterministic engine for a hermetic
smoke test (canned 3-invariant module: 1 survivor, 1 head-falsifier, 1
base-hallucination).
- test/einsiedler-author.test.mjs: pure-helper unit tests + end-to-end pipeline
smoke test (real git worktree, mock engine, asserts hallucination filtered and
HEAD behavior change surfaced, exit 2).
- README: AI-authoring section, flags, worked run, honest limitations.
- package.json lint: check author-mode.mjs + mock-engine.mjs.
0 commit comments