Repository navigation
figmog first pass - #1
Merged
Merged
Conversation
Cuts per spec §4: deletes src/bench.rs + src/repl.rs (corpus generator,
load-test demo, and interactive REPL go with them) and Cmd::Watch/
cmd_watch (serve owns sync via its own poll loop; the shared Watcher/
Tick/pull_failure_wait/BACKOFF_* machinery sessions.rs and serve.rs use
stays). Removes the global --json flag: every read command now prints
its query::* Value via serde_json::to_string_pretty unconditionally,
and errors are always {"error": ...} JSON on stderr. Post-cut dead-code
sweep removes the two pub(crate) helpers that lost their only caller
(UreqApi::file_nodes, cli::read_watermark). README gets a surgical pass
to strip now-false bench/REPL/watch/--json mentions (full rewrite is a
later task).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Spec §4's hardening ledger: honest variable_edges dedup comment (no adjacent-only dedup_by), merge_registry drops upstream tools matching any actual local tool name (not just the figmog_ prefix), cache::store surfaces serialize errors as Result (propagates as tool isError), wrong-type tool args report "expected <type> for `key`, got <type>" instead of "missing required field", --interval clamps to a one-day max so Instant + huge Duration can't overflow-panic, serve's stdout frame write tolerates a vanished client (clean exit 0, no broken-pipe panic), pub mod serve -> pub(crate) mod serve fixes the visibility mismatch and clears the 4 private-intra-doc-link warnings from Task 2, flatten.rs's obj_map borrows instead of cloning every envelope Value, and the README gains an interim Tier-3 multi-file poll-budget note. serve.rs's is_local_tool-above-rtx ordering was already correct pre-migration — no change needed there (see task-3-report.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…imal pub surface
Pillar-2 review fixes:
- open_store_checked suppresses the default panic hook around
catch_unwind so stderr is JSON on every path, including a panic: a
Locked panic still returns the existing friendly error, any other
panic emits {"error": "internal panic: ..."} and exits 101 directly
(controller ruling, supersedes restore-before-resume). Strengthened
the e2e regression test to parse the full stderr buffer as JSON
instead of a substring check.
- New write_json() helper (writeln! + flush, broken pipe -> silent exit
0 via a STDOUT_CLOSED sentinel) replaces five panic-on-broken-pipe
println! call sites; new e2e test proves a reader that closes
mid-write gets a clean exit 0, not a panic.
- Shrunk the public module surface (api/ident/mcp/query/upstream/watch
-> pub(crate)) and let --all-targets clippy surface real dead code:
FakeUpstream is now #[cfg(test)]-only (its "other test binaries can
drive it" doc claim was false) and Tick::Changed's unread
last_touched_at field is dropped.
- canonical_args propagates serialize errors instead of collapsing to
"" (distinct calls must never share a cache key); merge_registry now
also drops a second upstream tool that duplicates an already-accepted
upstream name; lib.rs's stale doc link points at docs/history/.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Splits src/cli.rs (1.4k lines) into src/cli/{mod,pull,read,call}.rs as
pure moves (clap types/dispatch/run/write_json/open_store_checked in
mod.rs; pull/do_pull/PullError/current-file helpers in pull.rs; the 16
read-only query commands in read.rs; tools/call/import-variables in
call.rs), tightening pub(crate) to pub(super) wherever a helper is only
needed inside the cli subtree. Adds docs/SPEC.md, a consolidated
current-state spec verified against src/ (architecture, data model,
pipeline/sinks, sync/sweep, serve multi-file/watch/MCP, the cached
proxy, variables, CLI surface, determinism contracts) superseding
docs/history/*'s version archaeology. Rewrites README.md per the
standalone-repo spec: install from GitHub Releases (tarball, chmod,
macOS quarantine note, unsigned-binary limitation) plus build-from-
source, the fold-license sentence, corrected `-p figmog`-free command
examples, and limitations reorganized around variables/desktop-proxy/
polling/single-writer. Adds CLAUDE.md (determinism, frozen schema, fold
never vendored, gates, no new deps without justification, synthetic
fixtures, plus a fold-pin-bump checklist entry and the empty
[workspace] table's rationale, also commented in Cargo.toml itself).
Also folds in the deferred debt-ledger minors this same restructuring
touches: a cache-write failure now logs to stderr and still returns the
successful upstream result instead of failing the call (proxy.rs);
PullError moves to a thiserror derive; `figmog tools` no longer opens
the store or requires a resolved mirror (dispatched before resolve_db,
like serve); output-shape e2e tests for `tools`/`import-variables`;
`pub(crate) mod serve` drops the redundant pub(crate) (already
crate-wide from the root); open_store_checked's doc comment gains a
parallel-test panic-hook race note.
138 -> 142 tests. cargo test/clippy --all-targets -D warnings/fmt
--check/doc --no-deps all green on both feature configs.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deferred from the T4 ledger alongside the [workspace]-table comment: a one-line explanation of why .superpowers/ (per-worktree SDD planning state) is gitignored, so the entry doesn't read as an unexplained leftover. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
§4 said the pipeline wires records into "eight" terminal sinks; the table right below it (and store.rs's figmog_pipeline!) shows 14. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Task 1 of the figmog standalone migration (spec:
docs/history/2026-08-16-figmog-standalone-repo.md, plan:docs/history/2026-08-16-figmog-migration.md): imports figmog fromsanctuarycomputer/clogbranchworktree-figmog(PR #1, commit bf9fc05) as a standalone crate at repo root.src/,tests/,README.mdmoved wholesale fromexamples/figmog/— verified byte-identical via tree diff against the source branch.Cargo.tomlrewritten standalone:figmog 0.0.1, edition 2024, license MIT;foldswitched from a path dependency to a pinned git dependency:fold = { git = "https://github.com/flowercomputers/bogkit", rev = "20f2ca50d5d06f51edfe8b8570c0fb48caf9eb81" }(pre-verified source-identical to our in-repo fold). All other deps/dev-deps carried over unchanged (serde, serde_json, ureq, clap, thiserror; dev: tempfile, assert_cmd, postcard).LICENSE(MIT, sanctuary computer),.gitignore(target/, .figmog/, .superpowers/) added.docs/history/holds the old figmog build-design spec, the standalone-repo spec, and all figmog plan docs, verbatim, for reference. No other clog docs migrated.[profile.dev] opt-level = 3carried over from the old workspace profile (needed for e2e test perf).Gates run at the new crate root:
cargo test(162/162 passing, first run against the git dep — proves the pin is faithful),cargo clippy --no-deps -- -D warnings(clean),cargo fmt --check(clean).mainwas seeded separately with an init commit (LICENSE + stub README) before this branch was pushed, per the migration plan's PR-flow mechanics.Upcoming (this PR will absorb further commits from the migration plan)
cli.rsmodule split,docs/SPEC.mdconsolidation, standalone README rewrite, new-repo CLAUDE.mdv0.0.1as a published pre-releaseTest plan
cargo test— 162 passed, 0 failedcargo clippy --no-deps -- -D warnings— cleancargo fmt --check— cleansrc/andtests/againstworktree-figmog:examples/figmog/{src,tests}— empty (pure move)🤖 Generated with Claude Code