atris 3.26.0 → 3.28.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.
@@ -2,7 +2,7 @@ const https = require('https');
2
2
  const fs = require('fs');
3
3
  const path = require('path');
4
4
  const os = require('os');
5
- const { spawnSync } = require('child_process');
5
+ const { spawn, spawnSync } = require('child_process');
6
6
 
7
7
  const PACKAGE_NAME = 'atris';
8
8
  const CHECK_INTERVAL_MS = 60 * 60 * 1000; // 1 hour
@@ -34,6 +34,8 @@ function getCacheData() {
34
34
  return {
35
35
  lastCheck: data.lastCheck ? new Date(data.lastCheck) : null,
36
36
  latestVersion: data.latestVersion || null,
37
+ lastAutoUpdate: data.lastAutoUpdate ? new Date(data.lastAutoUpdate) : null,
38
+ lastAutoUpdateVersion: data.lastAutoUpdateVersion || null,
37
39
  };
38
40
  }
39
41
  } catch (error) {
@@ -52,7 +54,11 @@ function saveCacheData(latestVersion) {
52
54
  if (!fs.existsSync(ATRIS_DIR)) {
53
55
  fs.mkdirSync(ATRIS_DIR, { recursive: true });
54
56
  }
57
+ const existing = fs.existsSync(CACHE_FILE)
58
+ ? JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8'))
59
+ : {};
55
60
  const data = {
61
+ ...existing,
56
62
  lastCheck: new Date().toISOString(),
57
63
  latestVersion: latestVersion,
58
64
  };
@@ -62,6 +68,34 @@ function saveCacheData(latestVersion) {
62
68
  }
63
69
  }
64
70
 
71
+ function markAutoUpdateStarted(latestVersion) {
72
+ try {
73
+ if (!fs.existsSync(ATRIS_DIR)) {
74
+ fs.mkdirSync(ATRIS_DIR, { recursive: true });
75
+ }
76
+ const existing = fs.existsSync(CACHE_FILE)
77
+ ? JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8'))
78
+ : {};
79
+ fs.writeFileSync(CACHE_FILE, JSON.stringify({
80
+ ...existing,
81
+ lastAutoUpdate: new Date().toISOString(),
82
+ lastAutoUpdateVersion: latestVersion,
83
+ }, null, 2));
84
+ } catch (error) {
85
+ // Ignore cache write errors
86
+ }
87
+ }
88
+
89
+ function autoUpdateRecentlyStarted(latestVersion, now = new Date()) {
90
+ const cache = getCacheData();
91
+ return Boolean(
92
+ latestVersion &&
93
+ cache.lastAutoUpdate &&
94
+ cache.lastAutoUpdateVersion === latestVersion &&
95
+ now - cache.lastAutoUpdate < CHECK_INTERVAL_MS
96
+ );
97
+ }
98
+
65
99
  /**
66
100
  * Fetch the latest version of atris from npm registry.
67
101
  * @returns {Promise<string>} Latest version string
@@ -189,7 +223,7 @@ function showUpdateNotification(updateInfo) {
189
223
  // Single yellow warning line — non-intrusive
190
224
  const yellow = '\x1b[33m';
191
225
  const reset = '\x1b[0m';
192
- console.log(`${yellow}Update available: ${updateInfo.installed} → ${updateInfo.latest}. Run: npm install -g atris${reset}`);
226
+ console.log(`${yellow}Update available: ${updateInfo.installed} → ${updateInfo.latest}. Run: atris upgrade${reset}`);
193
227
  }
194
228
 
195
229
  function inspectInstallGitState(packageRoot = path.join(__dirname, '..')) {
@@ -237,37 +271,55 @@ function formatInstallGitWarning(state) {
237
271
  if (state.detached) flags.push(`detached HEAD${state.head ? ` ${state.head}` : ''}`);
238
272
  if (state.dirty) flags.push(`dirty worktree (${state.dirtyCount} file${state.dirtyCount === 1 ? '' : 's'})`);
239
273
  return `WARNING: Atris is running from a ${flags.join(' + ')} at ${state.root}.\n` +
240
- 'npm update may not change the code currently on PATH; resolve that checkout before trusting upgrade status.';
274
+ 'npm install -g atris@latest may not change the code currently on PATH; resolve that checkout before trusting upgrade status.';
241
275
  }
242
276
 
243
- function autoUpdate(updateInfo) {
277
+ function normalizeAutoUpdateMode(env = process.env) {
278
+ const raw = String(env.ATRIS_AUTO_UPDATE || '').trim().toLowerCase();
279
+ if (['0', 'false', 'no', 'off', 'notify'].includes(raw)) return 'off';
280
+ if (['1', 'true', 'yes', 'on', 'force'].includes(raw)) return 'force';
281
+ return 'auto';
282
+ }
283
+
284
+ function shouldAutoUpdate(updateInfo, state, env = process.env) {
244
285
  if (!updateInfo || !updateInfo.needsUpdate) return false;
245
286
 
246
- const { execSync } = require('child_process');
287
+ const mode = normalizeAutoUpdateMode(env);
288
+ if (mode === 'off') return false;
289
+ if (mode === 'force') return true;
247
290
 
248
- console.log('');
249
- console.log(`⬆️ Updating atris ${updateInfo.installed} ${updateInfo.latest}...`);
291
+ // Packaged npm installs are not git repositories. Git checkouts may be linked
292
+ // dev installs, where a global npm install would not update the code on PATH.
293
+ return !(state && state.isGitRepo);
294
+ }
250
295
 
251
- try {
252
- execSync('npm update -g atris', { stdio: 'pipe', timeout: 30000 });
253
- console.log(`✅ Updated to ${updateInfo.latest}`);
254
-
255
- // Auto-sync skills into current project if atris/skills/ exists
256
- try {
257
- if (fs.existsSync(path.join(process.cwd(), 'atris', 'skills'))) {
258
- execSync('atris sync', { stdio: 'pipe', timeout: 10000 });
259
- console.log(`✅ Skills synced`);
260
- }
261
- } catch (e) {
262
- // Sync failed — not critical
263
- }
296
+ function autoUpdate(updateInfo, options = {}) {
297
+ if (!updateInfo || !updateInfo.needsUpdate) return false;
298
+
299
+ const env = options.env || process.env;
300
+ const packageRoot = options.packageRoot || path.join(__dirname, '..');
301
+ const installState = options.installState || inspectInstallGitState(packageRoot);
302
+ if (!shouldAutoUpdate(updateInfo, installState, env)) return false;
303
+
304
+ const recentlyStarted = options.recentlyStarted || autoUpdateRecentlyStarted;
305
+ if (recentlyStarted(updateInfo.latest)) return false;
264
306
 
265
- console.log('');
307
+ const spawnImpl = options.spawn || spawn;
308
+ const markStarted = options.markStarted || markAutoUpdateStarted;
309
+ const log = options.log || console.log;
310
+
311
+ try {
312
+ const child = spawnImpl('npm', ['install', '-g', `${PACKAGE_NAME}@latest`], {
313
+ detached: true,
314
+ stdio: 'ignore',
315
+ windowsHide: true,
316
+ });
317
+ if (child && typeof child.on === 'function') child.on('error', () => {});
318
+ if (child && typeof child.unref === 'function') child.unref();
319
+ markStarted(updateInfo.latest);
320
+ log(`Auto-update started: atris ${updateInfo.installed} -> ${updateInfo.latest} (background)`);
266
321
  return true;
267
322
  } catch (error) {
268
- // npm update failed (permissions, network, etc) — fall back to notification
269
- console.log(`⚠️ Auto-update failed. Run manually: npm update -g atris`);
270
- console.log('');
271
323
  return false;
272
324
  }
273
325
  }
@@ -276,6 +328,7 @@ module.exports = {
276
328
  checkForUpdates,
277
329
  showUpdateNotification,
278
330
  autoUpdate,
331
+ shouldAutoUpdate,
279
332
  inspectInstallGitState,
280
333
  formatInstallGitWarning,
281
334
  };
@@ -1,81 +0,0 @@
1
- ---
2
- type: concept
3
- slug: agent-activation-contract
4
- title: Agent Activation Contract
5
- sources:
6
- - atris/CLAUDE.md
7
- - commands/activate.js
8
- last_compiled: 2026-06-23
9
- last_verified: 2026-06-23
10
- confidence: 0.9
11
- dependencies:
12
- - atris/wiki/concepts/plan-do-review-loop.md
13
- - atris/wiki/concepts/wiki-as-memory-substrate.md
14
- actionability: "Use this before changing agent boot instructions, `atris activate`, MAP-first behavior, first-message requirements, or durable-memory routing."
15
- created: 2026-05-10
16
- updated: 2026-06-23
17
- tags:
18
- - agent-activation
19
- - protocol
20
- - mapfirst
21
- ---
22
- # Agent Activation Contract
23
-
24
- `atris/CLAUDE.md` is the editor-facing boot contract for agents entering an Atris-managed project. `commands/activate.js` is the runtime context panel agents use after that boot. Together they define what "activation" means before responding or editing.
25
-
26
- ## Boot Sequence
27
-
28
- ```text
29
- first message -> atris atris.md
30
- setup -> PERSONA + activate + wiki STATUS
31
- navigation -> MAP first, then one grep if needed
32
- work -> plan -> do -> review
33
- memory -> wiki or ingest durable knowledge
34
- ```
35
-
36
- The first response path is explicit: run `atris atris.md`, show the welcome visualization, then answer. After that, agents load `atris/PERSONA.md`, run `atris activate`, and treat `atris/wiki/STATUS.md` as the current memory snapshot when it exists.
37
-
38
- ## Runtime Activation
39
-
40
- `atris activate` refuses to run without an `atris/` folder and tells the operator to run `atris init` first. In a valid workspace it creates today's journal if missing, detects workspace state, loads current task context, reads `atris/wiki/STATUS.md`, and prints a narrow activation card.
41
-
42
- The activation card can include:
43
-
44
- - a handoff block from today's journal when `## Handoff` has structured context,
45
- - the last three deduped completions from journal history,
46
- - the current state summary from detected in-progress, backlog, and inbox items,
47
- - a learning count from `atris/learnings.jsonl`,
48
- - wiki health from `atris/wiki/STATUS.md`,
49
- - core file paths for persona, MAP, task view, journal, and wiki status.
50
-
51
- The command ends by pointing the operator back to `atris plan -> do -> review` or `atris log`. It is a read/load surface with one deliberate local side effect: ensuring the current journal file exists so the session is writable.
52
-
53
- ## MAP-First Rule
54
-
55
- Before any file search, read `atris/MAP.md` and search the map for the target keyword. If the map has the location, go directly to that file and line. If not, grep once and update `MAP.md` so the next agent does not repeat the same scan.
56
-
57
- ## Core Truth Surfaces
58
-
59
- - `atris/MAP.md` is navigation.
60
- - `atris/TODO.md` is the visible work queue; current task ownership lives in `atris task`.
61
- - `atris/logs/YYYY/YYYY-MM-DD.md` is the operating journal.
62
- - `atris/wiki/STATUS.md` is the current memory snapshot.
63
- - `atris/wiki/index.md` is the durable knowledge index.
64
- - `atris/atris.md` is the full protocol.
65
-
66
- ## Execution Contract
67
-
68
- Work follows `atris plan -> atris do -> atris review`. Planning requires an ASCII visualization and an approval gate. Execution is step-by-step, with verification as reality changes. Completed tasks should be removed from the active queue; the target state is zero stale tasks.
69
-
70
- Durable project knowledge belongs in `atris/wiki/` or through the local wiki flow. Ephemeral progress belongs in task state and the daily journal, not in ad hoc context.
71
-
72
- `atris/CLAUDE.md` now also carries an explicit agent contract: before edits, claim or create one small task with `atris task` and write the goal/files/done/check contract into task dialogue; after edits, move proof-backed work to Review with `atris task ready <id> --proof "..."`. Proof-ready and human accept are separate gates: an agent's native goal can complete once proof is in Review, but only a human-run `atris task accept <id>` marks the task Done and awards AgentXP. Work that should outlive the chat runs through `atris mission` (start with a verifier, bounded step, `mission tick --verify`, then complete or continue).
73
-
74
- ## Limits
75
-
76
- This page summarizes the activation contract only. Use `atris/atris.md` for the complete protocol, `atris/wiki/concepts/plan-do-review-loop.md` for stage ownership and proof, and `atris/wiki/concepts/wiki-as-memory-substrate.md` for wiki page shape and upkeep behavior. `atris activate` reports state; it does not claim tasks, finish work, or repair broken wiki pages.
77
-
78
- ## Cross-References
79
-
80
- - [[atris/wiki/concepts/plan-do-review-loop.md]] - stage ownership, proof, and review closure
81
- - [[atris/wiki/concepts/wiki-as-memory-substrate.md]] - durable memory routing and wiki verification
@@ -1,73 +0,0 @@
1
- ---
2
- type: concept
3
- slug: workspace-initialization-contract
4
- title: Workspace Initialization Contract
5
- sources:
6
- - commands/init.js
7
- last_compiled: 2026-06-23
8
- last_verified: 2026-06-23
9
- confidence: 0.86
10
- dependencies:
11
- - atris/wiki/systems/atris-cli.md
12
- - atris/wiki/concepts/agent-activation-contract.md
13
- - atris/wiki/concepts/wiki-as-memory-substrate.md
14
- actionability: "Use this before changing `atris init`, workspace scaffolds, generated agent instructions, project detection, or boot hook behavior."
15
- created: 2026-05-10
16
- updated: 2026-06-23
17
- tags:
18
- - initialization
19
- - workspace
20
- - scaffold
21
- ---
22
- # Workspace Initialization Contract
23
-
24
- `commands/init.js` defines the local contract for turning an arbitrary folder into an Atris-managed workspace. It is the repo-level bootstrap path, not the business workspace onboarding path.
25
-
26
- ## Shape
27
-
28
- ```text
29
- guard workspace -> create atris/ -> scaffold memory + teams + features
30
- -> detect project -> inject team context
31
- -> generate agent entry files + hooks
32
- -> copy atris protocol
33
- ```
34
-
35
- The command handles `atris init [--force]`. Help flags print usage without filesystem side effects. Normal execution refuses to run inside an existing `atris/` directory, inside a parent business workspace, or in a folder with `.atris/business.json` unless `--force` is present.
36
-
37
- ## What Init Creates
38
-
39
- - Core workspace: `atris/`, `atris/atris.md`, `atris/PERSONA.md`, `atris/GETTING_STARTED.md`, `atris/MAP.md`, `atris/TODO.md`, `atris/now.md`, `atris/lessons.md`, and dated logs.
40
- - Memory surfaces: wiki scaffold via `ensureWikiScaffold`, feature templates, experiments harness, and `INTUITION.md`.
41
- - Team surfaces: `atris/team/<member>/MEMBER.md` plus `skills/`, `tools/`, and `context/` folders for default members.
42
- - Project profile: `.project-profile.json` from package files, framework hints, directory shape, and default test command.
43
- - Agent entry files: `AGENTS.md`, `.cursorrules`, `.cursor/rules/atris.mdc`, `.claude/commands/atris.md`, `.claude/commands/atris-autopilot.md`, `atris/CLAUDE.md`, `.claude/settings.json`, `.devin/config.local.json`, and root `CLAUDE.md` Atris markers.
44
- - Skills: package `atris/skills/` copied into the workspace and linked into `.claude/skills/` when possible.
45
-
46
- ## Project Detection
47
-
48
- `detectProjectContext()` scans package files first, then framework-specific dependencies, then common structure directories. It detects Node, Python, Ruby, Go, Rust, Java, PHP, Elixir, D, iOS, and markdown-only knowledge bases. The resulting test command is a default hint (`npm test`, `pytest`, `go test ./...`, etc.), not a guarantee that validation is sufficient.
49
-
50
- `injectProjectPatterns()` writes that profile into navigator, executor, and validator specs so the first generated team has a local project shape before any agent starts work.
51
-
52
- ## Generated Agent Contract
53
-
54
- The generated instruction files all point agents back to the same small operating loop:
55
-
56
- - run the Atris boot sequence before first response,
57
- - keep replies short,
58
- - use ASCII visuals for planning,
59
- - check `MAP.md` before code search,
60
- - use `atris task` for ownership and proof,
61
- - treat `TODO.md` as rendered state, not the task database.
62
-
63
- Claude-specific setup also adds a `SessionStart` hook that runs `atris atris.md` when `atris/` exists and a `Stop` hook that points to the autopilot stop hook.
64
-
65
- ## Limits
66
-
67
- `atris init` bootstraps local files. It does not push to cloud, create a shared business owner, or reconcile template updates after custom edits. Use business commands for shared-owner workspaces and `atris update` / sync flows for canonical file refreshes.
68
-
69
- ## Cross-References
70
-
71
- - [[atris/wiki/concepts/agent-activation-contract.md]] - the boot behavior generated agent files point to
72
- - [[atris/wiki/concepts/wiki-as-memory-substrate.md]] - the wiki scaffold and memory contract initialized by this command
73
- - [[atris/wiki/systems/atris-cli.md]] - repo-level command surface that includes `atris init`
@@ -1,31 +0,0 @@
1
- # Atris Wiki Index
2
-
3
- ## Entities
4
-
5
- - [[atris/wiki/people/jack-dorsey.md]] — Block / Twitter founder; AI-native company thesis
6
- - [[atris/wiki/systems/atris-cli.md]] — this project; dev-tool layer of the Atris stack
7
- - [[atris/wiki/systems/atris-business.md]] — sibling product; shared owners with persistent AI computers
8
- - [[atris/wiki/systems/atris-labs.md]] — reference business owner in the Atris fleet; default computer dogfood
9
-
10
- ## Concepts
11
-
12
- - [[atris/wiki/concepts/intent-capability-composition.md]] — the operating loop; roadmap from gaps
13
- - [[atris/wiki/concepts/wiki-as-memory-substrate.md]] — what `atris/wiki/` is and isn't
14
- - [[atris/wiki/concepts/plan-do-review-loop.md]] — core Atris workflow and how local memory fits into it
15
- - [[atris/wiki/concepts/rebased-pack-co-first-loop.md]] — local-only business workspace first loop and proof guardrails
16
- - [[atris/wiki/concepts/atris-labs-goals.md]] — atris-labs north star, 2026 Q2 targets, standing constraints
17
- - [[atris/wiki/concepts/horizon-types.md]] — horizon slug prefix convention; type categories and inference rules
18
- - [[atris/wiki/concepts/verifiable-reward-loop.md]] — reward, scorecards, and why the repo now acts like an RL-style environment
19
- - [[atris/wiki/concepts/recursive-self-improvement-position.md]] — honest capability assessment: the loop is the RSI skeleton on the leverage axis, intelligence axis fixed by the model
20
- - [[atris/wiki/concepts/owner-computer-model.md]] — Owner = User | Business; constrained entity modes, typed computers, and groups as the social/access layer
21
- - [[atris/wiki/concepts/agent-activation-contract.md]] — editor-facing boot contract: first message, MAP-first, setup, and durable-memory routing
22
- - [[atris/wiki/concepts/workspace-initialization-contract.md]] — `atris init` bootstrap contract: guards, scaffolds, team context, generated agent files, and hooks
23
- - [[atris/wiki/concepts/glass-interface-principle.md]] — AI tool design doctrine: make reasoning visible and inspectable, not black-boxed
24
-
25
- ## Briefs
26
-
27
- - [[atris/wiki/briefs/rebased-pack-co-starter-brief.md]] — starter brief for the local-only Rebased Pack Co smoke workspace
28
- - [[atris/wiki/briefs/atris-cli-overview.md]] — summary of CLI, owner/computer model, workspace layers, and why `atris/wiki/` exists
29
- - [[atris/wiki/briefs/atris-labs-workspace-protocol.md]] — atris-labs workspace protocol: on-load sequence, layout, surfaces, north star
30
- - [[atris/wiki/briefs/atrisos-generative-ui-product-surface.md]] — historical AtrisOS generative UI / block surface design note
31
- - [[atris/wiki/briefs/launch-post.md]] — historical launch drafts for the local-first wiki feature
@@ -1,14 +0,0 @@
1
- Source receipt for atris/wiki/systems/atris-labs.md
2
- Compiled: 2026-05-10
3
-
4
- Local evidence checked:
5
- - historical Atris Labs customer workspace docs
6
- - historical Atris Labs context status and pipeline notes
7
- - historical Atris Labs member profile notes
8
- - historical Atris Labs app workspace inventory
9
- - historical Atris Labs cloud workspace binding metadata
10
-
11
- Notes:
12
- - The previous wiki source is missing in this workspace.
13
- - Available status/pipeline files are historical March 2026 artifacts.
14
- - Treat this page as orientation, not a live company operating report.
@@ -1,14 +0,0 @@
1
- Source receipt for atris/wiki/concepts/atris-labs-goals.md
2
- Compiled: 2026-05-10
3
-
4
- Local evidence checked:
5
- - atris/wiki/concepts/atris-labs-goals.md before refresh
6
- - atris/wiki/log.md historical ingest notes for missing goals.md
7
- - historical Atris Labs context status and pipeline notes
8
- - historical Atris Labs fundraising metrics notes
9
- - historical Atris Labs fundraising story notes
10
-
11
- Notes:
12
- - The previous goals source is missing in this workspace.
13
- - The page is retained as historical direction only.
14
- - Revenue/customer counts require live verification before operational use.
@@ -1,10 +0,0 @@
1
- Source receipt for atris/wiki/briefs/atrisos-generative-ui-product-surface.md
2
- Compiled: 2026-05-10
3
-
4
- Local evidence checked:
5
- - atris/wiki/briefs/atrisos-generative-ui-product-surface.md before metadata repair
6
- - atris/wiki/systems/atris-cli.md for current CLI/product context
7
-
8
- Notes:
9
- - This brief appears to be an in-session product/design synthesis from 2026-04-29.
10
- - It is retained as a historical design note, not a current design-system contract.
@@ -1,12 +0,0 @@
1
- Source receipt for atris/wiki/people/jack-dorsey.md
2
- Compiled: 2026-05-10
3
-
4
- External sources checked:
5
- - YouTube episode URL: https://www.youtube.com/watch?v=YTVSwOY19Qs
6
- - Sequoia transcript: https://sequoiacap.com/podcast/jack-dorsey-every-company-can-now-be-a-mini-agi/
7
- - Block essay: https://block.xyz/inside/from-hierarchy-to-intelligence
8
-
9
- Notes:
10
- - The Sequoia page provides the transcript for the episode linked from YouTube.
11
- - The Block essay is the co-authored primary written thesis by Jack Dorsey and Roelof Botha.
12
- - No Atris YouTube processing credits were spent for this refresh.