accrete-kit 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/LICENSE +21 -0
  3. package/README.md +148 -2
  4. package/bin/accrete-kit.mjs +4 -0
  5. package/dist/kernel/darwin-arm64/LICENSE +21 -0
  6. package/dist/kernel/darwin-arm64/THIRD-PARTY-NOTICES +5780 -0
  7. package/dist/kernel/darwin-arm64/accrete +0 -0
  8. package/dist/kernel/darwin-arm64/licenses/RUST-COPYRIGHT-library.html +7038 -0
  9. package/dist/kernel/darwin-arm64/licenses/musl-COPYRIGHT +193 -0
  10. package/dist/kernel/darwin-arm64/licenses/rust/Apache-2.0.txt +73 -0
  11. package/dist/kernel/darwin-arm64/licenses/rust/BSD-2-Clause.txt +9 -0
  12. package/dist/kernel/darwin-arm64/licenses/rust/CC-BY-SA-4.0.txt +427 -0
  13. package/dist/kernel/darwin-arm64/licenses/rust/GCC-exception-3.1.txt +30 -0
  14. package/dist/kernel/darwin-arm64/licenses/rust/GPL-2.0-only.txt +133 -0
  15. package/dist/kernel/darwin-arm64/licenses/rust/GPL-3.0-or-later.txt +202 -0
  16. package/dist/kernel/darwin-arm64/licenses/rust/ISC.txt +7 -0
  17. package/dist/kernel/darwin-arm64/licenses/rust/LLVM-exception.txt +15 -0
  18. package/dist/kernel/darwin-arm64/licenses/rust/MIT.txt +9 -0
  19. package/dist/kernel/darwin-arm64/licenses/rust/NCSA.txt +29 -0
  20. package/dist/kernel/darwin-arm64/licenses/rust/OFL-1.1.txt +43 -0
  21. package/dist/kernel/darwin-arm64/licenses/rust/Unicode-3.0.txt +39 -0
  22. package/dist/kernel/darwin-x64/LICENSE +21 -0
  23. package/dist/kernel/darwin-x64/THIRD-PARTY-NOTICES +5780 -0
  24. package/dist/kernel/darwin-x64/accrete +0 -0
  25. package/dist/kernel/darwin-x64/licenses/RUST-COPYRIGHT-library.html +7038 -0
  26. package/dist/kernel/darwin-x64/licenses/musl-COPYRIGHT +193 -0
  27. package/dist/kernel/darwin-x64/licenses/rust/Apache-2.0.txt +73 -0
  28. package/dist/kernel/darwin-x64/licenses/rust/BSD-2-Clause.txt +9 -0
  29. package/dist/kernel/darwin-x64/licenses/rust/CC-BY-SA-4.0.txt +427 -0
  30. package/dist/kernel/darwin-x64/licenses/rust/GCC-exception-3.1.txt +30 -0
  31. package/dist/kernel/darwin-x64/licenses/rust/GPL-2.0-only.txt +133 -0
  32. package/dist/kernel/darwin-x64/licenses/rust/GPL-3.0-or-later.txt +202 -0
  33. package/dist/kernel/darwin-x64/licenses/rust/ISC.txt +7 -0
  34. package/dist/kernel/darwin-x64/licenses/rust/LLVM-exception.txt +15 -0
  35. package/dist/kernel/darwin-x64/licenses/rust/MIT.txt +9 -0
  36. package/dist/kernel/darwin-x64/licenses/rust/NCSA.txt +29 -0
  37. package/dist/kernel/darwin-x64/licenses/rust/OFL-1.1.txt +43 -0
  38. package/dist/kernel/darwin-x64/licenses/rust/Unicode-3.0.txt +39 -0
  39. package/dist/kernel/kernel.json +17 -0
  40. package/dist/kernel/linux-arm64/LICENSE +21 -0
  41. package/dist/kernel/linux-arm64/THIRD-PARTY-NOTICES +5780 -0
  42. package/dist/kernel/linux-arm64/accrete +0 -0
  43. package/dist/kernel/linux-arm64/licenses/RUST-COPYRIGHT-library.html +7038 -0
  44. package/dist/kernel/linux-arm64/licenses/musl-COPYRIGHT +193 -0
  45. package/dist/kernel/linux-arm64/licenses/rust/Apache-2.0.txt +73 -0
  46. package/dist/kernel/linux-arm64/licenses/rust/BSD-2-Clause.txt +9 -0
  47. package/dist/kernel/linux-arm64/licenses/rust/CC-BY-SA-4.0.txt +427 -0
  48. package/dist/kernel/linux-arm64/licenses/rust/GCC-exception-3.1.txt +30 -0
  49. package/dist/kernel/linux-arm64/licenses/rust/GPL-2.0-only.txt +133 -0
  50. package/dist/kernel/linux-arm64/licenses/rust/GPL-3.0-or-later.txt +202 -0
  51. package/dist/kernel/linux-arm64/licenses/rust/ISC.txt +7 -0
  52. package/dist/kernel/linux-arm64/licenses/rust/LLVM-exception.txt +15 -0
  53. package/dist/kernel/linux-arm64/licenses/rust/MIT.txt +9 -0
  54. package/dist/kernel/linux-arm64/licenses/rust/NCSA.txt +29 -0
  55. package/dist/kernel/linux-arm64/licenses/rust/OFL-1.1.txt +43 -0
  56. package/dist/kernel/linux-arm64/licenses/rust/Unicode-3.0.txt +39 -0
  57. package/dist/kernel/linux-x64/LICENSE +21 -0
  58. package/dist/kernel/linux-x64/THIRD-PARTY-NOTICES +5780 -0
  59. package/dist/kernel/linux-x64/accrete +0 -0
  60. package/dist/kernel/linux-x64/licenses/RUST-COPYRIGHT-library.html +7038 -0
  61. package/dist/kernel/linux-x64/licenses/musl-COPYRIGHT +193 -0
  62. package/dist/kernel/linux-x64/licenses/rust/Apache-2.0.txt +73 -0
  63. package/dist/kernel/linux-x64/licenses/rust/BSD-2-Clause.txt +9 -0
  64. package/dist/kernel/linux-x64/licenses/rust/CC-BY-SA-4.0.txt +427 -0
  65. package/dist/kernel/linux-x64/licenses/rust/GCC-exception-3.1.txt +30 -0
  66. package/dist/kernel/linux-x64/licenses/rust/GPL-2.0-only.txt +133 -0
  67. package/dist/kernel/linux-x64/licenses/rust/GPL-3.0-or-later.txt +202 -0
  68. package/dist/kernel/linux-x64/licenses/rust/ISC.txt +7 -0
  69. package/dist/kernel/linux-x64/licenses/rust/LLVM-exception.txt +15 -0
  70. package/dist/kernel/linux-x64/licenses/rust/MIT.txt +9 -0
  71. package/dist/kernel/linux-x64/licenses/rust/NCSA.txt +29 -0
  72. package/dist/kernel/linux-x64/licenses/rust/OFL-1.1.txt +43 -0
  73. package/dist/kernel/linux-x64/licenses/rust/Unicode-3.0.txt +39 -0
  74. package/dist/scaffold/assets/contract/cli-v1.json +296 -0
  75. package/dist/scaffold/assets/contract/example-inputs.json +38 -0
  76. package/dist/scaffold/assets/contract/input-drafts.schema.json +654 -0
  77. package/dist/scaffold/assets/generated/cli-commands.md +288 -0
  78. package/dist/scaffold/assets/generated/release.json +11 -0
  79. package/dist/scaffold/assets/skills/accrete-data/SKILL.md +73 -0
  80. package/dist/scaffold/assets/skills/accrete-data/references/commands.md +193 -0
  81. package/dist/scaffold/assets/skills/accrete-data/references/objects-and-native-work.md +123 -0
  82. package/dist/scaffold/assets/skills/accrete-data/references/remote-and-retention.md +98 -0
  83. package/dist/scaffold/assets/skills/accrete-memory/SKILL.md +61 -0
  84. package/dist/scaffold/assets/skills/accrete-memory/references/commands.md +124 -0
  85. package/dist/scaffold/assets/skills/accrete-memory/references/handovers-and-remote-work.md +78 -0
  86. package/dist/scaffold/assets/skills/accrete-memory/references/writing-and-continuity.md +101 -0
  87. package/dist/scaffold/assets/skills/accrete-models/SKILL.md +46 -0
  88. package/dist/scaffold/assets/skills/accrete-models/references/cli.md +117 -0
  89. package/dist/scaffold/assets/skills/accrete-models/references/objects.md +67 -0
  90. package/dist/scaffold/assets/skills/accrete-models/references/working-practice.md +48 -0
  91. package/dist/scaffold/assets/skills/accrete-results/SKILL.md +69 -0
  92. package/dist/scaffold/assets/skills/accrete-results/references/activities-and-relations.md +116 -0
  93. package/dist/scaffold/assets/skills/accrete-results/references/commands.md +191 -0
  94. package/dist/scaffold/assets/skills/accrete-results/references/scientific-practice.md +89 -0
  95. package/dist/scaffold/assets/skills/accrete-tools/SKILL.md +51 -0
  96. package/dist/scaffold/assets/skills/accrete-tools/references/cli.md +87 -0
  97. package/dist/scaffold/assets/skills/accrete-tools/references/objects.md +66 -0
  98. package/dist/scaffold/assets/skills/accrete-tools/references/working-practice.md +51 -0
  99. package/dist/scaffold/assets/template/.accrete/PROJECT.md +31 -0
  100. package/dist/scaffold/assets/template/.accrete/config-examples/local-compute.toml.example +27 -0
  101. package/dist/scaffold/assets/template/.accrete/config-examples/local-workstation.toml.example +21 -0
  102. package/dist/scaffold/assets/template/.accrete/config-examples/project.toml.example +27 -0
  103. package/dist/scaffold/assets/template/.accrete/docs/cli-contract.md +393 -0
  104. package/dist/scaffold/assets/template/.accrete/docs/configuration.md +117 -0
  105. package/dist/scaffold/assets/template/.accrete/docs/coordinator.md +102 -0
  106. package/dist/scaffold/assets/template/.accrete/docs/long-term-work.md +108 -0
  107. package/dist/scaffold/assets/template/.accrete/docs/overview.md +118 -0
  108. package/dist/scaffold/assets/template/.accrete/docs/remote-work.md +125 -0
  109. package/dist/scaffold/assets/template/.accrete/docs/subagents.md +78 -0
  110. package/dist/scaffold/assets/template/.accrete/examples/README.md +78 -0
  111. package/dist/scaffold/assets/template/.accrete/examples/data-register.json +19 -0
  112. package/dist/scaffold/assets/template/.accrete/examples/iteration-close.json +5 -0
  113. package/dist/scaffold/assets/template/.accrete/examples/iteration-open.json +8 -0
  114. package/dist/scaffold/assets/template/.accrete/examples/memory-entry.md +10 -0
  115. package/dist/scaffold/assets/template/.accrete/examples/model-register.json +7 -0
  116. package/dist/scaffold/assets/template/.accrete/examples/observation.md +9 -0
  117. package/dist/scaffold/assets/template/.accrete/examples/result-amend.json +5 -0
  118. package/dist/scaffold/assets/template/.accrete/examples/result-record.json +11 -0
  119. package/dist/scaffold/assets/template/.accrete/examples/tool-admit.json +8 -0
  120. package/dist/scaffold/assets/template/.accrete/examples/tool-retire.json +3 -0
  121. package/dist/scaffold/assets/template/.accrete/examples/tool-update.json +3 -0
  122. package/dist/scaffold/assets/template/.gitattributes +17 -0
  123. package/dist/scaffold/assets/template/AGENTS.md +23 -0
  124. package/dist/scaffold/assets/template/CLAUDE.md +5 -0
  125. package/dist/scaffold/assets/template/_gitignore +12 -0
  126. package/dist/scaffold/config/defaults.toml +20 -0
  127. package/dist/scaffold/manifest.json +622 -0
  128. package/lib/cli.mjs +188 -0
  129. package/lib/fsutil.mjs +135 -0
  130. package/lib/install.mjs +439 -0
  131. package/lib/kernel.mjs +76 -0
  132. package/lib/scaffold.mjs +129 -0
  133. package/lib/workspace.mjs +278 -0
  134. package/package.json +18 -4
