Skip to content

fix(loop): project-local state, CLI surface restore, layout/token cleanup + README overhaul - #107

Merged
huichen merged 9 commits into
mainfrom
claude/loop-hardening
Aug 6, 2026
Merged

huichen merged 9 commits into
mainfrom
claude/loop-hardening

Conversation

@huichen

@huichen huichen commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Hardening pass on the loop control plane (orchestration/loop, future-loop)
after the initial merge — project-local state, restored CLI surface, removed
reference-layout directories, identifier cleanup, and a usage-focused README.

Changes

Fixes (merge-regression audit)

  • Project-local state root: root_dir()/runtime root now resolve to
    <cwd>/.future/loop/ instead of $HOME; all goal state stays inside the
    project. Registry loading accepts both the native array and the earlier
    reference-map format (legacy goals load transparently).
  • CLI surface restored: future-loop models and future-loop diagnose
    were lost in the integration — re-added (agent list_models RPC +
    per-goal diagnostics). Goal/todo id format restored to <prefix>_<12hex>
    (matches pre-existing ids). Bootstrap onboarding todo now references the
    real future-loop status command.

Layout & naming cleanup

  • Removed .codex / .loopx reference layout: no runtime-root mirror,
    no .loopx/registry.json; ACTIVE_GOAL_STATE.md, HANDOFF.md and per-run
    history now live under <cwd>/.future/loop/goals/<id>/.
  • Identifiers renamed loopx_* → future_loop_* (schema versions,
    capability/API tokens, benchmark routes, anchors) with backward-compatible
    aliases so existing on-disk state keeps loading. CLI output has zero
    loopx mentions.
  • Attribution: README and the loop guide state that future-loop is a
    Rust rewrite of the loopx control plane, customized for FutureOS.

README / docs

  • README (EN + zh) is now usage-focused: build/install steps moved to
    docs/build-and-install.md, usage centers on the TUI (slash commands and
    shortcuts verified against tui/src/help-screen.ts), features table
    reordered with doc links.
  • New docs: docs/loop-control-plane.md (capability guide), plus zh
    translations of the build and loop guides.
  • FUTURE.md removed and gitignored.

Validation

  • 493 tests green (cargo test -p future-loop), cargo clippy --workspace --all-targets -D warnings and cargo fmt --check clean
  • Pre-existing goals (old schema tokens) load correctly; CLI smoke-tested
    (goal/todo lifecycle, models, diagnose, canary)

chenhui added 9 commits August 6, 2026 16:09
Docs and the skill promise project-local state at <cwd>/.future/loop/, but
the merged binary resolved root_dir()/runtime_root() to $HOME — a regression
from the integration (the dev-line HOME resolution won over the productized
cwd-based one). Old goals became invisible to the rebuilt binary.

- root_dir(): <cwd>/.future/loop (FUTURE_LOOP_ROOT override kept) — the
  store (registry/events/runs) is project-local again
- runtime_root(): <cwd>/.codex/loopx (FUTURE_LOOP_RUNTIME override kept) —
  reference-compatible run-history mirror also stays inside the project
- load_registry(): accept both the native array and the reference-compatible
  {"goals":[...]} map written by earlier productized builds (id→goal_id,
  repo→cwd), so existing goals load on the merged kernel

Verified: 494 tests green, clippy -D warnings + fmt clean; status now reads
the project goals (goal_da68751e143d, goal_146110e7d852) from <cwd>.
Merge audit found productized commands missing from the integrated CLI and
the id format diverged:

- gen_id: '{prefix}-<10hex>' (dev line) -> '{prefix}_<12hex>' (reference /
  productized style; matches pre-existing goal_/todo_ ids)
- onboarding todo text referenced nonexistent 'future-loop check' -> now
  'future-loop status' (every new goal got a broken suggested action)
- 'future-loop models' re-added (agent list_models RPC; lists models from
  auth.json/models.json + built-in catalog, --format json)
- 'future-loop diagnose --goal G [--format json]' re-added (decision /
  open todos/gates / projection gap / closure / recent runs)
- CLI registry now registers models + diagnose; golden test id parsing
  updated for the underscore format

