@arjunkhera/atlas 0.2.1 → 0.2.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atlas",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Atlas: the delivery lifecycle, its crews and the Atlas tools, for any repository.",
5
5
  "author": {
6
6
  "name": "Arjun Khera"
@@ -15,7 +15,9 @@ import { checkChanges, HELPER_LABEL, PROVENANCE_SOURCES } from './helpers.mjs';
15
15
 
16
16
  export { HELPER_LABEL, PROVENANCE_SOURCES };
17
17
 
18
- const escapeCell = (text) => String(text ?? '').replaceAll('|', '\\|').replaceAll('\n', ' ').trim();
18
+ // A backtick breaks a table cell the same way a pipe does, and a provenance
19
+ // line often carries one. Both are escaped (acceptance review of slice B2).
20
+ const escapeCell = (text) => String(text ?? '').replaceAll('|', '\\|').replaceAll('`', '\\`').replaceAll('\n', ' ').trim();
19
21
 
20
22
  // One request may reach two helpers. "We now deploy prod on Fly" reaches Facts
21
23
  // and Procedures. It is still ONE pull request: design page D2's rule, carried
@@ -88,7 +90,7 @@ const run = (command, args, cwd) => execFileSync(command, args, { cwd, encoding:
88
90
  //
89
91
  // It never merges. A person merges every file a helper writes, because every
90
92
  // one of them steers agents.
91
- export function open({ root, helperId, changes, groups, why, branch, title, base = null, label = HELPER_LABEL, dryRun = false }) {
93
+ export function open({ root, helperId, changes, groups, why, branch, title, base = null, label = HELPER_LABEL, dryRun = false, exec = run }) {
92
94
  const wanted = groups ?? [{ helperId, changes }];
93
95
  const checked = checkAll(wanted);
94
96
  const all = checked.flatMap((group) => group.changes);
@@ -96,24 +98,24 @@ export function open({ root, helperId, changes, groups, why, branch, title, base
96
98
  // printed "Nothing was pushed", which was true and misleading (acceptance
97
99
  // review of batch 16, finding S3-5).
98
100
  if (!dryRun) for (const group of checked) applyChanges(root, group.helper.id, group.changes);
99
- const repo = (() => { try { return run('gh', ['repo', 'view', '--json', 'nameWithOwner', '--jq', '.nameWithOwner'], root); } catch { return null; } })();
101
+ const repo = (() => { try { return exec('gh', ['repo', 'view', '--json', 'nameWithOwner', '--jq', '.nameWithOwner'], root); } catch { return null; } })();
100
102
  const body = provenanceBody({ groups: checked, why, repo });
101
- const onto = base ?? run('git', ['symbolic-ref', '--short', 'HEAD'], root);
103
+ const onto = base ?? exec('git', ['symbolic-ref', '--short', 'HEAD'], root);
102
104
  const helper = checked[0].helper;
103
105
  if (dryRun) return { helper, helpers: checked.map((group) => group.helper), repo, branch, title, body, base: onto, written: all.map((change) => change.path), opened: false };
104
106
 
105
- run('git', ['checkout', '-b', branch], root);
106
- run('git', ['add', '--', ...all.map((change) => change.path)], root);
107
- run('git', ['commit', '-m', title, '-m', body], root);
108
- run('git', ['push', '-u', 'origin', branch], root);
107
+ exec('git', ['checkout', '-b', branch], root);
108
+ exec('git', ['add', '--', ...all.map((change) => change.path)], root);
109
+ exec('git', ['commit', '-m', title, '-m', body], root);
110
+ exec('git', ['push', '-u', 'origin', branch], root);
109
111
  // A label that does not exist yet makes `gh pr create` fail, so it is made
110
112
  // first. A label that already exists makes that call fail instead, and that
111
113
  // failure is the expected one.
112
- try { run('gh', ['label', 'create', label, '--description', 'Written by an Atlas helper. A person merges it.', '--color', 'C5A882'], root); } catch { /* it already exists */ }
114
+ try { exec('gh', ['label', 'create', label, '--description', 'Written by an Atlas helper. A person merges it.', '--color', 'C5A882'], root); } catch { /* it already exists */ }
113
115
  // --head names the branch. `git push -u` does not always record the upstream
114
116
  // in a shallow clone, and then `gh pr create` refuses with "you must first
115
117
  // push the current branch" although the branch is already on GitHub
116
118
  // (measured on an Engram clone, 2026-09-20).
117
- const url = run('gh', ['pr', 'create', '--title', title, '--body', body, '--label', label, '--base', onto, '--head', branch], root);
119
+ const url = exec('gh', ['pr', 'create', '--title', title, '--body', body, '--label', label, '--base', onto, '--head', branch], root);
118
120
  return { helper, helpers: checked.map((group) => group.helper), repo, branch, title, body, base: onto, written: all.map((change) => change.path), opened: true, url };
119
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arjunkhera/atlas",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Atlas: the delivery lifecycle, its crews and the Atlas tools, as a Claude Code plugin for any repository.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",