@@ -0,0 +1,67 @@
1
+ # Model meaning and relationships
2
+
3
+ ## Identity and placement
4
+
5
+ A Model names a computational program that the project develops or uses. Its stable ID survives a rename, a moved checkout, another machine's path, and a new Git revision. A repository is the carrier of source history; a checkout exposes one working form of that history. Several checkouts can serve the same Model. A single repository can also carry several Models with different declared source scopes.
6
+
7
+ | Arrangement | Historical address | What the Agent supplies |
8
+ | --- | --- | --- |
9
+ | Independent repository | Commit in that repository | Existing repository and a local checkout binding |
10
+ | Submodule | Commit in the submodule repository | Model repository plus its owning project's relationship |
11
+ | Program embedded in the project | Project repository commit | Program purpose and source scope when useful |
12
+ | Program inside a monorepo | Repository commit plus relevant paths | Scope that includes meaningful build and generated-source inputs |
13
+ | Additional worktree | Commit in the underlying repository | Model identity, worktree path, and intended base revision |
14
+
15
+ Choose the arrangement that fits the project. There is no requirement to convert every Model into a submodule or independent repository. A local repository without a remote is sufficient for registration. Clone and fetch using Git before registration when needed.
16
+
17
+ An ACCRETE project clone retains its project identity. A Model attached to that project does not automatically become a second ACCRETE project. Opening a shell inside the Model therefore does not establish the owning ACCRETE project for subsequent object writes; use explicit project selection when it is outside the project's ancestry.
18
+
19
+ ## Revisions and declared scope
20
+
21
+ A commit gives an address in Git history. It does not completely describe a calculation. The interpreter, build flags, installed libraries, runtime imports, input Data, launch arguments, and execution environment can all matter. Domain Tools or the launcher describe those conditions in the Result when known.
22
+
23
+ For a Model embedded in a research repository, a Memory change can advance `HEAD` while the numerical source remains unchanged. The Model may declare paths whose native Git tree or blob IDs help explain what changed. Include build configuration and relevant generated inputs in the scope when the project's meaning requires them. A scope named `src/` cannot by itself establish that all behavior is covered.
24
+
25
+ Record the commit actually used and optional scoped content identities. Let scientific reasoning determine whether an earlier activity is useful for the current question. A matching scope identity does not make two activities automatically interchangeable.
26
+
27
+ Allow dirty working trees. A commit plus a dirty observation says that the working material differed from the commit; it does not preserve those differences. An optional `accrete result capture` says exactly which paths were captured and what was omitted. A selected source bundle can be retained as Data and linked in the Result when more material is needed.
28
+
29
+ ## Iterations
30
+
31
+ An iteration retains a named development effort around a Model. It typically describes a purpose, starting revision, branch or worktree, and eventual outcome and summary. It can begin before development or be attached to work already in progress. It has no required agent session, worker assignment, planning ceremony, or scientific approval state.
32
+
33
+ | Moment | Meaning retained by ACCRETE | Work performed through ordinary tools |
34
+ | --- | --- | --- |
35
+ | Open | Purpose, Model, starting revision, and any worktree | Choose the question and prepare existing material |
36
+ | Develop | Further activity can be associated through Results and Memory | Edit, compile, run, inspect, commit |
37
+ | Integrate | Outcome may name the integrated commits | Merge, cherry-pick, rebase, or retain branches according to the project |
38
+ | Close | Authored outcome, such as integrated or retained separately; relevant revisions | Decide how later work should continue |
39
+ | Clean up | Separate explicit `model iteration remove-worktree` | Delete a branch with Git when appropriate |
40
+
41
+ The outcome is an authored string. Use the project's language to describe what happened; the examples are not a fixed state enumeration. Closing does not imply success, merge a branch, remove an editing location, or erase outputs. An abandoned implementation can still explain a useful observation. An iteration retained separately can remain the basis of later development.
42
+
43
+ Use worktrees on the actual Model repository for overlapping edits. An isolated outer project checkout can still refer to the same external Model checkout as another worker. Supply each worker with the Model path it should edit and the ACCRETE project root it should use for organizational writes.
44
+
45
+ ## Roles and other objects
46
+
47
+ `reference`, `target`, and similar names describe the Model's role in a particular activity. A Model serving as a reference today can be developed tomorrow. The descriptor's aliases help people find it; they do not establish permanent subclasses or a universal rule against editing reference code.
48
+
49
+ | Relationship | What to retain |
50
+ | --- | --- |
51
+ | Result uses a Model | Model ID, activity role, and execution revision when known |
52
+ | Iteration develops a Model | Model ID, starting revision, purpose, worktree binding, outcome, and commits |
53
+ | Tool acts on a Model | The Tool explains applicable source, build, diagnostic, or execution conventions |
54
+ | Data captures selected source or output | Its own identity, material description, and origin; the Result links the relevant objects |
55
+ | Memory explains development | Interpretation scoped to the relevant revision, Result, or conditions |
56
+
57
+ An association may be meaningful even when the checkout is unavailable locally. Preserve a remotely supplied revision and path context without downloading a repository merely to make the metadata complete. Current availability can be resolved separately when the work needs the material.
58
+
59
+ ## Retaining cited history
60
+
61
+ The Kernel retains a locally available commit cited by a Result or an iteration close with a native Git ref such as `refs/accrete/retained/<object-id>`. This helps keep an unmerged or detached commit available after ordinary branch cleanup. Read the mutation receipt to learn whether retention succeeded; a read-only repository may remain only a citation.
62
+
63
+ Those refs are local. Normal clone, push, or bundle behavior must not be assumed to include arbitrary ref namespaces. Transport the specific retained refs when another host needs them, alongside the relevant repository and project metadata. This is native Git work, separate from the Model's identity or an iteration's close operation.
64
+
65
+ Retiring a Model with `model retire` ends its current use and leaves the repository, checkouts, and earlier Results alone.
66
+
67
+ The Model ID, commit, worktree, and optional capture answer different practical questions. Keep each association at the scope that was actually observed so the next session can use it without reconstructing an invented certainty.
@@ -0,0 +1,48 @@
1
+ # Model work across sessions and machines
2
+
3
+ ## Continue from the material already available
4
+
5
+ Start with the owner's current question, the Model's relevant source and history, and Memory that helps that question. Read the specific earlier Results that the reasoning depends on. A past Result remains about the code and conditions it names. Trust retained work within that scope; repeating it is a scientific or engineering decision tied to the present task.
6
+
7
+ Ordinary exploration needs no preliminary object write. A short source investigation can remain Scratch. Open an iteration when a named development effort, a separate branch, or a useful retained outcome would make continuation easier. Record Results for activities whose observations merit future use and Memory for the interpretation that should accompany them.
8
+
9
+ ## Embedded programs and changing project commits
10
+
11
+ When source and research notes share a repository, describe implementation changes at the relevant scope. For example, a new Memory entry can advance the repository commit while the solver subtree is unchanged. Use native Git to inspect those paths and build inputs. The historical commit remains useful; scoped content identities add an explanation rather than replace it.
12
+
13
+ Avoid inferring that an experiment must be repeated simply because root `HEAD` advanced. Equally, a matching solver subtree does not establish that the executable, environment, input data, or diagnostic were unchanged. Describe these conditions at their proper scope and use the task's scientific reasoning to decide the next action.
14
+
15
+ ## Concurrent development
16
+
17
+ Give overlapping source work independent worktrees of the actual Model repository. Each worker needs the Model checkout, ACCRETE project root, intended base, useful constraints, and where to return its changes. Share read-only datasets and existing Results where appropriate. Use distinct Scratch and compilation-cache locations when the project's tooling requires them.
18
+
19
+ A worker editing an external Model can call the Kernel with an explicit owning project root. That does not require installing `AGENTS.md` into every Model repository. Pass the relevant project guidance with the brief or through a documented host mechanism when the host session starts outside the project.
20
+
21
+ Let the Coordinator choose ordinary Git integration: merge, cherry-pick, rebase, keep separate, or abandon. An iteration-close write follows the actual outcome. It supplies no implicit merge and no permission to remove the worker's checkout. If the project retains an unmerged commit, include the available retention information in the handover.
22
+
23
+ ## Capture what the activity used
24
+
25
+ For a launch under your control, observe the checkout and relevant environment when preparing the actual execution. A Python invocation can load an installed package from somewhere other than the apparent working directory; a build can use artifacts from another source tree. Domain launchers should describe the implementation and runtime they actually selected.
26
+
27
+ For an activity that already happened, use its launch record, known historical revision, and retained execution material. Today's `HEAD` is not evidence of the previous execution revision. If only the current checkout is available, keep that as a separately timed observation and leave the historical execution identity unknown.
28
+
29
+ Uncommitted work is normal. If a source capture is useful, decide its scope explicitly. `git diff HEAD` excludes untracked files; text-only diffs may omit the content of binary changes. Neither form captures external dependencies or ignored build products. `accrete result capture --checkout PATH --path SOURCE_PATH --to DIRECTORY` writes a binary diff plus selected untracked files, with a manifest of its scope. A project Tool can prepare a broader source bundle or environment artifact and register it as Data when the task requires that.
30
+
31
+ ## Carry history to another host
32
+
33
+ The project metadata can travel through the project's normal Git arrangement, or `accrete export` and `accrete import`, while the Model repository travels independently. Source hints and Model IDs remain portable; `accrete model bind` sets each host's concrete path. A received Result can be read before its Model is downloaded.
34
+
35
+ When another machine needs an unmerged or detached commit, inspect the relevant repository's retained refs and deliberately transport those refs using native Git. A typical named ref can be sent with an explicit refspec or included in a Git bundle. Use the actual ref named in the receipt, and follow the project's chosen remote and transport arrangement.
36
+
37
+ ```text
38
+ git -C MODEL_CHECKOUT show-ref refs/accrete/retained/OBJECT_ID
39
+ git -C MODEL_CHECKOUT bundle create DESTINATION.bundle refs/accrete/retained/OBJECT_ID
40
+ ```
41
+
42
+ These are native Git forms with values to supply. They do not promise that every referenced commit has an ACCRETE retention ref. A read-only or unavailable repository may prevent local retention; the Result remains a citation with that limitation.
43
+
44
+ ## Return enough for continuation
45
+
46
+ Use a plain-language handover. State the question addressed, what changed or was learned, the concrete checkout and commit, meaningful outputs, any Results or Memory written, and what remains unresolved. Name the actual state of long-running computations using their native runtime evidence when relevant.
47
+
48
+ Keep code outcome, observation, interpretation, and next direction distinguishable. A trace failure can explain a Model defect without producing a simulated trajectory. An implementation improvement can be ready for another experiment without establishing its scientific consequence. Retain each contribution at the scope it supports so subsequent work can proceed naturally.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: accrete-results
3
+ description: Preserve meaningful activities and observations as ACCRETE Results. Use for simulations, comparisons, analyses, benchmarks, transformations, failed attempts, retrospective execution descriptions, completion updates, or links between Model revisions, Tools, input Data, and retained outputs. Execute work with native tools and use the Kernel for durable Result writes.
4
+ ---
5
+
6
+ # ACCRETE Results
7
+
8
+ Retain what an activity involved and what was observed when that description
9
+ will help continuing work. A Result can describe a simulation, failed build,
10
+ numerical comparison, performance measurement, data transformation, or analysis.
11
+ Create it before, during, or after the activity as useful. The research process
12
+ does not depend on a mandatory registration sequence or run wrapper.
13
+
14
+ ## Select the change that matches the activity
15
+
16
+ | Situation | Action |
17
+ | --- | --- |
18
+ | Retain a newly described activity | Draft structured input and call `accrete result record`. |
19
+ | Add one observation to a known activity | Call `accrete result observe`. |
20
+ | Correct associations or add structured completion information | Call `accrete result amend` using the current revision. |
21
+ | Keep dirty working source beyond its checkout | Call `accrete result capture` and register the directory as Data if useful. |
22
+ | Execute a new attempt | Run it natively and normally give it a new Result ID if retained. |
23
+ | Reinterpret an earlier result | Write linked Memory; retain a new analysis Result if useful. |
24
+ | Find present process state | Use the scheduler, process tools, logs, or domain launcher. |
25
+
26
+ Describe only what is known. A historical Model revision comes from the
27
+ execution's own information, not today's checkout HEAD. Missing environment
28
+ details or absent outputs remain missing. A trace failure before simulation
29
+ steps is a useful failure description; it is not a completed simulation with
30
+ empty output. Dirty working content is allowed and should be described within
31
+ what was captured.
32
+
33
+ ## Connect the useful objects
34
+
35
+ Associate relevant Model revisions and their roles, Tool implementations,
36
+ input Data, output Data, and related Results. Keep roles and domain measurements
37
+ in ordinary structured values. A pair of run legs and their comparison can be
38
+ linked without introducing a universal Experiment/Run/Trial hierarchy.
39
+
40
+ Use Data for retained products and locations. Use Memory for interpretations,
41
+ why a direction was chosen, and what later work can build on. Result publication
42
+ preserves an activity description; its content can still describe an ongoing,
43
+ incomplete, or failed activity. A draft in Scratch has not yet been published.
44
+
45
+ ## Preserve completed work through partial failures
46
+
47
+ Publish managed Result changes through the native Kernel. A successful document
48
+ publication with `index_pending` means the Result exists: refresh the SQL
49
+ projection instead of creating it again. For an interrupted acknowledgment,
50
+ reuse the supplied stable ID or operation ID and inspect the reported receipt. For
51
+ uncertain durability, run `accrete recover`. Resolve revision conflicts by reading the current document
52
+ and retaining independent contributions. Never rerun scientific computation to
53
+ repair a Result or its index.
54
+
55
+ Read existing JSON, Git history, logs, and the host-local SQLite projection
56
+ with native tools; `accrete config resolve --json` gives the index path at
57
+ `.local_state.index`, for `sqlite3 -readonly`. Use the configured project roots and explicit `--project`
58
+ selection when outside the ACCRETE root.
59
+
60
+ ## Read when needed
61
+
62
+ - [Activities and relationships](references/activities-and-relations.md):
63
+ execution identity, unknowns, content, roles, and related activities.
64
+ - [Command manual](references/commands.md): input drafts, writes,
65
+ amendments, independent observations, source capture, and operation receipts.
66
+ - [Scientific practice](references/scientific-practice.md): long runs,
67
+ comparisons, failures, remote work, and evolving interpretation.
68
+
69
+ `accrete result COMMAND --help` prints the flags.
@@ -0,0 +1,116 @@
1
+ # Activities and relationships
2
+
3
+ ## Contents
4
+
5
+ - What a Result preserves
6
+ - Execution identity
7
+ - Publication, drafts, and activity completion
8
+ - Relations and attempts
9
+ - Native reading
10
+
11
+ ## What a Result preserves
12
+
13
+ Preserve enough context for later work to understand an activity and use its
14
+ observations. Useful information includes:
15
+
16
+ | Information | Purpose |
17
+ | --- | --- |
18
+ | Activity label and description | Explain what was attempted or performed. |
19
+ | Relevant Model IDs and revisions | Name programs associated with execution. |
20
+ | Tool IDs and observed implementations | Identify capabilities used to obtain the observations. |
21
+ | Input and output Data with roles | Connect retained materials to their use. |
22
+ | Execution description | Preserve supplied host, environment, arguments, times, and runtime details. |
23
+ | Observations | An array holding small measurements or prose; link larger products as Data. |
24
+ | Related Results | Connect comparisons, independent legs, attempts, and continuations. |
25
+
26
+ No field of a Result input is mechanically required by the Kernel. `execution` and
27
+ `observations` are free-form. Leave unavailable information absent or explicitly
28
+ null. Keep domain fields supplied by the scientific Tool. The
29
+ Kernel need not understand a climate calendar, numerical diagnostic, or
30
+ performance metric to preserve it.
31
+
32
+ Describe units, averaging periods, domains, denominators, and comparison
33
+ definitions where they affect interpretation. These are domain choices that
34
+ make the observation usable; they are not a universal Result approval process.
35
+
36
+ ## Execution identity
37
+
38
+ A Model commit identifies a repository snapshot. It may include changes to
39
+ notes unrelated to the program. Optional native source-tree identities can
40
+ describe a selected source scope, while dependencies and execution conditions
41
+ still matter. Preserve the scope's actual meaning instead of treating matching
42
+ tree identities as automatic scientific equivalence.
43
+
44
+ The associated implementation must describe what the activity used. For a
45
+ retrospective Result, the latest `git rev-parse HEAD` is only a present checkout
46
+ observation. Use execution-time metadata, a retained checkout, a launcher
47
+ description, or an explicit historical revision when available. Otherwise
48
+ leave the execution revision unknown. The same applies to a Tool, installed
49
+ binary, Python environment, and runtime arguments.
50
+
51
+ Exploratory dirty work is valid. State the observed commit and known changes.
52
+ A patch may omit untracked files, ignored files, binary content, or external
53
+ dependencies; name the capture scope without claiming complete recovery.
54
+ `accrete result capture` writes a selected diff and untracked files with a manifest
55
+ of that scope. Register selected source bundles or environment artifacts as Data if the
56
+ project chooses to retain them.
57
+
58
+ ## Publication, drafts, and activity completion
59
+
60
+ A draft JSON file under Scratch is working material. `result record` publishes
61
+ the durable activity description. Publication is an organizational operation;
62
+ it does not declare that the activity completed or that its interpretation is
63
+ accepted. The activity may still be running, partially complete, or failed.
64
+
65
+ An old `running` observation remains historical. Use native process state for
66
+ current status. A reported success from a launcher can be preserved as that
67
+ launcher's report; distinguish it from the observations that support a
68
+ scientific conclusion.
69
+
70
+ Failed, incomplete, unknown, and absent describe different situations. A
71
+ compilation failure, a job lost after several output intervals, and a completed
72
+ simulation whose outputs have not yet transferred should retain those distinct
73
+ descriptions. Avoid filling missing fields with success-shaped defaults.
74
+
75
+ ## Relations and attempts
76
+
77
+ Give a genuinely new execution its own Result ID when retaining it. Similar
78
+ configuration does not make two runs the same activity. A continuation of the
79
+ same computation can append to its Result or become a linked continuation,
80
+ according to the domain Tool's meaning.
81
+
82
+ A multi-leg comparison can retain each leg and a separate comparison activity.
83
+ Use meaningful related-result roles to explain the relation. A project can
84
+ describe a larger experiment with an additional linked Result if useful;
85
+ there is no required hierarchy or fixed number of levels.
86
+
87
+ Input/output links describe participation. Add explicit derivation only when
88
+ the project knows that stronger relation. A Result containing several inputs
89
+ and outputs does not imply that each output derives from all inputs.
90
+
91
+ Related objects may be unresolved on the current host. A remote Result can
92
+ name Data left on a compute host or a Model commit absent from the local clone.
93
+ Preserve those links without inventing checkouts or downloading bytes.
94
+
95
+ Registering Data and associating it with a Result may be two completed writes.
96
+ If the second stops, keep the Data identity and finish the association later.
97
+ A metadata gap does not invalidate the completed scientific product.
98
+
99
+ ## Native reading
100
+
101
+ Use ordinary tools to inspect the actual representation. For default roots:
102
+
103
+ ```sh
104
+ rg 'routing|compilation|comparison' results
105
+ jq '.observations[]' /actual/result/document.json
106
+ ```
107
+
108
+ Select actual paths from configuration or mutation receipts. Read Git history
109
+ with Git and output arrays with their scientific libraries. Open the index with
110
+ `sqlite3 -readonly` at the path in `.local_state.index` from `accrete config resolve
111
+ --json`, and inspect `.schema` before writing SQL. A brief "database is locked" during a concurrent refresh means retry. The index is a
112
+ host-local projection; a Git pull can update documents before it is refreshed.
113
+ `accrete index refresh` repairs that projection without changing the activity.
114
+
115
+ Use Memory search to understand later interpretations. Preserve the execution
116
+ description when a later insight changes what the observations suggest.
@@ -0,0 +1,191 @@
1
+ # Result command manual
2
+
3
+ ## Contents
4
+
5
+ - Interface and input drafts
6
+ - Record an activity
7
+ - Amend structured information
8
+ - Append an independent observation
9
+ - Capture selected source
10
+ - Interpret outcomes and retry
11
+
12
+ ## Interface and input drafts
13
+
14
+ This manual covers the Result commands. `.accrete/docs/cli-contract.md` has the
15
+ shared conventions and `accrete result COMMAND --help` prints the flags. Do not
16
+ write persistent Result JSON or SQLite with a replacement script.
17
+
18
+ Global options are `--project DIRECTORY` and `--json`; `ACCRETE_PROJECT` selects
19
+ the project when no explicit path is supplied. Otherwise discovery starts
20
+ from the current directory. Select the ACCRETE root explicitly when using an
21
+ external Model checkout. Native scientific commands retain their ordinary
22
+ working directory and execution interface.
23
+
24
+ Draft structured inputs with an editor or domain Tool. The Kernel owns the
25
+ durable envelope, default UUID allocation, publication, revision comparison, and index
26
+ projection. Default Result paths are under `results/`; configuration and
27
+ mutation receipts identify the actual path.
28
+
29
+ ## Record an activity
30
+
31
+ ```sh
32
+ accrete --json result record --from scratch/result.json \
33
+ > scratch/result-receipt.json
34
+ ```
35
+
36
+ The following draft illustrates an analysis for which implementation revisions
37
+ were not retained. It deliberately leaves them unknown. Replace the example
38
+ object IDs and domain content with the actual associations before use.
39
+
40
+ ```json
41
+ {
42
+ "name": "first-year-comparison",
43
+ "activity": "Compare selected first-year diagnostics",
44
+ "models": [
45
+ {
46
+ "model_id": "model-main",
47
+ "role": "target",
48
+ "commit": null,
49
+ "dirty": null
50
+ }
51
+ ],
52
+ "tools": [
53
+ {
54
+ "tool_id": "tool-residual",
55
+ "revision": null
56
+ }
57
+ ],
58
+ "inputs": [
59
+ {
60
+ "data_id": "year-1-diagnostics",
61
+ "role": "diagnostics"
62
+ }
63
+ ],
64
+ "outputs": [],
65
+ "execution": {
66
+ "reported_outcome": "completed",
67
+ "description": "Retrospective description; execution revisions were unavailable."
68
+ },
69
+ "observations": [
70
+ {
71
+ "text": "The analysis completed; detailed conclusions are in the linked project notes."
72
+ }
73
+ ],
74
+ "related_results": []
75
+ }
76
+ ```
77
+
78
+ Omit unused association arrays or unknown fields. Supply known Git revisions and observed dirty state instead of
79
+ nulls when execution information exists. Never fill a historical revision from
80
+ today's checkout just to remove a null.
81
+
82
+ | Draft field | Meaning |
83
+ | --- | --- |
84
+ | `name` | Optional short label. The index `name` column falls back to `activity`. |
85
+ | `activity` | Optional human description of the retained activity. |
86
+ | `models[]` | `{model_id, role?, commit: null|string, dirty: null|boolean}`. |
87
+ | `tools[]` | `{tool_id, revision: null|string}` for actual implementation knowledge. |
88
+ | `inputs[]`, `outputs[]` | `{data_id, role?}` associations. |
89
+ | `execution` | Domain-supplied execution description; distinguish execution time from later observation time. |
90
+ | `observations[]` | Array of free-form objects, conventionally with `text`: measurements, prose, and useful domain context. |
91
+ | `related_results[]` | `{result_id, role?}` links to legs, attempts, comparisons, or continuations. |
92
+
93
+ A supplied stable `id` or `--id` can support retries when creating the same Result.
94
+ The same ID with the same submitted content is idempotent; different content
95
+ requires an amendment or produces a conflict. IDs are 1-180 ASCII letters, digits,
96
+ dots, underscores or hyphens, and not `.` or `..`. Keep unknown project extension
97
+ fields when constructing any replacement or merge input.
98
+
99
+ `--name` and `--description` override the draft's fields. `--observe-checkout PATH`
100
+ adds the checkout's current state as a separately labelled `recording_observation`;
101
+ it does not fill any execution revision.
102
+
103
+ The receipt supplies `object_id`, `path`, and `revision`. Use those values for
104
+ subsequent associations; the filename is not the semantic identity. For a `models[]`
105
+ member with a `commit` and a local checkout, the receipt also names the ref that
106
+ keeps that commit, or a warning saying why it could not.
107
+
108
+ ## Amend structured information
109
+
110
+ ```sh
111
+ accrete --json result amend "$RESULT_ID" \
112
+ --from scratch/change.json --expect "$REVISION"
113
+ ```
114
+
115
+ The patch is a JSON Merge Patch of editable Result fields. Objects
116
+ merge recursively; arrays are replaced as complete arrays; `null` removes a
117
+ key in a patch. Identity, kind, and format fields are not editable through an
118
+ ordinary amendment. Do not use a null patch value to mean unknown without
119
+ considering its removal semantics.
120
+
121
+ For example, a draft adding completion description can contain:
122
+
123
+ ```json
124
+ {
125
+ "execution": {
126
+ "reported_outcome": "completed",
127
+ "description": "The final closed output was retained and associated."
128
+ }
129
+ }
130
+ ```
131
+
132
+ When changing an association array, read the current Result and include all
133
+ members that should remain. Do not replace the array with only the new member.
134
+ Use the expected revision corresponding to that read. A successful earlier
135
+ receipt is usable only while the document still has that revision. A revision is
136
+ the SHA-256 of the document's exact bytes, so any SHA-256 tool can compute it.
137
+
138
+ A revision conflict leaves current content and your draft intact. Read the
139
+ current document, incorporate independent contributions, and submit the intended
140
+ patch with its current revision. Do not weaken the expected-revision condition
141
+ to force a stale draft through.
142
+
143
+ ## Append an independent observation
144
+
145
+ ```sh
146
+ accrete --json result observe "$RESULT_ID" \
147
+ --text-file scratch/observation.md
148
+ ```
149
+
150
+ Use this for a new independent observation whose meaning does not require
151
+ replacing the whole description. The Kernel appends a member to the `observations`
152
+ array, serialized locally. When a launcher needs retry protection, supply
153
+ `--operation-id ID`. The same operation ID and text append once; reusing it with
154
+ changed text is a conflict.
155
+
156
+ Use an amendment for structured corrections or associations. Use later linked
157
+ Memory for a changed scientific interpretation. An observation of a process at
158
+ a particular time does not establish its present state indefinitely.
159
+
160
+ ## Capture selected source
161
+
162
+ ```sh
163
+ accrete --json result capture --checkout ../numerical-model \
164
+ --path src --path pyproject.toml --to scratch/source-capture
165
+ ```
166
+
167
+ Use this when dirty working source should survive beyond the checkout. It writes a
168
+ binary Git diff against `HEAD` and the selected nonignored untracked regular files to
169
+ a new directory, with a manifest stating the captured scope. Repeat `--path`.
170
+ Ignored products, external dependencies and runtime state stay outside it, so it is
171
+ not a complete executable environment. Capture publishes no object; register the
172
+ directory as Data if it should be retained, and link it from the Result.
173
+
174
+ ## Interpret outcomes and retry
175
+
176
+ A successful publication returns `committed: true`. If `index_pending: true`,
177
+ the Result still exists and the operation is successful; run:
178
+
179
+ ```sh
180
+ accrete index refresh
181
+ ```
182
+
183
+ Do not call `result record` with a new ID to repair that projection. After an
184
+ uncertain acknowledgment, use a supplied stable ID or operation ID to reconcile
185
+ the same operation. If publication is visible but durability is uncertain (exit 8),
186
+ keep the published path and run `accrete recover`. Inspect before interpreting a
187
+ nonzero exit as “nothing changed.”
188
+
189
+ Recovery repairs metadata or associated native side effects. It never launches
190
+ the scientific calculation again. A new execution is an explicit domain action
191
+ with its own meaning and normally a new Result identity.
@@ -0,0 +1,89 @@
1
+ # Results in continuing scientific work
2
+
3
+ ## Comparisons
4
+
5
+ Retain the programs and data that actually participated in each leg. The role
6
+ `reference` belongs to the comparison; it does not make a Model permanently
7
+ immutable or place it in a separate Kernel class. Describe each leg's execution
8
+ revision, initial state, forcing, runtime conditions, and known differences
9
+ when useful to the interpretation.
10
+
11
+ Store compact measurements in observations and large histories or diagnostics
12
+ as Data. A comparison Result can link the leg Results, the analysis Tool used,
13
+ and the selected output products. Explain metric definitions in its description
14
+ or associated domain Tool. The Coordinator decides what constitutes an adequate
15
+ comparison and which further work is warranted.
16
+
17
+ Historical Results describe their named implementations. Advancing a Model
18
+ branch or changing a comparator does not retroactively change those Results.
19
+ A new analysis of old products can have a new Result and linked Memory.
20
+
21
+ ## Long-running computation
22
+
23
+ A Result can be introduced before launch, after a useful milestone, or after
24
+ completion. Choose according to what helps the work. No ACCRETE wrapper is
25
+ required around `python`, `mpirun`, `sbatch`, `nohup`, or a domain launcher.
26
+
27
+ Retain activity times and publication times separately when they differ.
28
+ An observation may describe a completed interval or partial output. Keep the
29
+ scientific time coordinate in domain fields; a metadata timestamp does not
30
+ replace the simulation calendar.
31
+
32
+ Register completed output products independently when useful. Later stages
33
+ can produce new Data and append observations to an existing activity, or create
34
+ related continuation Results. Let the program's actual continuity determine
35
+ that choice rather than a fixed template workflow.
36
+
37
+ Use the owning scheduler, launcher, logs, or process table to determine present
38
+ execution state. The last durable observation can guide where to look but
39
+ does not keep itself current.
40
+
41
+ ## Failed and incomplete attempts
42
+
43
+ A failed attempt can be worth retaining because its cause, surviving output,
44
+ or execution conditions help future work. State where it stopped and what
45
+ actually happened. For example, a failure during tracing before compilation
46
+ or time stepping has no simulated history; a run interrupted after several
47
+ days may have valid closed products for those days.
48
+
49
+ Keep the failed attempt's identity when recording a diagnosis. If a corrected
50
+ implementation is launched again, retain a new Result linked to the earlier
51
+ attempt. A repeated CLI write after an uncertain acknowledgment is different:
52
+ it attempts to persist the same activity description and should reuse its
53
+ stable ID.
54
+
55
+ Do not rerun an expensive experiment merely because its JSON index is stale,
56
+ its output location association is incomplete, or its Result needs correction.
57
+ Repair the specific persistence step using the existing activity material, with
58
+ `accrete index refresh`, `accrete recover`, or an amendment.
59
+
60
+ ## Remote work
61
+
62
+ Record the execution information available where the work runs. Small Result
63
+ documents and Memory can travel by the project's Git or `accrete export` and
64
+ `accrete import` while
65
+ large products remain on the compute host. Materialize selected Data when local
66
+ analysis requires it. Receiving a Result does not imply that its inputs, outputs,
67
+ or cited Git commits were transported with it.
68
+
69
+ Use host-local Kernel state and a separate metadata view or a selected writing
70
+ host. Local locks and SQLite do not establish coordinated multi-host writes to
71
+ a shared network directory. Where `import` meets divergent content under one
72
+ stable ID, it reports a conflict; preserve both drafts and resolve the difference.
73
+ Do not choose the latest timestamp automatically.
74
+
75
+ ## Interpretation and accumulated experience
76
+
77
+ Use Result amendments for corrected activity descriptions or associations.
78
+ Use independent observations for additional measurements or contextual notes.
79
+ Use Memory for a changed explanation, a useful lesson, or a next direction.
80
+ Link the relevant Result IDs and state the limits of the interpretation.
81
+
82
+ Trust prior work within its documented scope. Repeat it when the current task
83
+ or a concrete changed condition calls for repetition. A template should not
84
+ force every session to reconfirm inherited experiments before useful new work.
85
+
86
+ A useful handover names the completed activity, Result and Data IDs, concrete
87
+ paths, execution revisions when known, and any unfinished publication or
88
+ transfer step. It also says what the observations suggest. That gives the next
89
+ agent enough context without turning the return into a rigid task schema.
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: accrete-tools
3
+ description: Retain and evolve ACCRETE project capabilities as Tools. Use when a useful script, program, knowledge guide, diagnostic, or Skill should acquire a project identity; when updating or binding its selected source, exposing it to Codex or Claude Code, refreshing discovery, exporting a local package, or retiring current use while preserving earlier associations.
4
+ ---
5
+
6
+ # ACCRETE Tools
7
+
8
+ Treat a Capability as something the project can understand or do. Treat its Tool as the durable project identity for the implementation and knowledge that makes that ability reusable. Treat a Skill as one host's discovery interface for it. A Tool can contain prose alone, a program alone, or both.
9
+
10
+ ## Develop the capability naturally
11
+
12
+ Write source, instructions, examples, or configuration with ordinary tools. A one-off script can stay in Scratch while it develops. Admit it when retaining its purpose and usable source would help subsequent work. Admission creates an identity; the Agent and owner judge usefulness through their work.
13
+
14
+ Choose a source location that the project can maintain: a normal project directory, an independent repository, or an explicitly associated external location. Use native Git when version history is useful. Preserve the language, environment, and native programs appropriate to the capability.
15
+
16
+ Keep code and knowledge together where that helps another Agent use the Tool. Explain its purpose, applicable inputs, practical action, meaningful outputs, and limits of interpretation. Make a Skill concise and put detailed operational knowledge in its source-relative references. A cognitive guide needs no invented executable entry point.
17
+
18
+ ## Use the right organizational operation
19
+
20
+ - Admit existing source with `tool admit` when it should become a retained project capability.
21
+ - Use `tool bind` to point this host at the Tool's source when it lives elsewhere here.
22
+ - Use `tool update` for descriptor changes or a deliberately selected source revision.
23
+ - Use `tool expose --agent codex|claude` to add a project-local discovery interface; use `tool refresh` to update existing managed discovery after source or description changes.
24
+ - Use `tool export` for an explicit local destination when material should be reused elsewhere.
25
+ - Use `tool retire` when ordinary discovery should stop; preserve the source and earlier Result associations.
26
+
27
+ Use the Kernel for these operations. Editing source, invoking its program, committing improvements, and publishing through a chosen external distribution channel remain ordinary work.
28
+
29
+ ## Distinguish source from exposure
30
+
31
+ Edit the Tool's source, including its source `SKILL.md`. A generated host wrapper points to that source and explains where relative references and executable paths resolve. Read the complete source instructions before using the capability. Keep `scripts/run.py` relative to the source directory, never to a wrapper directory.
32
+
33
+ The portable exposure is a real host Skill directory containing a wrapper. A supported symlink is an explicit alternative. One Tool can be available through both hosts without becoming two Tools. Foundational ACCRETE Skills are distribution snapshots; domain Tool sources evolve with project practice.
34
+
35
+ A **live** source binding follows the editable source. A **retained** binding refers to material that actually corresponds to the selected revision, such as a dedicated checkout or export. Prepare that material with native tools. Refreshing discovery never checks out a selected historical revision into an unrelated active working tree.
36
+
37
+ If the source is unavailable or the retained material has not been supplied, preserve the Tool and report pending exposure. Read the receipt for the interfaces actually installed. A running Agent may still hold earlier instructions; name consequential changes in the handover and have subsequent work load the changed source explicitly.
38
+
39
+ ## Associate actual use and accumulated experience
40
+
41
+ Record the Tool ID in a Result when the capability helped produce a retained activity. Supply the implementation actually used when known: source commit, entry point, artifact identity, and useful execution conditions. A live Tool's admission-time commit does not establish the version used later.
42
+
43
+ Retain interpretation and reusable lessons in Memory, and improve the Tool when those lessons belong in its operating knowledge. Do not rewrite earlier Results to match the Tool's latest behavior. Export only the intended material and use the project's ordinary publishing mechanism for any later external distribution.
44
+
45
+ ## References
46
+
47
+ - [Object meaning and relationships](references/objects.md): Capability, Tool, Skill, live and retained binding, identities, and retirement.
48
+ - [Kernel operations](references/cli.md): input drafts, command forms, exposure destinations, receipts, and incomplete operations.
49
+ - [Developing useful capabilities](references/working-practice.md): agent-oriented instructions, source-relative resources, long-term improvement, and use from different hosts.
50
+
51
+ Read the installed `.accrete/docs/cli-contract.md` from the project root for the shared contract. `accrete tool COMMAND --help` prints the flags. On a host without the binary, retain input drafts in Scratch and continue useful source development.