atris 3.80.0 → 3.82.1

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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/atris/atris.md +14 -0
  4. package/atris/features/README.md +15 -0
  5. package/atris/policies/README.md +24 -0
  6. package/atris/skills/README.md +61 -45
  7. package/atris/skills/design/SKILL.md +6 -5
  8. package/atris/skills/taste/SKILL.md +39 -0
  9. package/atris/skills/taste/notes.md +29 -0
  10. package/atris/skills/taste/principles.md +23 -0
  11. package/atris/skills/wiki/SKILL.md +14 -2
  12. package/atris/skills/wiki/index-lines.md +30 -0
  13. package/atris/skills/wiki/measure.md +20 -0
  14. package/atris/skills/wiki/note-shape.md +16 -0
  15. package/atris/skills/wiki/upkeep.md +16 -0
  16. package/atris/team/README.md +38 -0
  17. package/atris.md +14 -0
  18. package/bin/atris.js +1 -1
  19. package/commands/activate.js +1 -1
  20. package/commands/auth.js +2 -2
  21. package/commands/autoland.js +25 -26
  22. package/commands/autopilot-front.js +46 -1
  23. package/commands/autopilot.js +55 -25
  24. package/commands/clean.js +22 -11
  25. package/commands/computer.js +166 -2413
  26. package/commands/doc-health.js +48 -1
  27. package/commands/improve.js +16 -3
  28. package/commands/init.js +4 -0
  29. package/commands/integrations.js +69 -1616
  30. package/commands/mission.js +109 -13
  31. package/commands/release.js +41 -10
  32. package/commands/security-review.js +5 -1
  33. package/commands/site-deploy.js +5 -1
  34. package/commands/status.js +1 -1
  35. package/commands/sync.js +12 -8
  36. package/commands/task.js +144 -118
  37. package/commands/unknowns.js +9 -5
  38. package/commands/visualize.js +1 -12
  39. package/commands/workflow.js +4 -3
  40. package/commands/worktree.js +68 -1602
  41. package/commands/xp.js +23 -2113
  42. package/commands/youtube.js +192 -3110
  43. package/lib/business-core.js +3 -4
  44. package/lib/campaign-run-lock.js +12 -1
  45. package/lib/computer-core.js +2447 -0
  46. package/lib/engine-ask.js +1 -1
  47. package/lib/engine-receipt-sweep.js +64 -0
  48. package/lib/file-lock.js +175 -0
  49. package/lib/fleet.js +1 -1
  50. package/lib/integrations-core.js +1695 -0
  51. package/lib/json-file.js +22 -1
  52. package/lib/loop-doctor.js +36 -2
  53. package/lib/map-refs.js +68 -8
  54. package/lib/member-engine.js +1 -1
  55. package/lib/member-map-fold.js +49 -11
  56. package/lib/member-map-inbox.js +2 -1
  57. package/lib/mission-core.js +9 -2
  58. package/lib/recall-exam.js +171 -0
  59. package/lib/roster-markdown.js +2 -2
  60. package/lib/runner-command.js +5 -5
  61. package/lib/security-audit-classes.js +20 -2
  62. package/lib/security-audit.js +31 -1
  63. package/lib/task-db.js +105 -37
  64. package/lib/taste-notes.js +35 -0
  65. package/lib/team-lineup.js +3 -3
  66. package/lib/todo.js +2 -0
  67. package/lib/wiki.js +11 -3
  68. package/lib/worktree-core.js +1517 -0
  69. package/lib/xp-core.js +2172 -0
  70. package/lib/youtube-core.js +3178 -0
  71. package/lib/zen-apply.js +3 -1
  72. package/package.json +10 -3
  73. package/utils/auth.js +18 -4
@@ -900,10 +900,9 @@ function seedBusinessStarterTask(cwd, todoPath, starterAction) {
900
900
  verify: 'atris business record atris/reports/<recap>.md --outcome mixed --metric "operator speed"',
901
901
  },
902
902
  });
903
- const projection = taskDb.taskProjection(db, { workspaceRoot, limit: 500 });
904
- const projectionPath = path.join(cwd, '.atris', 'state', 'tasks.projection.json');
905
- fs.mkdirSync(path.dirname(projectionPath), { recursive: true });
906
- fs.writeFileSync(projectionPath, `${JSON.stringify(projection, null, 2)}\n`, 'utf8');
903
+ // The one projection writer (same shape as `atris task`, temp file and rename).
904
+ const { writeDefaultProjection } = require('../commands/task');
905
+ const projectionPath = writeDefaultProjection(taskDb, db, { root: cwd }).outPath;
907
906
  return { ok: true, inserted: Boolean(result.inserted), taskId: result.id, projectionPath };
908
907
  } catch (error) {
909
908
  return { ok: false, error: error && error.message ? error.message : String(error) };
@@ -9,6 +9,11 @@
9
9
  const fs = require('fs');
10
10
  const os = require('os');
11
11
  const path = require('path');
12
+ const { stealStaleLock } = require('./file-lock');
13
+
14
+ // A lock is created empty and its holder record lands a moment later, so an
15
+ // unreadable lock this young is still someone's, not stale.
16
+ const UNREADABLE_GRACE_MS = 5000;
12
17
 
13
18
  function lockPath(home, campaignId) {
14
19
  return path.join(home, 'campaigns', campaignId, 'run.lock');
@@ -48,10 +53,16 @@ function acquireRunLock(home, campaignId, { pid = process.pid, host = os.hostnam
48
53
  } catch (error) {
49
54
  if (error.code !== 'EEXIST') throw error;
50
55
  }
56
+ let judged;
57
+ try { judged = fs.statSync(file); } catch { continue; }
58
+ let raw = null;
59
+ try { raw = fs.readFileSync(file, 'utf8'); } catch {}
51
60
  const holder = readHolder(file);
52
61
  if (holder && holder.host === host && isAlive(holder.pid)) return { ok: false, holder };
53
62
  if (holder && holder.host !== host) return { ok: false, holder };
54
- fs.rmSync(file, { force: true });
63
+ if (!holder && Date.now() - judged.mtimeMs < UNREADABLE_GRACE_MS) return { ok: false, holder: null };
64
+ // Rename-then-verify, so a second waiter never deletes a fresh lock.
65
+ stealStaleLock(file, judged, raw);
55
66
  }
56
67
  return { ok: false, holder: readHolder(file) };
57
68
  }