arkaos 2.46.3 → 2.47.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.
- package/VERSION +1 -1
- package/installer/index.js +16 -0
- package/installer/user-data-scaffold.js +59 -0
- package/package.json +1 -1
- package/pyproject.toml +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.47.0
|
package/installer/index.js
CHANGED
|
@@ -295,6 +295,22 @@ export async function install({ runtime, path, force, skipSystem, withOllama })
|
|
|
295
295
|
console.log(` Warning: could not seed config.json (${err.message})`);
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
+
// PR28 v2.47.0 — scaffold the user-mutable files the discipline-arc
|
|
299
|
+
// commands depend on: redaction-clients.json (leak scanner config)
|
|
300
|
+
// and reorganize-proposals/ (daily proposal output). Idempotent.
|
|
301
|
+
try {
|
|
302
|
+
const { scaffoldArkaosUserData } = await import("./user-data-scaffold.js");
|
|
303
|
+
const scaffoldResult = scaffoldArkaosUserData({ home: homedir() });
|
|
304
|
+
if (scaffoldResult.redaction.action === "created") {
|
|
305
|
+
console.log(` redaction-clients.json scaffolded (empty list — populate to enable leak scanner).`);
|
|
306
|
+
}
|
|
307
|
+
if (scaffoldResult.proposals.action === "created") {
|
|
308
|
+
console.log(` reorganize-proposals/ directory created.`);
|
|
309
|
+
}
|
|
310
|
+
} catch (err) {
|
|
311
|
+
console.log(` Warning: could not scaffold user-data (${err.message})`);
|
|
312
|
+
}
|
|
313
|
+
|
|
298
314
|
const manifest = {
|
|
299
315
|
version: VERSION,
|
|
300
316
|
runtime,
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// ~/.arkaos user-data scaffolding (PR28 v2.47.0).
|
|
2
|
+
//
|
|
3
|
+
// Run on every `npx arkaos install` and `npx arkaos@latest update`.
|
|
4
|
+
// Ensures the operator-mutable files and directories that the
|
|
5
|
+
// discipline-arc commands depend on exist:
|
|
6
|
+
//
|
|
7
|
+
// - ~/.arkaos/redaction-clients.json (leak scanner config)
|
|
8
|
+
// - ~/.arkaos/reorganize-proposals/ (daily reorganizer output)
|
|
9
|
+
//
|
|
10
|
+
// Idempotent: never overwrites operator-authored content. On fresh
|
|
11
|
+
// installs, the redaction config is created with an empty `clients`
|
|
12
|
+
// list plus a `_doc` field explaining how to populate it.
|
|
13
|
+
//
|
|
14
|
+
// Returns a status object with one entry per scaffolded resource so
|
|
15
|
+
// the installer caller can log a human-readable line per run.
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
existsSync, mkdirSync, writeFileSync, renameSync,
|
|
19
|
+
} from "node:fs";
|
|
20
|
+
import { homedir } from "node:os";
|
|
21
|
+
import { join, dirname } from "node:path";
|
|
22
|
+
|
|
23
|
+
const REDACTION_TEMPLATE = {
|
|
24
|
+
_doc: (
|
|
25
|
+
"Add real client/project identifiers (lowercase) to enable the leak "
|
|
26
|
+
+ "scanner. Empty `clients` list = scanner is a no-op (no false "
|
|
27
|
+
+ "positives in CI). See core/governance/leak_scanner.py."
|
|
28
|
+
),
|
|
29
|
+
clients: [],
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export function scaffoldArkaosUserData({ home = homedir() } = {}) {
|
|
33
|
+
return {
|
|
34
|
+
redaction: scaffoldRedactionConfig(home),
|
|
35
|
+
proposals: scaffoldProposalsDir(home),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function scaffoldRedactionConfig(home) {
|
|
40
|
+
const path = join(home, ".arkaos", "redaction-clients.json");
|
|
41
|
+
if (existsSync(path)) {
|
|
42
|
+
return { action: "preserved", path };
|
|
43
|
+
}
|
|
44
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
45
|
+
// Atomic write: tmp + rename, matches config-seed.js convention.
|
|
46
|
+
const tmp = `${path}.tmp-${process.pid}`;
|
|
47
|
+
writeFileSync(tmp, JSON.stringify(REDACTION_TEMPLATE, null, 2) + "\n");
|
|
48
|
+
renameSync(tmp, path);
|
|
49
|
+
return { action: "created", path };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function scaffoldProposalsDir(home) {
|
|
53
|
+
const path = join(home, ".arkaos", "reorganize-proposals");
|
|
54
|
+
if (existsSync(path)) {
|
|
55
|
+
return { action: "preserved", path };
|
|
56
|
+
}
|
|
57
|
+
mkdirSync(path, { recursive: true });
|
|
58
|
+
return { action: "created", path };
|
|
59
|
+
}
|
package/package.json
CHANGED