diff --git a/docs/architecture/rfcs/README.md b/docs/architecture/rfcs/README.md index a773baa4ec..08168db90f 100644 --- a/docs/architecture/rfcs/README.md +++ b/docs/architecture/rfcs/README.md @@ -273,6 +273,14 @@ Paired diffs do not certify translation accuracy. ## Planning, Research, And Adaptive Intelligence +- [LoopX × LayerFS — Engineering Exploration and Evaluation v0](layerfs-engineering-exploration-evaluation-v0.md) + ([中文版](layerfs-engineering-exploration-evaluation-v0.zh-CN.md)) + - **Delivery on `main`:** Proposal only; no provider integration or measured benefit. + - **Current boundary:** Optional execution-workspace provider under existing + Explore/Host owners; real-environment branch/handoff conformance, then warm + worktree comparisons and native/passive/governed outcome/cost attribution. + Filesystem checkpoints do not qualify complete research-state continuation. + - [Goal-scoped Capability Portfolio and Connector Lifecycle v0](goal-scoped-capability-portfolio-v0.md) ([中文版](goal-scoped-capability-portfolio-v0.zh-CN.md)) - **Delivery on `main`:** Proposal; catalog, Agent-context hooks and connector diff --git a/docs/architecture/rfcs/STATUS.md b/docs/architecture/rfcs/STATUS.md index 36b77b1e59..6d2656d887 100644 --- a/docs/architecture/rfcs/STATUS.md +++ b/docs/architecture/rfcs/STATUS.md @@ -18,7 +18,7 @@ appendix may keep dated history, but no dated log heading may precede it. [中文版](STATUS.zh-CN.md) is the semantic mirror of this file. -## Accepted (45) +## Accepted (46) | RFC | Header status | Supersedes / closes | Ledger | | --- | --- | --- | --- | @@ -49,6 +49,7 @@ appendix may keep dated history, but no dated log heading may precede it. | [RFC: Human Attention Wishlist v0](human-attention-wishlist-v0.md) | Accepted | none | — | | [RFC: Human-confirmed domain operations (v0)](human-confirmed-domain-operations-v0.md) | Accepted | none | — | | [RFC: Intelligent Review and Dynamic Presentation Surfaces v0](intelligent-review-presentation-surfaces-v0.md) | Accepted | none | — | +| [RFC: LoopX × LayerFS — Engineering Exploration and Evaluation (v0)](layerfs-engineering-exploration-evaluation-v0.md) | Accepted | none | — | | [RFC: Live Team Workspace v0](live-team-workspace-v0.md) | Accepted | none | — | | [RFC: Long-Horizon Harness Benchmark and Research Program v0](long-horizon-harness-benchmark-research-program-v0.md) | Accepted | none | — | | [RFC: Long-Running Agent Reliability Diagnostics and Governed Delivery v0](long-running-agent-reliability-diagnostics-governed-delivery-v0.md) | Accepted | none | — | diff --git a/docs/architecture/rfcs/STATUS.zh-CN.md b/docs/architecture/rfcs/STATUS.zh-CN.md index 2891613ba8..f8791b87d4 100644 --- a/docs/architecture/rfcs/STATUS.zh-CN.md +++ b/docs/architecture/rfcs/STATUS.zh-CN.md @@ -15,7 +15,7 @@ [English](STATUS.md) 与本文互为语义镜像。 -## 已接受 (45) +## 已接受 (46) | RFC | 头部状态 | 替代 / 关闭 | Ledger | | --- | --- | --- | --- | @@ -46,6 +46,7 @@ | [RFC:Human Attention Wishlist v0](human-attention-wishlist-v0.zh-CN.md) | 已接受 | 无 | — | | [RFC:用户确认的垂域操作(v0)](human-confirmed-domain-operations-v0.zh-CN.md) | 已接受 | 无 | — | | [RFC:智能化审阅与动态展示面 v0](intelligent-review-presentation-surfaces-v0.zh-CN.md) | 已接受 | 无 | — | +| [RFC:LoopX × LayerFS——复杂工程探索与效果评测(v0)](layerfs-engineering-exploration-evaluation-v0.zh-CN.md) | 已接受 | 无 | — | | [RFC:团队实时工作区 v0](live-team-workspace-v0.zh-CN.md) | 已接受 | 无 | — | | [RFC:长程 Harness Benchmark 与研究计划 v0](long-horizon-harness-benchmark-research-program-v0.zh-CN.md) | 已接受 | 无 | — | | [RFC:长程 Agent 可靠性诊断与治理交付 v0](long-running-agent-reliability-diagnostics-governed-delivery-v0.zh-CN.md) | 已接受 | 无 | — | diff --git a/docs/architecture/rfcs/layerfs-engineering-exploration-evaluation-v0.md b/docs/architecture/rfcs/layerfs-engineering-exploration-evaluation-v0.md new file mode 100644 index 0000000000..368abb17a3 --- /dev/null +++ b/docs/architecture/rfcs/layerfs-engineering-exploration-evaluation-v0.md @@ -0,0 +1,416 @@ +# RFC: LoopX × LayerFS — Engineering Exploration and Evaluation (v0) + +- **RFC status:** Accepted (effective on merge; this change is a proposal) +- **Supersedes / closes:** none +- **Delivery maturity:** Proposal; no integration, experiment result or product promotion is claimed. +- **Authors / owners:** LoopX exploration and benchmark maintainers; LayerFS maintainers are invited to review the provider boundary, not assigned work. +- **Created:** 2026-10-26 +- **Last normative revision:** 2026-10-26 +- **Implementation baseline:** LoopX `15803cd7dcc2fc517049809bbe58998f04f5acac`; LayerFS source `ad78914e36b258b360daf13aec164b5655814689`. +- **Tracking:** [LoopX #7406](https://github.com/loopx-project/loopx/issues/7406) · [LayerFS #461](https://github.com/Ephemeral-AI-Lab/layerfs/issues/461). +- **Language mirror:** [中文版](layerfs-engineering-exploration-evaluation-v0.zh-CN.md) +- **Related contracts:** [Explore](research-exploration-control-plane-v0.md), [research-state branching](hierarchical-agent-stride-control-v0.md#77-research-state-branching-and-matched-continuation), [measurement](long-horizon-harness-benchmark-research-program-v0.md#6-measurement-model), [overall roadmap](loopx-overall-roadmap-v0.md). + +## Document map and maintenance contract + +Sections 1–3 and 5–11 define the proposed experiment and integration boundaries; +section 4 records source observations, not live qualification. Section 12 lists +decisions needed before execution. Appendix A records provenance. Keep the +Chinese mirror synchronized. Merge accepts a design basis, not a runtime +default, benchmark result, spending commitment or upstream implementation promise. +Future measured checkpoints belong in the existing [RFC ledger](ledger/README.md). + +## 1. Decision summary + +Evaluate LayerFS as an **optional execution-workspace provider for multi-agent +engineering exploration**. LoopX keeps questions, hypotheses, evidence, work +ownership, budget and continuation; LayerFS keeps branchable filesystem state; +the host keeps model sessions and tool execution. Git remains the reviewed +source-delivery boundary. No new generic capability or scheduler is proposed. + +The first experiment asks whether several agents can investigate a hard repair, +reuse a prepared environment, reject an approach, hand off a promising checkpoint +and deliver an independently verified patch with less total time or cost. +It does not equate more branches, cheaper mounts or more checkpoints with progress. + +Start with one host and three workers, using the same model and aggregate budget +as a warm Git-worktree control. Qualify workspace correctness before model runs. +Keep native/passive/governed controls for attributing joint benefit, and report +an absence of benefit as a useful result. Integration remains default-off. + +## 2. Problem and hypotheses + +In a multi-package repair, alternative explanations often require different +dependency versions, generated code, build outputs and test state. Git preserves +tracked source well, while environment reconstruction and transferring useful +untracked state can dominate short branches. Copying complete environments can +consume disk; sharing writable caches can contaminate comparisons. Conversely, +long-lived warm worktrees already avoid much repeated setup. + +| Hypothesis | Observable evidence | Falsifier or limit | +| --- | --- | --- | +| H1: branching a prepared full environment reduces exploration overhead | Lower init-amortized fork→test-ready, capture and handoff cost at equal restored-state fidelity | Mount is fast but commit, I/O, cleanup or cold import cancels the saving | +| H2: structured evidence plus cheap environment branches improves engineering outcomes | More independently accepted repairs at fixed total budget, or lower complete cost at comparable accepted outcomes | More attempts or attractive history with unchanged/worse outcomes | +| H3: a receiver can reuse a useful candidate without repeating setup or investigation | Receiver verifies the exact candidate, consumes a relevant finding and performs the next accepted work | A read receipt, filesystem fork or copied summary without adopted work | + +The likely fit is frequent branching with expensive, reusable environment state. +Read-only code search, a few persistent checkouts, large sequential I/O, or +workloads dominated entirely by model thinking may gain little or regress. +Filesystem deduplication does not deduplicate model reasoning or context tokens. + +## 3. Scope and non-goals + +The slice covers public engineering fixtures, isolated disposable workspaces, +candidate/result lineage, one end-to-end demo and a reproducible comparative +study. It maps to roadmap **S4/S8/S11**, with existing S3/S7 authority and budget +constraints; it is not a replacement for R2/R3 team qualification. + +Excluded: a replacement Goal store, global memory, a new agent framework, +production durability, untrusted multi-tenant isolation, cross-machine shared +Store writes, automatic Git publication, full process/VM snapshots, autonomous +MCTS policy, and promotion of LayerFS 2.0 roadmap items as current support. + +## 4. Audited current-system contract + +### LoopX + +- [`explore`](../../../loopx/capabilities/explore/README.md) already owns + node-linked findings, candidate/input identities, bounded measurement feedback + and execution observations. A measurement or observation is producer evidence, + not proof of benefit. Reuse its TypeScript decision owners. +- [Stride §7.7](hierarchical-agent-stride-control-v0.md#77-research-state-branching-and-matched-continuation) + defines a complete research point across conversation, evidence, artifacts and + evaluation opportunities. The existing [capture adapter](../../../benchmark/runtime/checkpoint.py) + and [artifact owner](../../../loopx/control_plane/runtime/checkpoint_artifacts.ts) + do not already accept arbitrary LayerFS references. The current file-capture + path rejects symlinks; a pnpm tree cannot simply be passed through that path. +- The [DSH plugin](../../../packages/dsh-loopx-plugin/README.md) supplies native + binding, continuation and Goal readback. It is a possible composition host, + not an existing LayerFS integration. + +### LayerFS + +The following facts refer to the pinned source above; release 1.1.0 and moving +web documentation are not interchangeable with that commit. Source evidence is +listed in Appendix A. + +| Mechanism | Integration consequence | +| --- | --- | +| SQLite content-addressed Store; fork shares committed objects; Workspace mounts a writable view | Candidate branches can retain source, dependencies and generated outputs without full payload copies; initialization and later writes still cost work | +| `@layerfs/agent`, `@layerfs/backend`, `@layerfs/runtime` split | Use public APIs at one exact source version; do not build against `@layerfs/agent/internal` | +| File mutations commit; `workspace.exec`, `workspace.commit`, `workspace.unmount` are separate calls | The integration must implement the per-tool lifecycle; a Bash command is not automatically a durable checkpoint | +| Direct Store open requires one Linux kernel and local ext4/xfs/btrfs; macOS/Windows have a worker route | First qualify Linux or one Linux VM; macOS worker setup must be tested explicitly, including upstream [#456](https://github.com/Ephemeral-AI-Lab/layerfs/issues/456) | +| Disposable profile, WAL with synchronous OFF; no crash/power-loss durability claim | Keep authoritative LoopX state and an independent source/result copy outside the Store; do not advertise backup or compare fsync speed as equal durability | +| Shared publication lane; conflicts, `.lww`, bounded diagnostics and explicit unknown outcomes | Measure contention and refusals; protect source, lockfiles and evaluator inputs from last-writer-wins; never turn a lost reply into an automatic retry | +| Append-only history; no branch retirement/unreachable-history GC ([#411](https://github.com/Ephemeral-AI-Lab/layerfs/issues/411)) | Discarding a Workspace does not reclaim committed branch history; account for all failed candidates and bound each experiment's Store lifetime | +| Commands can write outside the Workspace; process memory, network effects and external services are not captured | Use a declared execution envelope and disposable external fixtures; a filesystem rewind is not an experiment rewind | + +The published v1.0.0 [dedup study](https://layerfs.ai/benchmarks/dsh-dedup/) +reports 157 historical trees retained in about 100 MB versus about 1,995 MB for +Btrfs+zstd under its rewrite workload. Its [fio study](https://layerfs.ai/benchmarks/fio/) +also reports sequential-write/read and random-write regressions. These are +upstream measurements at `e5c7aaae05`, not reproduced here, not 1.1.0 results, +and not evidence of engineering-task success or lower total agent cost. + +## 5. Proposed architecture and demo + +### Ownership and placement + +| Owner | Responsibility | +| --- | --- | +| LoopX existing Explore / Todo / quota owners | Hypothesis and finding lineage, claims/leases, admitted work, result adoption, remaining budget and replan | +| Host/runtime | Native sessions, model/tool routing, cancellation, settled capture boundary and execution isolation | +| Optional LayerFS adapter | Map a candidate to exact Store/project/Commit/root and image identities; fork, mount, inspect, commit and return evidence | +| Existing benchmark toolkit / task evaluator | Frozen workload, independent oracle, complete cost collection and comparative analysis | +| Existing Git/review workflow | Export the selected source patch, validate in a clean checkout and propose it for review | + +Placement rationale: `capability_id: explore`, current built-in provider +`loopx-core`; LayerFS is a candidate optional provider implementation, initially +experiment-owned under the benchmark workspace. A production distribution would +follow the [extension placement rules](../../reference/extensions.md#placement-decision-for-agents) +only after a real caller qualifies. Do not register a provider id, new shared +enum or package solely for this design. New provider-neutral decisions belong +in the existing TypeScript owner; specialized capture remains an adapter. + +Keep two graphs: the Explore graph explains questions and findings; the LayerFS +graph identifies filesystem ancestry. They are linked, not one-to-one. Several +tool commits can implement one experiment, and one filesystem checkpoint can +support several findings. A LayerFS Commit is not a Git commit or an accepted +LoopX outcome. + +The experiment manifest binds existing task/experiment/result ids to provider +source revision, Store/project identity, parent and result Commit/root, runtime +image digest, environment manifest, evaluator revision and artifact digests. +Mutable branch names are display handles, never sufficient evidence identities. +Keep raw manifests and traces outside model packets; attach bounded summaries +and opaque evidence refs using existing Explore fields. This is a local study +record, not a silently introduced shared runtime schema. + +### A complete small demo + +Use the public failure in [LoopX #6869](https://github.com/loopx-project/loopx/issues/6869) +as the first **candidate fixture**, starting at source +`907ede6e1faff1fab0f2f765dde4358c69c7b7ff`: an unreadable spend artifact can +silently reduce accounted spend. Source inspection confirms the missing-event +path; the first milestone must reproduce the real CLI failure before admitting +this fixture. [PR #6875](https://github.com/loopx-project/loopx/pull/6875) is existing +repair work, not an accepted oracle or work to duplicate in this proposal. +The demo is an isolated historical repair exercise, not a claim on that issue. + +1. Prepare a standalone clone at the pinned base, with locked dependencies, + built TypeScript runtime and synthetic File/SQLite task data. The solver's + source repository is distinct from the installed LoopX controller and its + runtime state. Remove credentials and host-local data before import. A Git + worktree's `.git` pointer is not a portable complete repository. +2. Give three workers the same task and declared tool/feedback envelope. They + choose and record hypotheses, may share findings and may reject or continue + approaches. Do not script their conclusions or force one branch to win. +3. Start branches from an exact prepared checkpoint. A deterministic conformance + run first exercises competing edits, a negative result and a receiver handoff; + a separate model run determines whether those mechanisms are actually used. +4. Record each probe's code/environment identity, test result and cost. The + independent evaluator checks that missing, malformed and truncated spend + evidence never silently increases authorization; valid spend/void behavior, + history and admission stay consistent, including at time-window boundaries. + Do not use blanket permanent throttling or one patch's expected output as + the correctness oracle. +5. A receiver forks a selected immutable candidate, verifies its manifest, + reads relevant findings and performs the next test or repair. Then export + only the selected source patch into a fresh checkout and rerun the evaluator + with clean dependencies. An apparently passing cache or branch is insufficient. +6. Present the resulting patch, failed alternatives, receiver's actual work, + held-out result and full cost breakdown. A recorded UI replay is labeled as + such; scripted conformance is not autonomous model adoption. + +This public historical task may be contaminated by prior model exposure. It +qualifies the demo path only. The study must add previously unseen, independently +prepared tasks in at least a TypeScript monorepo and a Rust workspace, including +dependency/generated-code changes and a low-branching negative-control stratum. +Fixtures retain real package graphs, lockfiles, symlinks, ignored dependencies, +build outputs and representative error logs. Artificial mutations are labeled; +repeated strings or empty files cannot substitute for those state shapes. + +### Execution and failure transitions + +For the first host, investigate co-installing the existing DSH plugins in a +disposable profile; pin DSH, both plugins and LayerFS together. Existing +co-installability, tool routing and session inheritance are **unverified**. +DSH availability does not authorize silently changing the study's host. + +Before each filesystem command, the existing host admits the work and the +adapter binds its candidate. Direct file calls use the SDK; shell calls use +mount → exec → explicit commit/readback → clean unmount. Inspect nonzero exits +as experiment evidence, not successful fixes. Do not accidentally discard +useful failed-test state; an explicit discard is recorded when chosen. Same +Workspace operations remain sequential; workers own separate Workspaces. + +After a conflict, preserve the original inputs and inspect every affected path, +including paginated/truncated diagnostics. Resolve on new working forks and +reevaluate. For merges, freeze input heads first; a passing source branch's test +does not cover a newly merged root. On a lost response, reconcile exact history +and Workspace status before any new operation. If success cannot be established, +keep the attempt unknown and stop that branch; no blind command replay or forced +commit. Cleanup never claims an unresolved operation succeeded. + +For filesystem-only forks, start fresh sessions with the same declared context +in both arms. A later same-conversation continuation experiment must satisfy +Stride §7.7's host cursor, evidence, artifacts and opportunity barrier. LayerFS +can replace only the artifact participant after its provider contract qualifies; +it cannot make the current file-only capture accept symlinks or restore leases, +budgets, evaluator attempts or external side effects by copying their files. + +## 6. Alternatives and comparisons + +| Option | Why retain it | +| --- | --- | +| Warm Git worktrees + locked dependency cache | Primary practical control; allow realistic caching and preserve needed untracked outputs in its checkpoint path | +| Btrfs/reflink or overlay snapshot on a suitable Linux host | Strong alternative for cheap full environments; compare when available, disclose unavailable coverage | +| LayerFS workspace provider | Test shared complete-tree history, incremental capture and branch handoff, including FUSE and publication costs | +| Ordinary persistent single-worker checkout | Negative control when branching is rare; establishes whether parallel coordination itself helps | + +Do not compare a prewarmed LayerFS tree only against cold package downloads. +Measure both cold setup and repeated warm reuse, each with equal reachable +state and retention requirements. Keep dependency caches immutable or isolated +per branch. Native snapshots can remain the better choice. + +Start each attempt's wall clock before its environment preparation and include +terminal validation/export. Report one-time provider build/image preparation +separately and in a declared amortized total; do not hide it or charge it only +to the control. The steady-state view supplements the cold total, not replaces it. + +## 7. Safety, privacy and compatibility + +Run on disposable public fixtures in one Linux kernel, with fixed CPU/RAM/disk +limits and separately controlled network access. Do not import a developer's +working directory: LayerFS intentionally captures ignored files too. Keep +credentials, model histories, live LoopX state, evaluator internals, daemon +endpoints and Docker access outside agent-controlled trees. Use a fixed empty +`.lww` policy for the first study; no automatic newer-wins for lockfiles, source +or tests. A policy change makes a different experimental treatment. + +Check executable modes, symlinks, hardlinks, absolute paths, native dependency +ABI and packages writing outside the root. Imported environments must be built +for the same guest OS/architecture/image; an arm64 macOS dependency tree is not +a Linux environment. LayerFS isolation is not evidence of tenant security. + +Feature-off must keep existing execution and state unchanged. Adapter failure +is visible; a fallback starts a separately labeled attempt rather than silently +changing an arm. No model-visible instruction set can substitute for verifying +where tools actually read and write. LoopX control calls stay on their owning +host, outside the candidate tree being repaired. + +## 8. Migration and rollback + +No existing Store or Goal migration is proposed. Initialize a new study Store +from an independently preserved fixture. Keep selected source patches and +verification evidence outside it; test clean-checkout replay before declaring +success. Stop new admissions, reconcile in-flight operations, export qualified +results and close owned Workspaces/Sandboxes before removing the study's Store. +Never describe Workspace discard as historical GC. Disable the optional adapter +to return to the original workspace path. A source-format upgrade starts a new +study generation and is not an in-place repair of old evidence. + +## 9. Evaluation and acceptance + +### Separate substrate effects from agent effects + +First replay the same predetermined filesystem/build/test operations on both +workspace providers, with 1/3/8 workers and branch counts 1/4/16 where resource +limits allow. Record excluded cells before running. Keep topology, retained +states and command semantics equal. This estimates substrate overhead only. + +Then use this controlled matrix, with the same host/model/reasoning settings, +task split, test visibility, aggregate resource budgets and three-worker ceiling: + +| Control policy | Warm worktrees (W) | LayerFS (F) | +| --- | --- | --- | +| Native host (N) | N-W | N-F | +| Passive LoopX (P) | P-W | P-F | +| Governed LoopX (G) | G-W | G-F | + +The first bounded model pilot may run **G-W vs G-F**; it estimates workspace +effect under that LoopX policy, not LoopX's benefit or joint synergy. The full +matrix separates observation overhead, governance and workspace effects. Claim +an interaction only from a predeclared difference-of-differences on a common +outcome scale, with uncertainty; superiority of G-F alone is insufficient. + +Freeze task ids/base commits, mutation generator and evaluator hashes, model +revision, SDK/image/plugin pins, branch/depth limits, feedback schedule, dollar/ +token/compute/wall ceilings and missing-data rules before model evaluation. +Charge coordinator and all workers to **one aggregate budget**. Model-selected +branching may differ in the agent study but stays within that ceiling. Never +compensate one provider's overhead with extra time, worker slots or tokens. + +Use paired tasks/seeds, interleaved arm order and at least five repetitions per +promoted comparison cell, following the existing research contract; five is not +a power justification. Select tasks and any sequential stop rule before seeing +comparative results. Reserve held-out tasks/evaluation from all solver-accessible +files and network routes. Treat development feedback, scheduled evaluation and +terminal grading as distinct opportunities. Retain setup failures, cancellation, +timeouts, missing treatment and invalid evaluation in the denominator with their +own classifications. Freeze a power/precision plan before making general claims. + +### Metrics + +Primary: independently accepted repair rate at fixed aggregate budget and +best valid retained result over time. For equivalent accepted outcomes, report +time and complete cost, with all attempts included. Estimate any break-even +branch count from measured cold setup and marginal reuse costs, not fork latency +alone. Secondary metrics explain the result: + +- setup, dependency acquisition, mount/fork, tool execution, capture/commit, + conflict repair, handoff, validation, export and cleanup wall/CPU time; +- uncached/cached input and output tokens, actual billed model cost, control and + evaluator work, human interventions and measured attention time; +- physical allocated Store plus WAL, overlays, container scratch, caches, + independent exports and peak disk/RSS; logical history bytes separately; +- contention, refused/unknown operations, recovery work, duplicated probes and + evidence→decision→executed receiver work, without rewarding branch counts. + +Use LayerFS traces/backend counters as diagnostics, plus an independent runner +clock, OS resource measurements and provider usage. Trace writes can be lost; +missing trace data is not zero cost. Follow the existing measurement contract: +packet bytes are not model tokens, dedup ratios are not total disk saved, and +unknown billing/attention prevents a complete-cost claim. Do not sum overlapping +wall intervals as elapsed duration; also report total worker compute time. + +### Acceptance rows + +| Claim | Required evidence | Pass boundary | +| --- | --- | --- | +| A1: real environment branch fidelity | Deterministic tree/content/mode/link checks and same tests after fresh remount, including ignored outputs and a symlink-rich package tree | Every selected checkpoint has matching declared state; metadata differences are explicitly normalized, not ignored wholesale | +| A2: isolation and conflict integrity | Parallel independent edits, same-file conflict, merge-root retest, external-path sentinel and no-op/read-only calls | No candidate contamination or silent overwrite; no fabricated Commit for unchanged state | +| A3: truthful failure/recovery | Nonzero tool exit, lost reply, interrupted Workspace, absent worker, disk cap and missing evidence | Unknown remains unknown; no duplicate execution, false success or automatic authority restore | +| A4: useful handoff and output | Receiver verifies candidate, uses a scoped finding, performs new work; exported patch passes independent clean-checkout evaluation | Demonstrates the complete scripted path; a separate model run must prove actual adoption | +| A5: causal efficiency evidence | Frozen matched cells, complete attempt accounting, paired uncertainty and native outcomes | Claim only the scope supported by the contrast; no promotion from a demo or microbenchmark | +| A6: usable optional journey | Packaged host discovers availability, performs authorized run, shows conflict/unavailable states, reads results and disables provider | Required before product promotion; CLI-only experiment is labeled partial | + +Before the confirmatory study, preregister the primary contrast, minimum useful +effect and acceptable outcome-loss margin using pilot variance and operator +costs. These values cannot be chosen after inspecting the confirmatory result. +If the confidence interval spans material harm and benefit, keep the conclusion +inconclusive. Correctness/isolation failures block qualification regardless of +speed. Benefit restricted to storage is reported as storage benefit. + +## 10. Operational and product contract + +Use the existing Goal/Explore research history and DSH conversation for task +and outcome readback. LayerFS Work/History may show the filesystem lineage; +it cannot replace the explanation of why a candidate was kept. No new top-level +screen is required for the experiment. A shipped provider still needs existing +settings/capability readiness, authorized launch, unavailable/error recovery and +disable/readback coverage in App/CLI and any advertised Lark entrypoint. + +Cap branch count, total Store growth, concurrent workers and command duration +at the experiment runner. Forecast retention from failed as well as successful +branches; cleanup only this study's resources. Show stale/unknown checkpoints +and unavailable observations. Do not feed raw logs or growing history into +every model turn; detail is fetched by immutable reference and measured as +actual consumed context. This RFC changes no runtime packet or compute quota. + +## 11. Normative delivery plan + +| Milestone | Entry | Exit evidence | Rollback / owner | +| --- | --- | --- | --- | +| M0: freeze the demo | This proposal and public fixture candidate | Reproduced base failure; reviewed independent oracle; pinned host/provider manifest and explicit bounded run budget | No live state change; LoopX experiment owner | +| M1: one reliable integration path | M0; isolated runtime; compatible SDK/native/image | A1–A4 deterministic conformance through real LayerFS, LoopX readback and clean exported patch; disabled path parity | Remove disposable profile/provider; LoopX adapter owner, upstream consulted on API gaps | +| M2: comparative demo and pilot | M1 | G-W/G-F paired pilot, failed alternatives, full cost coverage and an honest effect/limit report; preregistration for any larger study | Retain evidence; no default change; benchmark owner | +| M3: attribution and optional adoption decision | Adequate pilot evidence and predeclared study | Native/passive/governed matrix, held-out task strata, A5 and independently repeated results; A6 before any product claim | Keep provider experimental or reject it; existing maintainers decide | + +One LoopX tracking issue owns this sequence; one LayerFS issue requests API and +evaluation feedback. Reuse upstream #411/#456 and roadmap +[#446](https://github.com/Ephemeral-AI-Lab/layerfs/issues/446) rather than filing +duplicate GC, worker or generic worktree-benchmark tasks. Portable substrate +measurements may contribute to `layerfs-benchmark`; LoopX owns governance and +task-outcome experiments. Upstream assent is useful but does not block local +fixture/oracle preparation with currently available interfaces. + +## 12. Open decisions + +| Decision / owner | Recommendation | Evidence required / due | +| --- | --- | --- | +| Host profile / LoopX host maintainer | DSH composition first; retain runtime-neutral design | Verify plugin versions, control-call routing, worker inheritance, cancellation and no double commit before M1 | +| Fixture and budget / experiment owner | Public #6869 demo; held-out TS/Rust task strata for effectiveness | Reproduce base, license/privacy review, oracle and cost caps before M0 exits | +| Provider API / LayerFS maintainer feedback | Public 1.1-era packages at one exact commit; no internal API or durability changes | Confirm worker settings, exact-root comparison, ambiguous-operation readback and cleanup scope before claiming provider support | +| Promotion / existing LoopX maintainers | Remain optional until replicated value and A6 | Predeclared practical-effect thresholds, power/precision and actual journey evidence before M3 closes | + +## Appendix A: Evidence registry + +Inspected 2026-10-26. Source inspection is not a reproduced benchmark or a live +integration. No LayerFS build, model experiment or runtime installation was run +for this RFC; a local Docker availability check only informs feasibility. + +| Evidence | Finding / limitation | +| --- | --- | +| [LayerFS pinned README](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/README.md) | Released-source/API split, Disposable restriction and explicitly scoped v1.0 measurements | +| [Agent SDK guide](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/api/how-to-use/agent.md) and [exec implementation](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/api/agent/sdk/src/workspace/exec.js) | Public calls, explicit commit lifecycle, guest settings, streamed output and bounded read/merge diagnostics | +| [Runtime guide](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/api/how-to-use/runtime.md) | Host-owned initialization, macOS/Windows worker and resource cleanup; no proof of plugin coexistence | +| [Backend/trace guide](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/api/how-to-use/backend.md) | Root comparison limitations, storage accounting and lossy diagnostic trace | +| [Store architecture](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/core/docs/architecture/84-global-sqlite-store.md) | Local-kernel boundary, publication semantics and no unreachable-history GC | +| [DSH integration](https://github.com/Ephemeral-AI-Lab/dsh-layerfs/blob/baac1b92b97f0bd492002c285f6a13401b4f4c0b/README.md) | Existing Bash/SDK route and Work/History UI; its LayerFS pin must be reconciled with the proposed source pin before execution | +| [LoopX historical readback](https://github.com/loopx-project/loopx/blob/907ede6e1faff1fab0f2f765dde4358c69c7b7ff/loopx/control_plane/quota/ledger_readback.py) | Missing/unreadable events yield no contribution; real-entry reproduction and correct repair oracle remain M0 work | + +The website's broad shared-storage wording does not supersede the supported +single-kernel Store contract. Older generic concept pages and pre-1.1 SDK names +are not implementation guidance for this study. Open issue reports are useful +risks, not independently reproduced defects or promised fixes. diff --git a/docs/architecture/rfcs/layerfs-engineering-exploration-evaluation-v0.zh-CN.md b/docs/architecture/rfcs/layerfs-engineering-exploration-evaluation-v0.zh-CN.md new file mode 100644 index 0000000000..f0b9bf0a14 --- /dev/null +++ b/docs/architecture/rfcs/layerfs-engineering-exploration-evaluation-v0.zh-CN.md @@ -0,0 +1,352 @@ +# RFC:LoopX × LayerFS——复杂工程探索与效果评测(v0) + +- **RFC status:** Accepted (合并后生效;本变更仍为提案) +- **替代 / 关闭:** 无 +- **Delivery maturity:** Proposal;尚无集成实现、实验结果或产品推广结论。 +- **Authors / owners:** LoopX 探索与 benchmark 维护者;邀请 LayerFS 维护者评审 provider 边界,不替对方分配工作。 +- **Created:** 2026-10-26 +- **Last normative revision:** 2026-10-26 +- **Implementation baseline:** LoopX `15803cd7dcc2fc517049809bbe58998f04f5acac`;LayerFS 源码 `ad78914e36b258b360daf13aec164b5655814689`。 +- **Tracking:** [LoopX #7406](https://github.com/loopx-project/loopx/issues/7406) · [LayerFS #461](https://github.com/Ephemeral-AI-Lab/layerfs/issues/461)。 +- **Language mirror:** [English](layerfs-engineering-exploration-evaluation-v0.md) +- **Related contracts:** [Explore](research-exploration-control-plane-v0.zh-CN.md)、[研究状态分叉](hierarchical-agent-stride-control-v0.zh-CN.md)、[度量契约](long-horizon-harness-benchmark-research-program-v0.zh-CN.md)、[整体路线](loopx-overall-roadmap-v0.zh-CN.md)。 + +## 文档地图与维护契约 + +第 1–3、5–11 节规定拟议实验与集成边界;第 4 节记录源码观察,不代表真实运行资格。 +第 12 节列出执行前待定事项。附录 A 保存来源。中英文保持语义同步。 +合并接受的是设计基础,不是运行时默认值、benchmark 结果、支出承诺或上游实施承诺。 +后续实测 checkpoint 使用现有 [RFC ledger](ledger/README.zh-CN.md)。 + +## 1. 决策摘要 + +将 LayerFS 作为**多 Agent 工程探索的可选执行工作区 provider**进行评估。 +LoopX 保持问题、假设、证据、工作归属、预算与接续的权威;LayerFS 保存可分叉的 +文件系统状态;Host 保持模型会话与工具执行;Git 保持源码评审交付边界。 +本提案不新增通用 capability 或 scheduler。 + +第一个实验检验:多个 Agent 能否在复杂修复中复用已准备好的环境,排除一条路线, +把有潜力的 checkpoint 交给接手者,并以更低总时间或总成本交付独立验证的补丁。 +更多分支、更快 mount、更多 checkpoint 本身不算进展。 + +从单 Host、三个 worker 开始,与预热 Git worktree 使用相同模型和总预算。 +先验证工作区正确性,再运行模型。联合收益归因保留 native/passive/governed 对照; +没有收益也是有效结果。集成默认关闭。 + +## 2. 问题与假设 + +多包工程修复中的不同解释常常需要不同依赖版本、生成代码、构建产物和测试状态。 +Git 能很好地保存跟踪源码;但短分支的环境重建、有效未跟踪状态的交接可能占据大量时间。 +完整复制环境消耗磁盘,共享可写缓存又可能污染对比。另一方面,长期保留的预热 +worktree 已经避免了很多重复准备,不能忽略这条强基线。 + +| 假设 | 可观察证据 | 反证或适用边界 | +| --- | --- | --- | +| H1:分叉完整预热环境可降低探索开销 | 恢复状态等价时,计入初始化摊销后的 fork→可测试、capture、handoff 成本更低 | mount 虽快,commit、I/O、清理或首次导入抵消收益 | +| H2:结构化证据结合低成本环境分叉,改善工程成果 | 固定总预算下独立验收通过的修复更多,或同等成果的完整成本更低 | 尝试次数和历史展示更丰富,成果却不变或变差 | +| H3:接手者能复用有效候选,减少重复准备和调查 | 接手者验证精确候选,采用相关 finding,执行下一项有效工作 | 只有读取回执、文件分叉或复制摘要,没有实际采用 | + +最可能适合的是频繁分叉、环境准备昂贵且可复用的任务。 +只读代码搜索、少量常驻 checkout、大文件顺序 I/O,或主要时间都花在模型思考上的任务, +可能收益很小甚至退化。文件系统去重不等于模型推理或上下文 token 去重。 + +## 3. 范围与非目标 + +本切片包含公开工程 fixture、隔离的一次性工作区、候选与结果谱系、一条端到端 demo +和可复现的比较研究。对应路线 **S4/S8/S11**,继承 S3/S7 的权限和预算边界; +不替代 R2/R3 团队资格验证。 + +不包含:替换 Goal store、全局记忆、新 Agent 框架、生产级持久性、不可信多租户隔离、 +跨机器共享 Store 写入、自动 Git 发布、进程/VM 完整快照、自主 MCTS 策略, +或把 LayerFS 2.0 路线项当作当前支持。 + +## 4. 已审阅的当前系统契约 + +### LoopX + +- [`explore`](../../../loopx/capabilities/explore/README.md) 已拥有节点关联 finding、 + candidate/input 身份、有界度量反馈和 execution observation。 + 度量和观察只是生产方证据,不直接证明收益;复用其 TypeScript 决策 owner。 +- [Stride §7.7](hierarchical-agent-stride-control-v0.zh-CN.md) 的完整研究点涵盖对话、 + 证据、产物与评测机会。现有 [capture adapter](../../../benchmark/runtime/checkpoint.py) + 和 [artifact owner](../../../loopx/control_plane/runtime/checkpoint_artifacts.ts) + 尚不接受任意 LayerFS 引用。当前文件 capture 路径拒绝 symlink,不能直接把 pnpm + 环境树塞入现有路径。 +- [DSH plugin](../../../packages/dsh-loopx-plugin/README.md) 提供原生绑定、接续和 + Goal 回读,可作为组合 Host,但当前不等于已有 LayerFS 集成。 + +### LayerFS + +以下事实针对上述精确源码;1.1.0 release 与持续变化的网站文档不能替代该 commit。 +源码来源见附录 A。 + +| 机制 | 对集成的影响 | +| --- | --- | +| SQLite 内容寻址 Store;fork 共享已提交对象;Workspace 挂载可写视图 | 候选可以保留源码、依赖和生成产物,避免完整 payload 复制;初始化和后续写入仍有成本 | +| `@layerfs/agent`、`@layerfs/backend`、`@layerfs/runtime` 分层 | 使用同一精确版本的公开 API,不依赖 `@layerfs/agent/internal` | +| 文件变更调用会提交;`workspace.exec`、`workspace.commit`、`workspace.unmount` 是独立调用 | 集成方负责每工具调用的生命周期;一次 Bash 不自动成为持久 checkpoint | +| 直接打开 Store 要求同一 Linux kernel、本地 ext4/xfs/btrfs;macOS/Windows 有 worker 路由 | 先验证 Linux 或单 Linux VM;单独验证 macOS worker 配置,包括上游 [#456](https://github.com/Ephemeral-AI-Lab/layerfs/issues/456) | +| Disposable profile、WAL、synchronous OFF;不保证崩溃/掉电持久性 | LoopX 权威状态与源码/结果的独立副本留在 Store 外;不宣传为备份,不把不同持久性的 fsync 速度直接比较 | +| 共享发布通道;冲突、`.lww`、有界诊断、显式未知结果 | 记录竞争与拒绝;源码、lockfile、评测输入不能自动 last-writer-wins;回复丢失不能触发自动重试 | +| 追加历史;尚无 branch retirement / 不可达历史 GC([#411](https://github.com/Ephemeral-AI-Lab/layerfs/issues/411)) | 丢弃 Workspace 不回收已提交分支历史;计入所有失败候选,限定每次实验 Store 生命周期 | +| 命令可写 Workspace 外部;进程内存、网络效果、外部服务不在快照内 | 声明执行环境和一次性外部 fixture;文件系统回退不等于实验回退 | + +公开 v1.0.0 [去重研究](https://layerfs.ai/benchmarks/dsh-dedup/) 在特定整文件重写负载下, +报告 157 个历史树约占 100 MB,Btrfs+zstd 约 1,995 MB; +[fio 研究](https://layerfs.ai/benchmarks/fio/) 同时报告顺序读写、随机写的退化。 +这些是上游 `e5c7aaae05` 的测量,本次未复现,不能当作 1.1.0 结果,也不证明工程任务 +成功率或 Agent 完整成本改善。 + +## 5. 拟议架构与 demo + +### Owner 与放置 + +| Owner | 职责 | +| --- | --- | +| LoopX 现有 Explore / Todo / quota owner | 假设与 finding 谱系、claim/lease、工作准入、结果采用、剩余预算和 replan | +| Host/runtime | 原生会话、模型/工具路由、取消、已结算 capture 边界与执行隔离 | +| 可选 LayerFS adapter | 候选关联精确 Store/project/Commit/root 与 image 身份;fork、mount、inspect、commit、返回证据 | +| 现有 benchmark toolkit / 任务 evaluator | 冻结工作负载、独立 oracle、完整成本收集和比较分析 | +| 现有 Git/review 流程 | 导出选定源码补丁,在干净 checkout 验证并提交评审 | + +放置理由:`capability_id: explore`,当前内置 provider 为 `loopx-core`;LayerFS 是 +候选的可选 provider 实现,初期放在 benchmark 实验工作区。只有真实调用方完成验证后, +才按 [extension 放置规则](../../reference/extensions.md#placement-decision-for-agents) +讨论产品 distribution。不要仅为此设计注册 provider id、新共享 enum 或 package。 +新的 provider-neutral 决策继续归现有 TypeScript owner,专用 capture 留在 adapter。 + +保留两张图:Explore 图解释问题和发现;LayerFS 图描述文件系统祖先关系。 +二者关联而非一一对应。多个工具 Commit 可实现一次实验,同一个文件 checkpoint +也可支持多个 finding。LayerFS Commit 不等于 Git commit,也不等于已验收的 LoopX 成果。 + +实验 manifest 将现有 task/experiment/result id 关联 provider 源码版本、Store/project +身份、父/结果 Commit/root、runtime image digest、环境 manifest、evaluator 版本与 +产物 digest。可变 branch 名仅作为展示句柄,不能独自充当证据身份。 +原始 manifest/trace 留在模型 packet 外;使用现有 Explore 字段挂有界摘要和 opaque +evidence ref。这是研究局部记录,不是悄悄新增的共享运行时 schema。 + +### 一条完整的小 demo + +第一项**候选 fixture**使用公开 [LoopX #6869](https://github.com/loopx-project/loopx/issues/6869), +从源码 `907ede6e1faff1fab0f2f765dde4358c69c7b7ff` 开始:不可读 spend artifact +可能静默降低已计入的消耗。源码确认了 missing-event 路径;第一个里程碑仍须通过真实 +CLI 复现才可纳入 fixture。[PR #6875](https://github.com/loopx-project/loopx/pull/6875) +是已有修复工作,不是已验收 oracle,也不是本提案要重复交付的工作。 +这是隔离的历史修复练习,不代表认领该 issue。 + +1. 准备固定 base 的独立 clone,含锁定依赖、已构建 TypeScript runtime、合成的 + File/SQLite 任务数据。solver 修改的源码仓库与已安装 LoopX controller 及其 runtime + 状态分离。导入前移除凭据和机器本地资料;Git worktree 的 `.git` 指针不是可移植完整仓库。 +2. 三个 worker 获得相同任务和声明的工具/反馈权限,自主提出、记录假设,分享发现, + 拒绝或继续路线。不脚本化结论,也不强迫某个分支获胜。 +3. 从精确预热 checkpoint 建立分支。先用确定性 conformance 执行竞争编辑、负结果和 + receiver handoff;另行运行模型实验,判断这些机制是否被实际使用。 +4. 每个 probe 保存代码/环境身份、测试结果和成本。独立 evaluator 验证 missing、 + malformed、truncated spend 证据不会静默增加权限;有效 spend/void、history、 + admission 保持一致,并覆盖时间窗口边界。不能用永久全量 throttling 或某份补丁 + 预期输出代替正确性 oracle。 +5. 接手者从选定不可变候选 fork,验证 manifest、读取相关 finding,执行下一项测试 + 或修复。最终仅导出选定源码补丁到新 checkout,以干净依赖重跑 evaluator。 + 只有分支或缓存中的通过结果不够。 +6. 展示补丁、失败路线、接手者的实际工作、held-out 结果与完整成本分解。 + 录制 UI 回放须标注;脚本 conformance 不算自主模型采用。 + +这个公开历史任务可能被模型预先见过,只能验证 demo 路径。效果研究还须加入此前未见、 +独立准备的任务,至少覆盖 TypeScript monorepo 与 Rust workspace,包括依赖/生成代码 +变更,以及低分叉负对照。Fixture 保留真实 package graph、lockfile、symlink、 +ignored dependencies、构建产物和代表性错误日志。人为注入故障须标明,不能用重复 +字符串或空文件代替这些状态形态。 + +### 执行与失败转换 + +首个 Host 优先调查两个现有 DSH plugin 在一次性 profile 中共存;固定 DSH、双方 +plugin 和 LayerFS 的组合版本。共存、工具路由、session 继承目前**未经验证**。 +不能因 DSH 可用就静默改变研究所选 Host。 + +每个文件操作前,由现有 Host 准入工作、adapter 绑定候选。直接文件调用经 SDK, +shell 经 mount → exec → 显式 commit/readback → clean unmount。 +非零退出作为实验证据,不能当修复成功;不要意外丢弃有价值的失败测试状态。 +决定 discard 时显式记录。同一 Workspace 的操作保持串行,worker 各有独立 Workspace。 + +冲突后保留原输入,检查全部相关路径,包括分页或截断的诊断。在新的工作 fork 中 +解决并重新评测。Merge 前冻结输入 head;原分支的测试通过不覆盖新合并 root。 +回复丢失时,先对照精确 history 与 Workspace status 再执行新操作;无法确认成功就 +保持 unknown、停止该分支,不能盲目重放命令或 force commit。 +清理也不能把未决操作改记为成功。 + +仅文件系统分叉时,两组都以相同声明上下文开启新会话。后续如研究同对话接续, +必须满足 Stride §7.7 的 host cursor、证据、产物与机会 barrier。 +LayerFS 的 provider 契约通过验证后,只能替换 artifact participant;不能使当前 +file-only capture 自动接受 symlink,也不能通过复制文件恢复 lease、预算、 +evaluator 次数或外部效果。 + +## 6. 替代方案与比较 + +| 方案 | 保留它的理由 | +| --- | --- | +| 预热 Git worktree + 锁定依赖缓存 | 主要实用对照;允许合理缓存,其 checkpoint 路径也须保存必要未跟踪产物 | +| 合适 Linux Host 上的 Btrfs/reflink 或 overlay snapshot | 完整环境低成本分叉的强替代;可用时比较,不可用时披露覆盖缺口 | +| LayerFS workspace provider | 测完整树共享历史、增量 capture、分支交接,也计入 FUSE 与发布成本 | +| 普通常驻单 worker checkout | 分叉很少时的负对照,同时判断并行协调本身是否有益 | + +不能只用已预热 LayerFS 对比每次冷下载依赖的对照。分别测冷启动和多次热复用,要求 +可恢复状态与保留历史等价。依赖缓存只读共享或按分支隔离。原生 snapshot 仍可能更优。 + +每次 attempt 在环境准备前启动 wall 时钟,计入终局验证/导出。 +Provider 的一次性 build/image 准备单列,并计入已声明摊销口径的总成本; +不能隐去,也不能只计给对照。稳态视图补充冷启动总量,而不替代它。 + +## 7. 安全、隐私与兼容性 + +使用同一 Linux kernel 内的一次性公开 fixture,固定 CPU/RAM/磁盘上限,单独控制网络。 +不要导入开发者正在使用的目录:LayerFS 会有意保存 ignored files。 +凭据、模型历史、真实 LoopX state、evaluator 内部资料、daemon endpoint 与 Docker +访问权限放在 Agent 可写树之外。首个研究使用固定空 `.lww`,源码、lockfile、测试不能 +自动 newer-wins;改变策略即改变 treatment。 + +检查可执行 mode、symlink、hardlink、绝对路径、native dependency ABI、写 root 外的 +package。导入环境必须匹配 guest OS/架构/image;arm64 macOS 依赖树不是 Linux 环境。 +LayerFS 隔离本身不证明租户安全。 + +Feature-off 保持已有执行与状态。Adapter 失败要可见;fallback 是单独标记的新 attempt, +不能静默换 arm。模型提示词不能替代对真实工具读写位置的验证。 +LoopX 控制调用留在其 owning Host,不放进正在修复的候选树。 + +## 8. 迁移与回退 + +不迁移已有 Store 或 Goal。从独立保存的 fixture 初始化新研究 Store。 +选定源码补丁和验证证据存放在外部;宣告成功前验证 clean-checkout replay。 +停止新准入、核对在途操作、导出合格结果、关闭本实验的 Workspace/Sandbox,再移除 +研究 Store。不要把 Workspace discard 描述为历史 GC。 +关闭可选 adapter 即恢复原工作区路径。源码格式升级开启新的研究 generation, +不原地改造历史证据。 + +## 9. 评测与验收 + +### 区分底层机制收益与 Agent 收益 + +首先在两种 workspace provider 上重放同一预定文件/构建/测试序列,在资源允许时 +覆盖 1/3/8 个 worker 与 1/4/16 个分支,运行前记录排除的单元。 +保持拓扑、保留状态和命令语义一致;它只估计底层开销。 + +随后使用以下矩阵,固定 Host/model/reasoning、任务划分、测试可见范围、总资源预算 +和最多三个 worker: + +| 控制策略 | 预热 worktree(W) | LayerFS(F) | +| --- | --- | --- | +| Native Host(N) | N-W | N-F | +| Passive LoopX(P) | P-W | P-F | +| Governed LoopX(G) | G-W | G-F | + +第一轮小规模模型 pilot 可只运行 **G-W vs G-F**,只能估计该 LoopX 策略下的 workspace +效果,不能估计 LoopX 收益或联合协同。完整矩阵区分观察开销、治理与 workspace 作用。 +协同声明需要在共同 outcome 标尺上预先声明 difference-of-differences,并给出不确定性; +仅 G-F 获胜不足以证明协同。 + +模型评测前冻结 task id/base commit、mutation generator/evaluator hash、模型版本、 +SDK/image/plugin pin、branch/depth 上限、反馈时序、美元/token/compute/wall 上限与 +缺失数据规则。协调者与所有 worker 共用**一个总预算**。Agent 研究允许自主改变 +分叉策略,但不能突破该预算;不能给某 provider 额外时间、worker 槽位或 token +补偿其开销。 + +使用配对任务/seed、交错 arm 顺序,按现有研究契约,每个拟推广比较单元至少五次重复; +五次不是统计功效依据。任务选择和 sequential stop 规则须先于比较结果确定。 +所有 solver 可访问文件和网络均不得泄漏 held-out task/evaluation。 +开发反馈、计划中的评测和终局评分作为独立机会处理。 +准备失败、取消、timeout、treatment 未交付、无效评测均保留在分母并单独分类。 +广泛结论之前冻结功效/精度计划。 + +### 度量 + +主要度量是固定总预算的独立验收通过率,以及随时间变化的最佳有效保留成果。 +同等成果再比较时间和完整成本,计入所有 attempt。 +根据实测冷准备与边际复用成本估算盈亏平衡分支数,不能只看 fork latency。 +解释性指标包括: + +- 初始化、依赖获取、mount/fork、工具执行、capture/commit、冲突解决、handoff、 + 验证、导出、清理的 wall/CPU 时间; +- 未缓存/缓存输入与输出 token、真实模型账单、控制与 evaluator 工作、人工介入次数 + 及已测注意力时间; +- 物理分配 Store 与 WAL、overlay、container scratch、cache、独立导出和峰值 + disk/RSS,另列 logical history bytes; +- 竞争、拒绝/未知操作、恢复工作、重复 probe,以及证据→决策→receiver 实际工作, + 不奖励分支计数。 + +LayerFS trace/backend counter 只作诊断,同时使用独立 runner 时钟、OS 资源测量与 +provider usage。Trace 写入可能丢失,缺记录不是零成本。 +遵循现有度量契约:packet byte 不是模型 token,去重比不是总磁盘节省;账单/注意力 +未知就不能声明完整成本。重叠 wall 区间不能相加当 elapsed duration,同时报告总 +worker compute time。 + +### 验收行 + +| 声明 | 所需证据 | 通过边界 | +| --- | --- | --- | +| A1:真实环境分叉保真 | fresh remount 后独立树/内容/mode/link 检查、相同测试,覆盖 ignored output 和 symlink 密集 package tree | 每个选定 checkpoint 的声明状态一致;显式归一化元数据差异,不整体忽略 | +| A2:隔离与冲突完整性 | 并行独立编辑、同文件冲突、merge root 重测、外部路径 sentinel、no-op/read-only 调用 | 无候选污染、静默覆盖;未变状态不伪造 Commit | +| A3:如实处理失败/恢复 | 非零工具退出、回复丢失、Workspace 中断、worker 缺失、磁盘上限、证据缺失 | Unknown 保持 unknown;无重复执行、假成功或自动权限恢复 | +| A4:有效交接与产物 | Receiver 验证候选、采用 scoped finding、执行新工作;导出补丁通过独立 clean-checkout 评测 | 证明完整脚本路径;模型实际采用须单独运行验证 | +| A5:因果效率证据 | 冻结 matched cell、完整 attempt 统计、配对不确定性和原生结果 | 结论限于对比支持的范围;demo/microbenchmark 不能直接 promotion | +| A6:可用的可选旅程 | 打包 Host 可发现可用性、执行授权运行、展示 conflict/unavailable、读取结果和关闭 provider | 产品推广前必须满足;CLI-only 实验标为局部交付 | + +确认性研究前,依据 pilot 方差和使用方成本,预注册主要对比、最小实用效果和 +可接受成果损失界限。不能看完确认性结果再选这些值。 +置信区间同时覆盖实质伤害与收益时,结论保持不确定。 +正确性/隔离失败无论多快都不合格。收益仅在存储时,就只报告存储收益。 + +## 10. 运行与产品契约 + +复用现有 Goal/Explore research history 与 DSH conversation 回读任务和结果。 +LayerFS Work/History 可显示文件谱系,但不能替代保留候选的理由。 +实验不需要新增顶层页面。产品 provider 仍须在现有设置/capability 中提供 readiness、 +授权启动、unavailable/error 恢复,以及 App/CLI 和任何宣称支持的 Lark 入口的关闭/回读覆盖。 + +实验 runner 限制分支数、Store 总增长、并发 worker 与命令时长。 +按成功和失败分支共同预测保留成本,只清理本研究资源。 +展示 stale/unknown checkpoint 与不可用观察。不要每轮向模型灌入原始日志和不断增长的 +历史;按不可变引用获取详情,度量实际消费上下文。本 RFC 不改变 runtime packet +或 compute quota。 + +## 11. 规范性交付计划 + +| 里程碑 | 进入条件 | 退出证据 | 回退 / owner | +| --- | --- | --- | --- | +| M0:冻结 demo | 本提案与公开候选 fixture | 真实复现 base 失败;评审独立 oracle;固定 Host/provider manifest 与明确有界预算 | 不改活跃状态;LoopX 实验 owner | +| M1:一条可靠集成路径 | M0;隔离 runtime;兼容 SDK/native/image | 真实 LayerFS、LoopX 回读、干净导出补丁通过 A1–A4 确定性 conformance;关闭路径 parity | 移除一次性 profile/provider;LoopX adapter owner,上游就 API 缺口提供意见 | +| M2:比较 demo 与 pilot | M1 | G-W/G-F 配对 pilot、失败路线、完整成本覆盖和如实效果/限制报告;较大研究先预注册 | 保留证据、不改默认;benchmark owner | +| M3:归因与可选采用决策 | 充分 pilot 证据与预声明研究 | Native/passive/governed 矩阵、held-out 任务分层、A5 与独立复现;产品声明前满足 A6 | 保持实验性质或拒绝 provider;现有维护者决策 | + +一条 LoopX issue 承接上述序列;一条 LayerFS issue 请求 API/评测反馈。 +复用上游 #411/#456 和 [#446 路线](https://github.com/Ephemeral-AI-Lab/layerfs/issues/446), +不重复创建 GC、worker 或通用 worktree benchmark 任务。 +可移植底层测量可贡献至 `layerfs-benchmark`;治理与任务结果实验由 LoopX 负责。 +上游意见有价值,但不能阻塞通过现有接口可独立推进的 fixture/oracle 准备。 + +## 12. 待定事项 + +| 决策 / owner | 建议 | 所需证据 / 截止边界 | +| --- | --- | --- | +| Host profile / LoopX Host 维护者 | 优先 DSH 组合,设计保持 runtime-neutral | M1 前核验 plugin 版本、control-call 路由、worker 继承、取消与无双重 commit | +| Fixture 与预算 / 实验 owner | #6869 公开 demo,held-out TS/Rust 分层研究效果 | M0 退出前完成 base 复现、license/privacy 审阅、oracle、cost cap | +| Provider API / LayerFS 维护者反馈 | 同一精确 commit 的公开 1.1 时代 packages;不改 internal API 或持久性 | 宣称 provider 支持前确认 worker 配置、exact-root 比较、未知操作回读与清理范围 | +| Promotion / LoopX 现有维护者 | 重复收益和 A6 满足前保持可选 | M3 关闭前具备预声明实用效果阈值、功效/精度和真实旅程证据 | + +## 附录 A:证据登记 + +检查日期为 2026-10-26。源码审阅不等于 benchmark 复现或集成实测。 +本 RFC 未运行 LayerFS build、模型实验或 runtime 安装;本地 Docker 可用性检查仅用于 +判断可行性。 + +| 证据 | 发现 / 限制 | +| --- | --- | +| [LayerFS 固定 README](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/README.md) | 发布源码/API 分层、Disposable 限制、有明确范围的 v1.0 测量 | +| [Agent SDK guide](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/api/how-to-use/agent.md) 与 [exec 实现](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/api/agent/sdk/src/workspace/exec.js) | 公开调用、显式 commit 生命周期、guest 设置、流式输出、有界读取/merge 诊断 | +| [Runtime guide](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/api/how-to-use/runtime.md) | Host 所有的初始化、macOS/Windows worker、资源清理;不证明 plugin 共存 | +| [Backend/trace guide](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/api/how-to-use/backend.md) | Root 比较限制、存储口径和可能丢失的诊断 trace | +| [Store 架构](https://github.com/Ephemeral-AI-Lab/layerfs/blob/ad78914e36b258b360daf13aec164b5655814689/core/docs/architecture/84-global-sqlite-store.md) | 单 kernel 边界、发布语义、无不可达历史 GC | +| [DSH 集成](https://github.com/Ephemeral-AI-Lab/dsh-layerfs/blob/baac1b92b97f0bd492002c285f6a13401b4f4c0b/README.md) | 现有 Bash/SDK 路由、Work/History UI;执行前需核对其 LayerFS pin 与提议源码 pin | +| [LoopX 历史 readback](https://github.com/loopx-project/loopx/blob/907ede6e1faff1fab0f2f765dde4358c69c7b7ff/loopx/control_plane/quota/ledger_readback.py) | Missing/unreadable event 不贡献消耗;真实入口复现和正确修复 oracle 仍属于 M0 | + +网站广义共享存储描述不能替代受支持的单 kernel Store 契约。 +旧概念页和 1.1 之前的 SDK 名称不作为本研究实现指导。 +Open issue 报告用于识别风险,不代表本次独立复现的缺陷或承诺修复。 diff --git a/docs/architecture/rfcs/loopx-overall-roadmap-v0.md b/docs/architecture/rfcs/loopx-overall-roadmap-v0.md index 75b59e1276..7cc8feb9d4 100644 --- a/docs/architecture/rfcs/loopx-overall-roadmap-v0.md +++ b/docs/architecture/rfcs/loopx-overall-roadmap-v0.md @@ -490,6 +490,7 @@ subsystem was not performed. Section 8 records the focused audit. | [Human-confirmed domain operations (v0)](human-confirmed-domain-operations-v0.md) | S8/S9 + R2/R3 | Accepted; canonical operation seam exists, managed native transport under owner review | Qualify source-context vs admitted-executor separation, exact human approval→one-shot consumption→domain evidence→original-route return; owned Turn/delegation need not await Desktop authentication. Live approval/effect/wakeup remain unqualified; finance provider stays separate | | [Provider-side authorization at effect acceptance (v0)](provider-effect-acceptance-v0.md) | S8/S9, supporting S2/S4 | Accepted design only; no runtime integration or qualified provider | M1: controlled provider and deterministic revoke/crash/replay conformance; strict production wiring remains gated by exact Goal lifetime, receipt retention and independent provider qualification | | [Research Exploration Control Plane v0](research-exploration-control-plane-v0.md) | S11/S3 | Accepted; partial M2 composition/successor; §11.5 result/adoption refinement proposed | P1: one real provider result -> scoped interpretation -> adopted step/successor, exact lineage/shared write gate and packaged readback; qualify shadow before opt-in, retain composition gaps; defer inference and M4 portfolio ranking | +| [LoopX × LayerFS Engineering Exploration and Evaluation v0](layerfs-engineering-exploration-evaluation-v0.md) | S4/S8/S11 | Proposal; no integration or benefit claim | Bounded experiment: real environment fork/handoff/clean export, then matched warm-worktree and control-policy comparisons; preserve existing research-state/authority owners, count complete cost and negative results; no new priority or default | | [Hierarchical Agent Stride Control v0](hierarchical-agent-stride-control-v0.md) | S11/S7 | Accepted; M1 observation and source-level replan decision followthrough; adaptive policy/continuation unqualified | P2: §7.6 mechanism/evidence scope review -> actual probe/adoption/full cost; §7.7 same-state continuation and recovery before adaptive promotion. Preserve per-Turn settlement and authority; no forced-hour pivot or default cadence change | | [Goal-scoped Capability Portfolio v0](goal-scoped-capability-portfolio-v0.md) | S1/S3/S6/S8/S11 | Accepted; read-only settings/context inspection slice | P1: correction→fresh-session decision across existing owners, then demand-driven composition and measured method evolution; no universal memory database or second opt-in | | [Post-Outcome Memory Utility Attribution v0](post-outcome-memory-utility-attribution-v0.md) | S6/S11 | Accepted; Stage 1 verified-outcome binding | P1 read-only reducer→P2 pilot: distinguish recalled/applied/utility, no automatic ranking change | diff --git a/docs/architecture/rfcs/loopx-overall-roadmap-v0.zh-CN.md b/docs/architecture/rfcs/loopx-overall-roadmap-v0.zh-CN.md index 5108402ea7..e4a9694f3e 100644 --- a/docs/architecture/rfcs/loopx-overall-roadmap-v0.zh-CN.md +++ b/docs/architecture/rfcs/loopx-overall-roadmap-v0.zh-CN.md @@ -376,6 +376,7 @@ Muse 设计页在浏览器超时,其文章通过网页检索读取。本次调 | [Human-confirmed domain operations (v0)](human-confirmed-domain-operations-v0.zh-CN.md) | S8/S9 + R2/R3 | 已接受;规范操作接缝存在,受管原生传输待 owner review | 验收来源上下文与已准入执行者分离、精确用户批准→单次消费→垂域证据→原路返回;自有 Turn/delegation 不等待 Desktop 认证。真实批准/效果/唤醒仍未资格化;金融 provider 保持独立 | | [Provider 在效果接受点执行授权(v0)](provider-effect-acceptance-v0.zh-CN.md) | S8/S9,S2/S4 支撑 | 已接受设计;尚未接入 runtime,也未准入 provider | M1:controlled provider 与 deterministic revoke/crash/replay conformance;strict production 接线仍需精确 Goal 生命周期、receipt retention 与独立 provider 资格 | | [Research Exploration Control Plane v0](research-exploration-control-plane-v0.zh-CN.md) | S11/S3 | 已接受;M2 composition/successor 局部实现;§11.5 result/adoption 修订为提案 | P1:一条真实 provider result -> 有范围 interpretation -> adopted step/successor,精确 lineage/shared write gate 与 packaged readback;shadow 资格先于 opt-in,保留 composition gap;推断与 M4 portfolio 排序继续 defer | +| [LoopX × LayerFS 复杂工程探索与效果评测 v0](layerfs-engineering-exploration-evaluation-v0.zh-CN.md) | S4/S8/S11 | 提案;无集成或收益声明 | 有界实验:真实环境 fork/handoff/干净导出,然后匹配预热 worktree 与控制策略进行比较;保留现有研究状态/权限 owner,计入完整成本和负结果;不新增优先级或默认值 | | [Hierarchical Agent Stride Control v0](hierarchical-agent-stride-control-v0.zh-CN.md) | S11/S7 | 已接受;M1 观测及源码层面的 replan 决策接续;自适应策略/恢复接续未资格化 | P2:§7.6 机制/证据范围复盘 -> 真实探针/采用/完整成本;§7.7 同起点接续及恢复验证先于自适应 promotion。保留每 Turn 结算与权限,不按固定小时强制转向、不改变默认 cadence | | [Goal-scoped Capability Portfolio v0](goal-scoped-capability-portfolio-v0.zh-CN.md) | S1/S3/S6/S8/S11 | 已接受;只读配置/上下文检查切片 | P1:复用既有 owner 验收纠正→新会话决策,再做按需组合与可测方法演化;不建万能记忆库或第二个启用开关 | | [Post-Outcome Memory Utility Attribution v0](post-outcome-memory-utility-attribution-v0.zh-CN.md) | S6/S11 | 已接受;Stage 1 verified-outcome 绑定 | P1 只读 reducer→P2 pilot:区分 recalled/applied/utility,归因不自动改 ranking |