atavi 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.
@@ -0,0 +1,167 @@
1
+ # Architecture
2
+
3
+ This document explains why ATAVI is shaped as a thin package plus a strict file
4
+ contract rather than a heavy orchestration runtime.
5
+
6
+ ## The core idea
7
+
8
+ ATAVI is not the orchestrator. The host AI is.
9
+
10
+ That decision is deliberate:
11
+
12
+ - it keeps ATAVI host-agnostic
13
+ - it avoids duplicating auth, model routing, and search capabilities
14
+ - it lets the protocol evolve without shipping a long-running service
15
+
16
+ ATAVI therefore has two responsibilities:
17
+
18
+ 1. package the protocol surface cleanly
19
+ 2. make host execution inspectable and resumable through a local workspace
20
+
21
+ ## System model
22
+
23
+ ```text
24
+ Researcher / Product Builder
25
+ |
26
+ v
27
+ Host AI Environment
28
+ (Codex / Claude / Gemini)
29
+ |
30
+ | reads packaged protocol + templates
31
+ v
32
+ ATAVI
33
+ ----------------------------------
34
+ protocol/ATAVI.md
35
+ protocol/agents/*
36
+ templates/*
37
+ bin/atavi
38
+ src/scaffold + doctor helpers
39
+ ----------------------------------
40
+ |
41
+ | writes state
42
+ v
43
+ Project .atavi/
44
+ ----------------------------------
45
+ brief.md
46
+ config.json
47
+ status.md
48
+ conflicts.md
49
+ kill-log.md
50
+ run-log.md
51
+ pass-N/
52
+ registries/
53
+ memory/
54
+ ATAVI-REPORT.md
55
+ ----------------------------------
56
+ ```
57
+
58
+ ## Why the CLI stays thin
59
+
60
+ The spec explicitly says ATAVI is a protocol, not an application runtime.
61
+ The CLI should help the host find and scaffold the protocol, but should not
62
+ attempt to run multi-agent orchestration itself.
63
+
64
+ That means:
65
+
66
+ - `--path` exists so the host can load the packaged assets
67
+ - `init` exists so the host has a known workspace layout
68
+ - `doctor` exists so failures are obvious before a run starts
69
+
70
+ What the CLI should not do:
71
+
72
+ - call model APIs directly
73
+ - maintain its own orchestration daemon
74
+ - embed search credentials
75
+ - silently mutate the host environment
76
+
77
+ ## File-first state
78
+
79
+ ATAVI uses files as the contract between the host AI, the user, and future runs.
80
+ That is why `.atavi/` matters so much.
81
+
82
+ The benefits:
83
+
84
+ - every pass is inspectable
85
+ - interrupted runs are resumable
86
+ - memory can persist across runs
87
+ - humans can audit why an experiment survived or died
88
+
89
+ ## Canonical registries
90
+
91
+ The host AI owns three canonical registries inside `.atavi/registries/`:
92
+
93
+ - Claim Registry
94
+ - Experiment Ledger
95
+ - Prior Art Registry
96
+
97
+ Agents do not edit them directly. Agents propose changes in PODs and CPRs.
98
+ The host AI applies accepted changes during synthesis.
99
+
100
+ This is the key guardrail against drift and hidden state.
101
+
102
+ The root workspace also carries shared process artifacts such as `conflicts.md`,
103
+ `kill-log.md`, and `run-log.md` so synthesis and final reporting have stable
104
+ canonical locations.
105
+
106
+ Per-pass host artifacts live under `pass-N/`, where agent PODs, CPRs,
107
+ `synthesis.md`, and `decision.md` make each refinement cycle inspectable.
108
+
109
+ Reusable memory exports belong in the scoped bucket directories under
110
+ `.atavi/memory/`.
111
+
112
+ ## Memory architecture
113
+
114
+ ATAVI needs cross-run memory because the same researcher will often run related
115
+ projects over time. The architecture is intentionally explicit:
116
+
117
+ - prior art cache
118
+ - kill archive
119
+ - claim patterns
120
+ - convergence history
121
+ - strategy insights
122
+
123
+ The scaffold reflects those buckets directly under `.atavi/memory/` so the
124
+ host can persist artifacts without inventing ad hoc subdirectories.
125
+
126
+ Memory needs governance or it turns into an echo chamber. The package docs
127
+ therefore treat expiration, contradiction handling, weighting, and scoping as
128
+ first-class design constraints, not implementation polish.
129
+
130
+ Those constraints are expressed directly in the scaffolded memory bucket
131
+ READMEs so hosts have a canonical file format for durable memory exports.
132
+
133
+ ## Why committed assets matter
134
+
135
+ ATAVI should clone cleanly. A user should not need an invisible generator to
136
+ understand what the product is shipping. That is why the protocol markdown,
137
+ agent role files, and templates are committed as real files in git.
138
+
139
+ This mirrors one of the strongest repo patterns in `gstack`: serious artifacts
140
+ live in the repo, not behind a hidden build step.
141
+
142
+ ## Testing philosophy
143
+
144
+ There are three categories of failure this repo must catch:
145
+
146
+ 1. package drift
147
+ 2. scaffold drift
148
+ 3. behavioral drift
149
+
150
+ Package drift means a required protocol file disappeared or stopped shipping.
151
+ Scaffold drift means `init` no longer creates what the host expects.
152
+ Behavioral drift means commands like `--path` or `doctor` stop honoring the
153
+ contract.
154
+
155
+ The current test suite is designed around those three risks.
156
+
157
+ ## Future extension points
158
+
159
+ The current source tree leaves room for:
160
+
161
+ - richer config validation
162
+ - host-specific setup commands
163
+ - report rendering helpers
164
+ - memory import/export
165
+ - migration tooling for `.atavi/` schema changes
166
+
167
+ Those can be added without changing the core product model above.
package/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ - initialize ATAVI as a real package repository
6
+ - add thin CLI with `--path`, `init`, and `doctor`
7
+ - add protocol markdown, agent role files, and report templates
8
+ - add architecture, contribution, and testing docs
9
+ - add package-manifest verification and node test scaffolding
10
+ - add CI to enforce package and scaffold integrity
11
+ - expand `.atavi` scaffolding with explicit memory bucket directories
12
+ - add `validate` command for `.atavi/config.json` contract checks
13
+ - add pass and log placeholders to the `.atavi` scaffold contract
14
+ - add `resume-check` command for `.atavi/status.md` and resume validation
15
+ - add explicit per-pass synthesis and decision placeholders
16
+ - define canonical memory entry formats and governance fields
17
+ - add host loading and resume guidance for Codex, Claude, and Gemini
18
+ - add `migrate` command for safe workspace schema upgrades
19
+ - add memory import/export helpers for `.atavi/memory`
20
+ - add release-surface verification and npm-based CI coverage
@@ -0,0 +1,42 @@
1
+ # Contributing
2
+
3
+ ## Working rules
4
+
5
+ - Keep ATAVI host-agnostic.
6
+ - Do not turn the package into a proprietary orchestration runtime.
7
+ - Prefer committed protocol assets over generated hidden state.
8
+ - Preserve the file contract in `.atavi/`.
9
+ - Treat novelty gating and inspectability as non-negotiable.
10
+
11
+ ## Repo workflow
12
+
13
+ 1. Update docs first when the product contract changes.
14
+ 2. Update protocol files and templates when agent behavior changes.
15
+ 3. Update CLI code when scaffold or package behavior changes.
16
+ 4. Add or update tests for every contract-level change.
17
+ 5. Run `node scripts/check-manifest.js`.
18
+ 6. Run `node test/run-all.js`.
19
+
20
+ ## What changes require extra care
21
+
22
+ - renaming protocol or template files
23
+ - changing `.atavi/` scaffold output
24
+ - changing registry field names
25
+ - changing CLI output consumed by hosts
26
+
27
+ These are package contracts, not incidental implementation details.
28
+
29
+ ## Style
30
+
31
+ - Use plain Node APIs unless there is a strong reason not to.
32
+ - Keep commands small and composable.
33
+ - Prefer explicit file paths over hidden conventions.
34
+ - Document product-level reasoning in `ARCHITECTURE.md`, not scattered comments.
35
+
36
+ ## Pull request checklist
37
+
38
+ - README still matches the shipped commands.
39
+ - ARCHITECTURE still matches the product shape.
40
+ - protocol assets exist and are referenced correctly.
41
+ - tests cover the changed behavior.
42
+ - CI can run without hidden local dependencies.
package/HOSTS.md ADDED
@@ -0,0 +1,177 @@
1
+ # Host Guidance
2
+
3
+ ATAVI is a protocol package, not an orchestration runtime. This document covers
4
+ how a host should load the package, manage the `.atavi/` workspace, and resume
5
+ interrupted runs without inventing hidden state.
6
+
7
+ ## Purpose And Non-Goals
8
+
9
+ - ATAVI defines the file contract and protocol shape.
10
+ - The host AI performs orchestration.
11
+ - This guide explains load order, workspace usage, and artifact ownership.
12
+ - This guide does not turn ATAVI into a daemon, API service, or hidden runtime.
13
+
14
+ ## Shared Host Contract
15
+
16
+ Hosts should support:
17
+
18
+ - file I/O
19
+ - isolated agent contexts
20
+ - web search for valid Scout runs
21
+
22
+ Hosts should load:
23
+
24
+ - `protocol/ATAVI.md`
25
+ - relevant files under `protocol/agents/`
26
+ - templates under `templates/`
27
+ - `.atavi/brief.md`
28
+ - `.atavi/config.json`
29
+ - `.atavi/status.md`
30
+ - canonical registries and logs
31
+
32
+ ## Invocation Detection
33
+
34
+ Treat the run as ATAVI when the user explicitly asks for:
35
+
36
+ - `ATAVI`
37
+ - multi-agent research refinement
38
+ - novelty-gated experiment selection
39
+ - inspectable multi-pass research artifacts
40
+
41
+ Do not silently infer ATAVI for ordinary coding or review tasks.
42
+
43
+ ## Workspace Bootstrap
44
+
45
+ Recommended order:
46
+
47
+ 1. Run `atavi --path`.
48
+ 2. If `.atavi/` does not exist, run `atavi init .`.
49
+ 3. Run `atavi validate .` before starting a fresh loop.
50
+ 4. Run `atavi resume-check .` before resuming an interrupted loop.
51
+
52
+ Use the existing workspace when `.atavi/` already exists and passes validation.
53
+
54
+ ## Research Brief Confirmation
55
+
56
+ Before pass execution begins, confirm `.atavi/brief.md` contains:
57
+
58
+ - source spec or source artifact
59
+ - thesis or central question
60
+ - domain
61
+ - constraints
62
+ - novelty sources
63
+ - selected agents
64
+
65
+ If these are incomplete or contradictory, stop and ask the researcher.
66
+
67
+ ## Agent Selection Rules
68
+
69
+ Always include:
70
+
71
+ - Theorist
72
+ - Experimentalist
73
+ - Scout
74
+
75
+ Add Critic when:
76
+
77
+ - the cost of failure is high
78
+ - the work is irreversible
79
+ - the novelty landscape is crowded
80
+
81
+ Add Synthesist when:
82
+
83
+ - the problem spans multiple domains
84
+ - adjacent disciplines may contain useful methods
85
+
86
+ ## Pass Execution Contract
87
+
88
+ Hosts should write:
89
+
90
+ - PODs to `.atavi/pass-N/[agent]-pod.md`
91
+ - CPRs to `.atavi/pass-N/cross-pollination/[agent]-cpr.md`
92
+ - synthesis output to `.atavi/pass-N/synthesis.md`
93
+ - decision output to `.atavi/pass-N/decision.md`
94
+
95
+ Hosts should also maintain:
96
+
97
+ - `.atavi/registries/claims.md`
98
+ - `.atavi/registries/experiments.md`
99
+ - `.atavi/registries/prior-art.md`
100
+ - `.atavi/conflicts.md`
101
+ - `.atavi/kill-log.md`
102
+ - `.atavi/run-log.md`
103
+
104
+ ## Registry Ownership And Synthesis
105
+
106
+ Agents propose changes in PODs and CPRs. The host applies accepted changes to
107
+ the canonical registries and logs during synthesis. Registry state should not
108
+ exist only in chat output.
109
+
110
+ ## Novelty And Memory Recording
111
+
112
+ - Claim-level novelty evidence belongs in `.atavi/registries/prior-art.md`.
113
+ - Experiment-level novelty verdicts belong in `.atavi/registries/experiments.md`.
114
+ - Reusable memory exports belong in `.atavi/memory/` after the run.
115
+ - Hosts may use `atavi memory-export` and `atavi memory-import` to move durable
116
+ memory artifacts between workspaces without changing their contents.
117
+
118
+ ## Resume Workflow
119
+
120
+ When resuming:
121
+
122
+ 1. Run `atavi validate .`.
123
+ 2. Run `atavi resume-check .`.
124
+ 3. Read `.atavi/status.md`.
125
+ 4. Read `.atavi/run-log.md`.
126
+ 5. Inspect the latest `pass-N/` directory.
127
+ 6. Continue from the recorded phase instead of regenerating prior artifacts.
128
+
129
+ `resume-check` guarantees structural resume safety for the current package
130
+ contract. It does not decide the next research action for the host.
131
+
132
+ ## Codex
133
+
134
+ Recommended load order:
135
+
136
+ 1. `atavi --path`
137
+ 2. `protocol/ATAVI.md`
138
+ 3. required role files under `protocol/agents/`
139
+ 4. `.atavi/brief.md`, `.atavi/config.json`, `.atavi/status.md`
140
+ 5. registries, logs, and latest `pass-N/` artifacts
141
+
142
+ Codex should keep orchestration file-first and write durable artifacts into
143
+ `.atavi/` rather than relying on hidden memory.
144
+
145
+ ## Claude
146
+
147
+ Recommended load order:
148
+
149
+ 1. `atavi --path`
150
+ 2. `protocol/ATAVI.md`
151
+ 3. relevant role files and templates
152
+ 4. `.atavi/brief.md`, `.atavi/config.json`, `.atavi/status.md`
153
+ 5. registries, logs, and existing pass artifacts
154
+
155
+ Claude should treat `.atavi/` as the source of truth for resumability and audit.
156
+
157
+ ## Gemini
158
+
159
+ Recommended load order:
160
+
161
+ 1. `atavi --path`
162
+ 2. `protocol/ATAVI.md`
163
+ 3. relevant role files and templates
164
+ 4. `.atavi/brief.md`, `.atavi/config.json`, `.atavi/status.md`
165
+ 5. registries, logs, and existing pass artifacts
166
+
167
+ Gemini should preserve the same file contract as every other host.
168
+
169
+ ## Failure Modes And Escalation
170
+
171
+ Hosts should stop and ask the researcher when:
172
+
173
+ - config validation fails
174
+ - resume-state validation fails
175
+ - Scout-valid web search is unavailable
176
+ - the brief is contradictory or under-specified
177
+ - early convergence appears suspicious and requires an adversarial pass
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md ADDED
@@ -0,0 +1,232 @@
1
+ # ATAVI
2
+
3
+ ATAVI is a host-agnostic multi-agent research refinement protocol. It gives a
4
+ host AI a strict file-first workflow for:
5
+
6
+ - formalizing claims
7
+ - designing experiments
8
+ - checking novelty
9
+ - forcing cross-pollination between roles
10
+ - converging on the smallest high-signal experiment slate
11
+ - leaving an inspectable paper trail in `.atavi/`
12
+
13
+ ATAVI is intentionally thin. The package does not run the research loop for
14
+ you. It ships the protocol, role files, templates, and CLI helpers that a host
15
+ AI can load and execute.
16
+
17
+ ## What You Get
18
+
19
+ The package ships:
20
+
21
+ - `protocol/ATAVI.md` as the canonical protocol
22
+ - `protocol/agents/*` for Theorist, Experimentalist, Scout, Critic, and Synthesist
23
+ - `templates/*` for briefs, PODs, CPRs, and final reports
24
+ - `bin/atavi.js` as the CLI entrypoint
25
+ - `HOSTS.md` for Codex, Claude, and Gemini loading guidance
26
+ - scaffold, validation, migration, and memory-transfer helpers
27
+
28
+ ## Requirements
29
+
30
+ - Node.js `>=20`
31
+ - a host AI that can read and write files
32
+ - web search capability for valid Scout runs
33
+
34
+ Without web search, Scout mode and full novelty gating are not valid.
35
+
36
+ ## Install
37
+
38
+ ### Global install
39
+
40
+ ```bash
41
+ npm install -g atavi
42
+ ```
43
+
44
+ ### Run with `npx`
45
+
46
+ ```bash
47
+ npx atavi --help
48
+ ```
49
+
50
+ ### Run from a local checkout
51
+
52
+ ```bash
53
+ git clone https://github.com/mechramc/Atavi.git
54
+ cd Atavi
55
+ npm install
56
+ node bin/atavi.js --help
57
+ ```
58
+
59
+ ## Quick Start
60
+
61
+ ### 1. Create a workspace
62
+
63
+ From the project you want to analyze:
64
+
65
+ ```bash
66
+ atavi init .
67
+ atavi validate .
68
+ ```
69
+
70
+ This creates a `.atavi/` workspace with the brief, registries, pass folders,
71
+ logs, report file, and memory buckets the host will use.
72
+
73
+ ### 2. Point your host at the protocol
74
+
75
+ ```bash
76
+ atavi --path
77
+ ```
78
+
79
+ The returned path contains:
80
+
81
+ - `protocol/ATAVI.md`
82
+ - `protocol/agents/*`
83
+ - `templates/*`
84
+
85
+ Your host should load those files plus `.atavi/brief.md`, `.atavi/config.json`,
86
+ and `.atavi/status.md`.
87
+
88
+ ### 3. Run the protocol
89
+
90
+ Typical flow:
91
+
92
+ 1. Put a spec, proposal, design doc, or codebase in front of your host AI.
93
+ 2. Run `atavi init .` in the project root.
94
+ 3. Tell the host AI to run ATAVI on the workspace.
95
+ 4. The host writes PODs, CPRs, synthesis records, decision records, registry updates, and memory artifacts into `.atavi/`.
96
+ 5. Review `.atavi/ATAVI-REPORT.md` when the run finishes.
97
+
98
+ ### 4. Resume or repair later
99
+
100
+ ```bash
101
+ atavi resume-check .
102
+ atavi migrate .
103
+ ```
104
+
105
+ Use `resume-check` before resuming an interrupted run. Use `migrate` to add any
106
+ missing scaffold files or schema metadata without overwriting user edits.
107
+
108
+ ## Command Reference
109
+
110
+ ### `atavi --help`
111
+
112
+ Print CLI help.
113
+
114
+ ### `atavi --version`
115
+
116
+ Print the package version.
117
+
118
+ ### `atavi --path`
119
+
120
+ Print the absolute path to the packaged protocol root so a host can load the
121
+ protocol, role files, and templates.
122
+
123
+ ### `atavi init [target]`
124
+
125
+ Create a `.atavi/` workspace in `target` without overwriting existing files.
126
+
127
+ The scaffold includes:
128
+
129
+ - `brief.md`
130
+ - `config.json`
131
+ - `status.md`
132
+ - `conflicts.md`
133
+ - `kill-log.md`
134
+ - `run-log.md`
135
+ - `ATAVI-REPORT.md`
136
+ - `pass-1/README.md`
137
+ - `pass-1/synthesis.md`
138
+ - `pass-1/decision.md`
139
+ - `pass-1/cross-pollination/README.md`
140
+ - `registries/claims.md`
141
+ - `registries/experiments.md`
142
+ - `registries/prior-art.md`
143
+ - `memory/README.md`
144
+ - `memory/prior-art-cache/README.md`
145
+ - `memory/kill-archive/README.md`
146
+ - `memory/claim-patterns/README.md`
147
+ - `memory/convergence-history/README.md`
148
+ - `memory/strategy-insights/README.md`
149
+
150
+ ### `atavi doctor`
151
+
152
+ Verify that the packaged protocol and template assets exist.
153
+
154
+ ### `atavi validate [target]`
155
+
156
+ Validate `.atavi/config.json` against the current package contract.
157
+
158
+ ### `atavi resume-check [target]`
159
+
160
+ Validate `.atavi/config.json` and `.atavi/status.md` before a host resumes an
161
+ interrupted run.
162
+
163
+ ### `atavi migrate [target]`
164
+
165
+ Upgrade an existing `.atavi/` workspace to the current schema by adding missing
166
+ files and schema metadata without overwriting user-edited files.
167
+
168
+ ### `atavi memory-export [target] [output]`
169
+
170
+ Copy `.atavi/memory` to an export directory for reuse in another workspace.
171
+
172
+ Example:
173
+
174
+ ```bash
175
+ atavi memory-export . .atavi/exports/memory
176
+ ```
177
+
178
+ ### `atavi memory-import <source> [target]`
179
+
180
+ Copy memory files into `.atavi/memory` without overwriting existing entries.
181
+
182
+ Example:
183
+
184
+ ```bash
185
+ atavi memory-import .atavi/exports/memory .
186
+ ```
187
+
188
+ ## Recommended Host Workflow
189
+
190
+ Use this order:
191
+
192
+ ```bash
193
+ atavi --path
194
+ atavi init .
195
+ atavi validate .
196
+ atavi resume-check .
197
+ ```
198
+
199
+ Then have the host:
200
+
201
+ 1. confirm or refine `.atavi/brief.md`
202
+ 2. load `protocol/ATAVI.md` and the relevant role files
203
+ 3. write pass artifacts into `.atavi/pass-N/`
204
+ 4. update registries and logs during synthesis
205
+ 5. export reusable memory into `.atavi/memory/`
206
+
207
+ See [HOSTS.md](./HOSTS.md) for Codex, Claude, and Gemini-specific loading guidance.
208
+
209
+ ## Development
210
+
211
+ From a repo checkout:
212
+
213
+ ```bash
214
+ npm install
215
+ npm test
216
+ npm run ci
217
+ ```
218
+
219
+ Equivalent raw Node commands:
220
+
221
+ ```bash
222
+ node scripts/check-manifest.js
223
+ node scripts/check-release-surface.js
224
+ node test/run-all.js
225
+ ```
226
+
227
+ ## Related Docs
228
+
229
+ - [HOSTS.md](./HOSTS.md)
230
+ - [ARCHITECTURE.md](./ARCHITECTURE.md)
231
+ - [TESTING.md](./TESTING.md)
232
+ - [CONTRIBUTING.md](./CONTRIBUTING.md)