Verified: 494 tests green, clippy -D warnings + fmt clean; models + diagnose
smoke-tested against the live agent.
…ct-local

Per project-local requirement: no .codex directories and no 'loopx' in
directory names. The reference-control-plane layout mirror is removed and
everything lives under <cwd>/.future/loop/:

- compat.rs: removed .loopx/registry.json (write_registry) — the store
  registry.json is authoritative; removed runtime_root mirror; write_run now
  appends per-run files into the goal state dir (<cwd>/.future/loop/
  goals/<id>/runs/); write_active_state writes ACTIVE_GOAL_STATE.md into the
  goal state dir
- main.rs: removed runtime_root()/FUTURE_LOOP_RUNTIME; sync_compat writes the
  projection into store.goal_dir(); cmd_runs + benchmark ledger use the store
  root; handoff written to the goal state dir
- handoff/project_handoff.rs, migration.rs, backfill.rs, canary/mod.rs,
  work_items/operator_inbox.rs: .codex/.loopx paths -> project-local
  (.future/loop/...); inbox base fixed (.future/loop + rel, no double dir);
  '@Loopx' mention handle -> '@future-loop'
- tests: compat layout test now asserts .codex/.loopx do NOT exist; anchor
  tests read from the goal state dir

Verified: 493 tests green, clippy -D warnings + fmt clean; goal init creates
only .future/ — no .codex/.loopx anywhere. Note: schema version tokens
(loopx_event_store_v0, loopx_extension_manifest_v0, ...) are on-disk format
identifiers, not directory names — left unchanged (renaming would break
existing state compatibility).
…ttribution

Complete de-loopx-ing of identifiers and on-disk format tokens:

- Bulk rename loopx_* -> future_loop_* (schema versions, capability/API
  tokens, benchmark routes, compat fn names) and loopx-* -> future-loop-*
  across src/ + tests/; todo anchors now <!-- future-loop:todo ... -->
- Backward-compat aliases so existing state keeps loading: event-store
  schema normalization in goal_schema_version(); scheduler-state,
  extension-state and extension-manifest validations accept the old
  loopx_*_v0 token as equal
- decision_split_regression provenance transform extended (loopx_compat,
  loopx_* tokens, LoopX prose -> reference) to match the renamed legacy
  module while the frozen snapshot stays byte-identical
- README (EN/zh) + loop-control-plane docs (EN/zh): attribute the loop to
  its origin — 'a Rust rewrite of the loopx control plane, customized for
  FutureOS'

Verified: 493 tests green, clippy -D warnings + fmt clean; CLI output has
zero loopx mentions; new goals stamp future_loop_event_store_v1; pre-existing
goals (loopx_event_store_v1) still load.
…hortcuts from code, reorder features, gitignore FUTURE.md

- Run-the-agent: only future-agent + future-tui; removed future-gui and
  future-channel startup instructions
- Removed 'CLI Quick Start' section
- Slash commands and keyboard shortcuts now match tui/src/help-screen.ts
  (/clone, /fork, /name added; tab/enter/escape shortcuts added)
- Features table reordered by importance/uniqueness with doc links
  (Models/Skills/Using-FutureOS/loop guide); dropped Multi-Interface,
  Channel Bridge and Cross-Platform rows
- Intro paragraph de-emphasizes GUI/channels
- Deleted FUTURE.md and gitignored it
… compaction, add Rust core row

- Restored Multi-Interface row (TUI/GUI/CLI/Feishu/DingTalk)
- Loop Control Plane moved from first to 8th position (still highlighted
  with guide link + loopx attribution)
- Removed duplicate auto-compaction from Tool Execution (kept once in
  Compaction & Retry); /compact slash command remains as usage
- Added 'Rust Core' row: agent, channel bridge and loop control plane are
  written in Rust — high performance with memory safety
Intro paragraph is the product overview (TUI, GUI, CLI, Feishu, DingTalk on
macOS/Linux/Windows); usage sections stay TUI-focused.
@huichen
huichen merged commit 503383c into main Aug 6, 2026
17 checks passed
@huichen
huichen deleted the claude/loop-hardening branch August 6, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant