@adhamalkhaja/seyola-runtime 0.12.2 → 0.13.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/dist/bundle/index.js +6 -0
- package/dist/bundle/index.js.map +1 -1
- package/dist/check-rep-signal/index.d.ts +57 -0
- package/dist/check-rep-signal/index.d.ts.map +1 -0
- package/dist/check-rep-signal/index.js +222 -0
- package/dist/check-rep-signal/index.js.map +1 -0
- package/dist/cli/index.js +57 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/resolve-artifact/index.d.ts +34 -0
- package/dist/resolve-artifact/index.d.ts.map +1 -0
- package/dist/resolve-artifact/index.js +112 -0
- package/dist/resolve-artifact/index.js.map +1 -0
- package/dist/resolve-state/index.d.ts +94 -0
- package/dist/resolve-state/index.d.ts.map +1 -0
- package/dist/resolve-state/index.js +418 -0
- package/dist/resolve-state/index.js.map +1 -0
- package/dist/verify-write-count/index.d.ts +49 -0
- package/dist/verify-write-count/index.d.ts.map +1 -0
- package/dist/verify-write-count/index.js +96 -0
- package/dist/verify-write-count/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* seyola-runtime resolve-artifact — single-source artifact_id → path lookup.
|
|
3
|
+
*
|
|
4
|
+
* Skills currently hardcode paths in prose (e.g., "Read runtime/client-goal.md").
|
|
5
|
+
* If artifact-registry.yaml changes the path, those skill mentions silently
|
|
6
|
+
* break. This command makes path resolution a runtime call, not a prose-baked
|
|
7
|
+
* assumption.
|
|
8
|
+
*
|
|
9
|
+
* Returns the primary path, any aliases, and whether the file exists on disk
|
|
10
|
+
* at the workspace.
|
|
11
|
+
*
|
|
12
|
+
* Skill prose pattern:
|
|
13
|
+
*
|
|
14
|
+
* Run `seyola-runtime resolve-artifact business_snapshot --workspace .`
|
|
15
|
+
* to get the canonical path. Then Read the file at that path.
|
|
16
|
+
*/
|
|
17
|
+
import { existsSync, statSync } from "node:fs";
|
|
18
|
+
import { join, resolve } from "node:path";
|
|
19
|
+
import { readFileSync } from "node:fs";
|
|
20
|
+
import { parse as parseYaml } from "yaml";
|
|
21
|
+
export async function runResolveArtifact(inputs) {
|
|
22
|
+
const start = Date.now();
|
|
23
|
+
const workspace = resolve(inputs.workspacePath);
|
|
24
|
+
const registryPath = join(workspace, ".seyola", "pack", "architecture", "artifact-registry.yaml");
|
|
25
|
+
if (!existsSync(registryPath)) {
|
|
26
|
+
const result = {
|
|
27
|
+
exitCode: 2,
|
|
28
|
+
artifact_id: inputs.artifactId,
|
|
29
|
+
primary_path: null,
|
|
30
|
+
aliases: [],
|
|
31
|
+
exists: false,
|
|
32
|
+
resolved_path: null,
|
|
33
|
+
last_modified: null,
|
|
34
|
+
size_bytes: null,
|
|
35
|
+
duration_ms: Date.now() - start,
|
|
36
|
+
};
|
|
37
|
+
if (inputs.json)
|
|
38
|
+
console.log(JSON.stringify({ ...result, error: "artifact-registry.yaml not found" }, null, 2));
|
|
39
|
+
else
|
|
40
|
+
console.error("seyola-runtime resolve-artifact: artifact-registry.yaml not found at " + registryPath);
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
const registry = parseYaml(readFileSync(registryPath, "utf8"));
|
|
44
|
+
const entry = registry.artifacts?.find(a => a.id === inputs.artifactId);
|
|
45
|
+
if (!entry) {
|
|
46
|
+
const result = {
|
|
47
|
+
exitCode: 1,
|
|
48
|
+
artifact_id: inputs.artifactId,
|
|
49
|
+
primary_path: null,
|
|
50
|
+
aliases: [],
|
|
51
|
+
exists: false,
|
|
52
|
+
resolved_path: null,
|
|
53
|
+
last_modified: null,
|
|
54
|
+
size_bytes: null,
|
|
55
|
+
duration_ms: Date.now() - start,
|
|
56
|
+
};
|
|
57
|
+
if (inputs.json)
|
|
58
|
+
console.log(JSON.stringify({ ...result, error: `artifact_id '${inputs.artifactId}' not in registry` }, null, 2));
|
|
59
|
+
else
|
|
60
|
+
console.error(`seyola-runtime resolve-artifact: artifact_id '${inputs.artifactId}' not in registry`);
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
const cp = entry.current_paths ?? {};
|
|
64
|
+
const primaryRel = cp.primary ?? cp.machine_readable ?? null;
|
|
65
|
+
const aliasesRel = cp.aliases ?? [];
|
|
66
|
+
const primaryAbs = primaryRel ? join(workspace, primaryRel) : null;
|
|
67
|
+
const aliasesAbs = aliasesRel.map(a => join(workspace, a));
|
|
68
|
+
// Find the first existing path (primary preferred, then aliases)
|
|
69
|
+
let resolvedPath = null;
|
|
70
|
+
if (primaryAbs && existsSync(primaryAbs)) {
|
|
71
|
+
resolvedPath = primaryAbs;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
for (const alias of aliasesAbs) {
|
|
75
|
+
if (existsSync(alias)) {
|
|
76
|
+
resolvedPath = alias;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
let lastModified = null;
|
|
82
|
+
let sizeBytes = null;
|
|
83
|
+
if (resolvedPath) {
|
|
84
|
+
const stat = statSync(resolvedPath);
|
|
85
|
+
lastModified = stat.mtime.toISOString();
|
|
86
|
+
sizeBytes = stat.size;
|
|
87
|
+
}
|
|
88
|
+
const result = {
|
|
89
|
+
exitCode: 0,
|
|
90
|
+
artifact_id: inputs.artifactId,
|
|
91
|
+
primary_path: primaryAbs,
|
|
92
|
+
aliases: aliasesAbs,
|
|
93
|
+
exists: resolvedPath !== null,
|
|
94
|
+
resolved_path: resolvedPath,
|
|
95
|
+
last_modified: lastModified,
|
|
96
|
+
size_bytes: sizeBytes,
|
|
97
|
+
duration_ms: Date.now() - start,
|
|
98
|
+
};
|
|
99
|
+
if (inputs.json) {
|
|
100
|
+
console.log(JSON.stringify(result, null, 2));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
console.error(`seyola-runtime resolve-artifact: status=ok\n` +
|
|
104
|
+
` artifact_id: ${result.artifact_id}\n` +
|
|
105
|
+
` primary_path: ${result.primary_path ?? "(none)"}\n` +
|
|
106
|
+
` exists: ${result.exists}\n` +
|
|
107
|
+
` resolved_path: ${result.resolved_path ?? "(not on disk)"}\n` +
|
|
108
|
+
` duration: ${result.duration_ms}ms`);
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resolve-artifact/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAkC1C,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAA6B;IACpE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAElG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,MAAM,MAAM,GAA0B;YACpC,QAAQ,EAAE,CAAC;YACX,WAAW,EAAE,MAAM,CAAC,UAAU;YAC9B,YAAY,EAAE,IAAI;YAClB,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,KAAK;YACb,aAAa,EAAE,IAAI;YACnB,aAAa,EAAE,IAAI;YACnB,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;SAChC,CAAC;QACF,IAAI,MAA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CAAC,GAAG,EAAE,GAAG,KAAK;KAChC,CAAC;IAEF,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CACX,8CAA8C;YAC5C,qBAAqB,MAAM,CAAC,WAAW,IAAI;YAC3C,qBAAqB,MAAM,CAAC,YAAY,IAAI,QAAQ,IAAI;YACxD,qBAAqB,MAAM,CAAC,MAAM,IAAI;YACtC,qBAAqB,MAAM,CAAC,aAAa,IAAI,eAAe,IAAI;YAChE,qBAAqB,MAAM,CAAC,WAAW,IAAI,CAC9C,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* seyola-runtime resolve-state — the I-010 architectural fix.
|
|
3
|
+
*
|
|
4
|
+
* Reads the day-graph + artifact-registry + workspace filesystem and
|
|
5
|
+
* computes the member's current day deterministically. Replaces the
|
|
6
|
+
* Phase 0a algorithm in atlas/SKILL.md that was previously LLM-
|
|
7
|
+
* interpreted (and prone to the defensive-Bash regression).
|
|
8
|
+
*
|
|
9
|
+
* Algorithm (deterministic; same input → same output):
|
|
10
|
+
*
|
|
11
|
+
* 1. Load .seyola/pack/architecture/day-graph.yaml
|
|
12
|
+
* 2. Load .seyola/pack/architecture/artifact-registry.yaml
|
|
13
|
+
* 3. For each day in day-graph.days[] where status: active, in
|
|
14
|
+
* ascending day order:
|
|
15
|
+
* a. For each step in steps[], collect artifact IDs from outputs[]
|
|
16
|
+
* where step is `required: true` (default true if unset)
|
|
17
|
+
* b. Resolve each artifact ID to its primary filesystem path via
|
|
18
|
+
* artifact-registry. Try aliases if primary doesn't exist.
|
|
19
|
+
* c. Check existence via fs.existsSync
|
|
20
|
+
* d. The day is COMPLETE iff every required output exists
|
|
21
|
+
* 4. completed_days = set of day numbers where complete=true
|
|
22
|
+
* 5. highest_contiguous = largest N such that {1..N} ⊆ completed_days
|
|
23
|
+
* 6. non_contiguous_completes = completed_days \ {1..highest_contiguous}
|
|
24
|
+
* 7. current_day = highest_contiguous + 1
|
|
25
|
+
* (unless current_day exceeds max active day — then program complete)
|
|
26
|
+
* 8. skip_detected = non_contiguous_completes is non-empty
|
|
27
|
+
* 9. skipped_days = the gap between highest_contiguous and the first
|
|
28
|
+
* non-contiguous-complete day (these are days the member needs to
|
|
29
|
+
* back-fill before routing forward)
|
|
30
|
+
* 10. Read runtime/atlas-state.md if it exists. Parse the canonical
|
|
31
|
+
* fields (First-touch, Days completed, Days skipped, Last-touch-day,
|
|
32
|
+
* plus any other fields written by downstream phases).
|
|
33
|
+
* 11. Reconcile: if cache.Days_completed != completed_days OR
|
|
34
|
+
* cache.Days_skipped != skipped_days OR cache.Last_touch_day
|
|
35
|
+
* != highest_contiguous, rewrite atlas-state.md preserving
|
|
36
|
+
* every other field verbatim. Only the 3 Phase-0a-owned fields
|
|
37
|
+
* change.
|
|
38
|
+
*
|
|
39
|
+
* Returns structured JSON. Skills invoke and surface consultatively.
|
|
40
|
+
*
|
|
41
|
+
* Special cases handled:
|
|
42
|
+
*
|
|
43
|
+
* - Empty workspace (no atlas-state.md): treat all values as
|
|
44
|
+
* null/empty. current_day = 1. Phase 2 first-session orientation
|
|
45
|
+
* writes the file (via Write tool in skill prose, not here).
|
|
46
|
+
*
|
|
47
|
+
* - Pre-shipped skeleton (atlas-state.md exists, First-touch: null):
|
|
48
|
+
* same as empty workspace. current_day = 1. The skeleton lives;
|
|
49
|
+
* Phase 2 will populate First-touch.
|
|
50
|
+
*
|
|
51
|
+
* - Member-written annotations in atlas-state.md: preserved verbatim
|
|
52
|
+
* across the reconciliation rewrite.
|
|
53
|
+
*
|
|
54
|
+
* - Rep-log pattern paths (runtime/{ordinal}-rep-log.md): handled via
|
|
55
|
+
* Glob-style scan when the artifact-registry entry uses a pattern.
|
|
56
|
+
*
|
|
57
|
+
* - Required: false outputs: skipped from the completeness check
|
|
58
|
+
* (path-aware, opt-in steps don't block day-completion).
|
|
59
|
+
*/
|
|
60
|
+
export interface ResolveStateInputs {
|
|
61
|
+
workspacePath: string;
|
|
62
|
+
json?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface DayStatus {
|
|
65
|
+
day_number: number;
|
|
66
|
+
complete: boolean;
|
|
67
|
+
missing_outputs: string[];
|
|
68
|
+
}
|
|
69
|
+
export interface AtlasStateFields {
|
|
70
|
+
first_touch: string | null;
|
|
71
|
+
urgency: string;
|
|
72
|
+
external_deadline: string | null;
|
|
73
|
+
days_completed: number[];
|
|
74
|
+
days_skipped: number[];
|
|
75
|
+
file_anomalies: string[];
|
|
76
|
+
last_touch_day: number;
|
|
77
|
+
extra_lines: string[];
|
|
78
|
+
}
|
|
79
|
+
export interface ResolveStateResult {
|
|
80
|
+
exitCode: number;
|
|
81
|
+
workspace_path: string;
|
|
82
|
+
current_day: number;
|
|
83
|
+
completed_days: number[];
|
|
84
|
+
skipped_days: number[];
|
|
85
|
+
skip_detected: boolean;
|
|
86
|
+
next_skill: string | null;
|
|
87
|
+
atlas_state_rewritten: boolean;
|
|
88
|
+
atlas_state_path: string;
|
|
89
|
+
is_first_session: boolean;
|
|
90
|
+
duration_ms: number;
|
|
91
|
+
day_walk: DayStatus[];
|
|
92
|
+
}
|
|
93
|
+
export declare function runResolveState(inputs: ResolveStateInputs): Promise<ResolveStateResult>;
|
|
94
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolve-state/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAMH,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IAEvB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB;AAqRD,wBAAsB,eAAe,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4H7F"}
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* seyola-runtime resolve-state — the I-010 architectural fix.
|
|
3
|
+
*
|
|
4
|
+
* Reads the day-graph + artifact-registry + workspace filesystem and
|
|
5
|
+
* computes the member's current day deterministically. Replaces the
|
|
6
|
+
* Phase 0a algorithm in atlas/SKILL.md that was previously LLM-
|
|
7
|
+
* interpreted (and prone to the defensive-Bash regression).
|
|
8
|
+
*
|
|
9
|
+
* Algorithm (deterministic; same input → same output):
|
|
10
|
+
*
|
|
11
|
+
* 1. Load .seyola/pack/architecture/day-graph.yaml
|
|
12
|
+
* 2. Load .seyola/pack/architecture/artifact-registry.yaml
|
|
13
|
+
* 3. For each day in day-graph.days[] where status: active, in
|
|
14
|
+
* ascending day order:
|
|
15
|
+
* a. For each step in steps[], collect artifact IDs from outputs[]
|
|
16
|
+
* where step is `required: true` (default true if unset)
|
|
17
|
+
* b. Resolve each artifact ID to its primary filesystem path via
|
|
18
|
+
* artifact-registry. Try aliases if primary doesn't exist.
|
|
19
|
+
* c. Check existence via fs.existsSync
|
|
20
|
+
* d. The day is COMPLETE iff every required output exists
|
|
21
|
+
* 4. completed_days = set of day numbers where complete=true
|
|
22
|
+
* 5. highest_contiguous = largest N such that {1..N} ⊆ completed_days
|
|
23
|
+
* 6. non_contiguous_completes = completed_days \ {1..highest_contiguous}
|
|
24
|
+
* 7. current_day = highest_contiguous + 1
|
|
25
|
+
* (unless current_day exceeds max active day — then program complete)
|
|
26
|
+
* 8. skip_detected = non_contiguous_completes is non-empty
|
|
27
|
+
* 9. skipped_days = the gap between highest_contiguous and the first
|
|
28
|
+
* non-contiguous-complete day (these are days the member needs to
|
|
29
|
+
* back-fill before routing forward)
|
|
30
|
+
* 10. Read runtime/atlas-state.md if it exists. Parse the canonical
|
|
31
|
+
* fields (First-touch, Days completed, Days skipped, Last-touch-day,
|
|
32
|
+
* plus any other fields written by downstream phases).
|
|
33
|
+
* 11. Reconcile: if cache.Days_completed != completed_days OR
|
|
34
|
+
* cache.Days_skipped != skipped_days OR cache.Last_touch_day
|
|
35
|
+
* != highest_contiguous, rewrite atlas-state.md preserving
|
|
36
|
+
* every other field verbatim. Only the 3 Phase-0a-owned fields
|
|
37
|
+
* change.
|
|
38
|
+
*
|
|
39
|
+
* Returns structured JSON. Skills invoke and surface consultatively.
|
|
40
|
+
*
|
|
41
|
+
* Special cases handled:
|
|
42
|
+
*
|
|
43
|
+
* - Empty workspace (no atlas-state.md): treat all values as
|
|
44
|
+
* null/empty. current_day = 1. Phase 2 first-session orientation
|
|
45
|
+
* writes the file (via Write tool in skill prose, not here).
|
|
46
|
+
*
|
|
47
|
+
* - Pre-shipped skeleton (atlas-state.md exists, First-touch: null):
|
|
48
|
+
* same as empty workspace. current_day = 1. The skeleton lives;
|
|
49
|
+
* Phase 2 will populate First-touch.
|
|
50
|
+
*
|
|
51
|
+
* - Member-written annotations in atlas-state.md: preserved verbatim
|
|
52
|
+
* across the reconciliation rewrite.
|
|
53
|
+
*
|
|
54
|
+
* - Rep-log pattern paths (runtime/{ordinal}-rep-log.md): handled via
|
|
55
|
+
* Glob-style scan when the artifact-registry entry uses a pattern.
|
|
56
|
+
*
|
|
57
|
+
* - Required: false outputs: skipped from the completeness check
|
|
58
|
+
* (path-aware, opt-in steps don't block day-completion).
|
|
59
|
+
*/
|
|
60
|
+
import { existsSync, readFileSync, writeFileSync, readdirSync } from "node:fs";
|
|
61
|
+
import { join, resolve } from "node:path";
|
|
62
|
+
import { parse as parseYamlText } from "yaml";
|
|
63
|
+
function parseYaml(text) {
|
|
64
|
+
return parseYamlText(text);
|
|
65
|
+
}
|
|
66
|
+
function resolveArtifactPath(registry, artifactId, workspacePath) {
|
|
67
|
+
const entry = registry.artifacts.find(a => a.id === artifactId);
|
|
68
|
+
if (!entry)
|
|
69
|
+
return null;
|
|
70
|
+
const cp = entry.current_paths ?? {};
|
|
71
|
+
const primary = cp.primary ?? cp.machine_readable ?? "";
|
|
72
|
+
const aliases = cp.aliases ?? [];
|
|
73
|
+
return {
|
|
74
|
+
primary: primary ? join(workspacePath, primary) : "",
|
|
75
|
+
aliases: aliases.map(a => join(workspacePath, a)),
|
|
76
|
+
pattern: entry.pattern_path,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function checkArtifactExists(registry, artifactId, workspacePath) {
|
|
80
|
+
const paths = resolveArtifactPath(registry, artifactId, workspacePath);
|
|
81
|
+
if (!paths)
|
|
82
|
+
return false;
|
|
83
|
+
if (paths.pattern) {
|
|
84
|
+
// Pattern paths: scan the parent directory for matching files
|
|
85
|
+
// e.g., "runtime/{ordinal}-rep-log.md" → check if any file matches
|
|
86
|
+
const parentDir = join(workspacePath, paths.pattern.split("/").slice(0, -1).join("/"));
|
|
87
|
+
if (!existsSync(parentDir))
|
|
88
|
+
return false;
|
|
89
|
+
const filenamePattern = paths.pattern.split("/").pop() ?? "";
|
|
90
|
+
const regex = new RegExp("^" + filenamePattern.replace(/\{[^}]+\}/g, ".*").replace(/\./g, "\\.") + "$");
|
|
91
|
+
try {
|
|
92
|
+
const entries = readdirSync(parentDir);
|
|
93
|
+
return entries.some(e => regex.test(e));
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (paths.primary && existsSync(paths.primary))
|
|
100
|
+
return true;
|
|
101
|
+
for (const alias of paths.aliases) {
|
|
102
|
+
if (existsSync(alias))
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
function walkDayGraph(dayGraph, registry, workspacePath) {
|
|
108
|
+
const result = [];
|
|
109
|
+
const activeDays = (dayGraph.days ?? [])
|
|
110
|
+
.filter(d => d.status === "active")
|
|
111
|
+
.sort((a, b) => a.day - b.day);
|
|
112
|
+
for (const day of activeDays) {
|
|
113
|
+
const missing = [];
|
|
114
|
+
for (const step of day.steps ?? []) {
|
|
115
|
+
const isRequired = step.required !== false; // default true
|
|
116
|
+
if (!isRequired)
|
|
117
|
+
continue;
|
|
118
|
+
for (const outputId of step.outputs ?? []) {
|
|
119
|
+
if (!checkArtifactExists(registry, outputId, workspacePath)) {
|
|
120
|
+
missing.push(outputId);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
result.push({
|
|
125
|
+
day_number: day.day,
|
|
126
|
+
complete: missing.length === 0,
|
|
127
|
+
missing_outputs: missing,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
function computeCurrentDay(walk) {
|
|
133
|
+
const completed = walk.filter(d => d.complete).map(d => d.day_number).sort((a, b) => a - b);
|
|
134
|
+
// highest_contiguous: largest N such that {1..N} ⊆ completed
|
|
135
|
+
let highest = 0;
|
|
136
|
+
const completedSet = new Set(completed);
|
|
137
|
+
for (let n = 1; n <= Math.max(...completed, 0) + 1; n++) {
|
|
138
|
+
if (completedSet.has(n))
|
|
139
|
+
highest = n;
|
|
140
|
+
else
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
const skipped = completed.filter(d => d > highest);
|
|
144
|
+
// Day numbers between highest+1 and the lowest skipped-complete day are the "skipped days"
|
|
145
|
+
// (the ones the member needs to back-fill)
|
|
146
|
+
let skippedDays = [];
|
|
147
|
+
if (skipped.length > 0) {
|
|
148
|
+
const lowestSkipped = skipped[0];
|
|
149
|
+
for (let n = highest + 1; n < lowestSkipped; n++) {
|
|
150
|
+
skippedDays.push(n);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const current = highest + 1;
|
|
154
|
+
return {
|
|
155
|
+
completed,
|
|
156
|
+
skipped: skippedDays,
|
|
157
|
+
current,
|
|
158
|
+
skip_detected: skippedDays.length > 0,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function getNextSkill(dayGraph, currentDay) {
|
|
162
|
+
// Returns the FIRST skill to run for current_day.
|
|
163
|
+
// The day-graph's day-level `next_skill` field is the NEXT day's first
|
|
164
|
+
// skill (used by opens.day routing), NOT current day's first skill.
|
|
165
|
+
// So we always use steps[0].skill of the current day.
|
|
166
|
+
const day = dayGraph.days?.find(d => d.day === currentDay);
|
|
167
|
+
if (!day)
|
|
168
|
+
return null;
|
|
169
|
+
const firstStep = day.steps?.[0];
|
|
170
|
+
return firstStep?.skill ?? null;
|
|
171
|
+
}
|
|
172
|
+
function parseAtlasState(text) {
|
|
173
|
+
const lines = text.split("\n");
|
|
174
|
+
const result = {
|
|
175
|
+
first_touch: null,
|
|
176
|
+
urgency: "not_yet_surfaced",
|
|
177
|
+
external_deadline: null,
|
|
178
|
+
days_completed: [],
|
|
179
|
+
days_skipped: [],
|
|
180
|
+
file_anomalies: [],
|
|
181
|
+
last_touch_day: 0,
|
|
182
|
+
extra_lines: [],
|
|
183
|
+
};
|
|
184
|
+
for (const line of lines) {
|
|
185
|
+
const ftMatch = line.match(/^First-touch:\s*(.*)$/);
|
|
186
|
+
if (ftMatch) {
|
|
187
|
+
const v = ftMatch[1].trim();
|
|
188
|
+
result.first_touch = v === "null" || v === "" ? null : v;
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const urgMatch = line.match(/^Urgency:\s*(.*)$/);
|
|
192
|
+
if (urgMatch) {
|
|
193
|
+
result.urgency = urgMatch[1].trim();
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
const edMatch = line.match(/^External-deadline:\s*(.*)$/);
|
|
197
|
+
if (edMatch) {
|
|
198
|
+
const v = edMatch[1].trim();
|
|
199
|
+
result.external_deadline = v === "null" || v === "" ? null : v;
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
const dcMatch = line.match(/^Days completed:\s*\[(.*)\]$/);
|
|
203
|
+
if (dcMatch) {
|
|
204
|
+
result.days_completed = dcMatch[1]
|
|
205
|
+
.split(",")
|
|
206
|
+
.map(s => parseInt(s.trim(), 10))
|
|
207
|
+
.filter(n => !isNaN(n));
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
const dsMatch = line.match(/^Days skipped:\s*\[(.*)\]$/);
|
|
211
|
+
if (dsMatch) {
|
|
212
|
+
result.days_skipped = dsMatch[1]
|
|
213
|
+
.split(",")
|
|
214
|
+
.map(s => parseInt(s.trim(), 10))
|
|
215
|
+
.filter(n => !isNaN(n));
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
const faMatch = line.match(/^File anomalies:\s*\[(.*)\]$/);
|
|
219
|
+
if (faMatch) {
|
|
220
|
+
result.file_anomalies = faMatch[1]
|
|
221
|
+
.split(",")
|
|
222
|
+
.map(s => s.trim())
|
|
223
|
+
.filter(s => s.length > 0);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
const ltMatch = line.match(/^Last-touch-day:\s*(\d+)$/);
|
|
227
|
+
if (ltMatch) {
|
|
228
|
+
result.last_touch_day = parseInt(ltMatch[1], 10);
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
// Preserve everything else verbatim (other fields like
|
|
232
|
+
// urgency_capture, pause_state, buyer_fit_signal, reverse_drift_state,
|
|
233
|
+
// headers, comments, annotations).
|
|
234
|
+
result.extra_lines.push(line);
|
|
235
|
+
}
|
|
236
|
+
return result;
|
|
237
|
+
}
|
|
238
|
+
function serializeAtlasState(fields) {
|
|
239
|
+
// Reconstruct the file from the canonical structure + preserved extras.
|
|
240
|
+
// Phase 2 / first-session orientation uses this same shape.
|
|
241
|
+
const canonicalLines = [];
|
|
242
|
+
const seenKeys = new Set();
|
|
243
|
+
// Walk extras first, replacing canonical-field lines as we go.
|
|
244
|
+
// This preserves comments, headers, and other phase-owned fields in
|
|
245
|
+
// their original order.
|
|
246
|
+
for (const line of fields.extra_lines) {
|
|
247
|
+
if (/^First-touch:/.test(line)) {
|
|
248
|
+
canonicalLines.push(`First-touch: ${fields.first_touch ?? "null"}`);
|
|
249
|
+
seenKeys.add("first_touch");
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
if (/^Urgency:/.test(line)) {
|
|
253
|
+
canonicalLines.push(`Urgency: ${fields.urgency}`);
|
|
254
|
+
seenKeys.add("urgency");
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
if (/^External-deadline:/.test(line)) {
|
|
258
|
+
canonicalLines.push(`External-deadline: ${fields.external_deadline ?? "null"}`);
|
|
259
|
+
seenKeys.add("external_deadline");
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
if (/^Days completed:/.test(line)) {
|
|
263
|
+
canonicalLines.push(`Days completed: [${fields.days_completed.join(", ")}]`);
|
|
264
|
+
seenKeys.add("days_completed");
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
if (/^Days skipped:/.test(line)) {
|
|
268
|
+
canonicalLines.push(`Days skipped: [${fields.days_skipped.join(", ")}]`);
|
|
269
|
+
seenKeys.add("days_skipped");
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
if (/^File anomalies:/.test(line)) {
|
|
273
|
+
canonicalLines.push(`File anomalies: [${fields.file_anomalies.join(", ")}]`);
|
|
274
|
+
seenKeys.add("file_anomalies");
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
if (/^Last-touch-day:/.test(line)) {
|
|
278
|
+
canonicalLines.push(`Last-touch-day: ${fields.last_touch_day}`);
|
|
279
|
+
seenKeys.add("last_touch_day");
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
canonicalLines.push(line);
|
|
283
|
+
}
|
|
284
|
+
// If any canonical field was never present in the file, append it
|
|
285
|
+
// (covers freshly-skeletoned files).
|
|
286
|
+
if (!seenKeys.has("first_touch"))
|
|
287
|
+
canonicalLines.push(`First-touch: ${fields.first_touch ?? "null"}`);
|
|
288
|
+
if (!seenKeys.has("urgency"))
|
|
289
|
+
canonicalLines.push(`Urgency: ${fields.urgency}`);
|
|
290
|
+
if (!seenKeys.has("external_deadline"))
|
|
291
|
+
canonicalLines.push(`External-deadline: ${fields.external_deadline ?? "null"}`);
|
|
292
|
+
if (!seenKeys.has("days_completed"))
|
|
293
|
+
canonicalLines.push(`Days completed: [${fields.days_completed.join(", ")}]`);
|
|
294
|
+
if (!seenKeys.has("days_skipped"))
|
|
295
|
+
canonicalLines.push(`Days skipped: [${fields.days_skipped.join(", ")}]`);
|
|
296
|
+
if (!seenKeys.has("file_anomalies"))
|
|
297
|
+
canonicalLines.push(`File anomalies: [${fields.file_anomalies.join(", ")}]`);
|
|
298
|
+
if (!seenKeys.has("last_touch_day"))
|
|
299
|
+
canonicalLines.push(`Last-touch-day: ${fields.last_touch_day}`);
|
|
300
|
+
return canonicalLines.join("\n");
|
|
301
|
+
}
|
|
302
|
+
export async function runResolveState(inputs) {
|
|
303
|
+
const start = Date.now();
|
|
304
|
+
const workspace = resolve(inputs.workspacePath);
|
|
305
|
+
const dayGraphPath = join(workspace, ".seyola", "pack", "architecture", "day-graph.yaml");
|
|
306
|
+
const registryPath = join(workspace, ".seyola", "pack", "architecture", "artifact-registry.yaml");
|
|
307
|
+
if (!existsSync(dayGraphPath)) {
|
|
308
|
+
const result = {
|
|
309
|
+
exitCode: 2,
|
|
310
|
+
workspace_path: workspace,
|
|
311
|
+
current_day: 0,
|
|
312
|
+
completed_days: [],
|
|
313
|
+
skipped_days: [],
|
|
314
|
+
skip_detected: false,
|
|
315
|
+
next_skill: null,
|
|
316
|
+
atlas_state_rewritten: false,
|
|
317
|
+
atlas_state_path: join(workspace, "runtime", "atlas-state.md"),
|
|
318
|
+
is_first_session: false,
|
|
319
|
+
duration_ms: Date.now() - start,
|
|
320
|
+
day_walk: [],
|
|
321
|
+
};
|
|
322
|
+
if (inputs.json)
|
|
323
|
+
console.log(JSON.stringify({ ...result, error: "day-graph.yaml not found" }, null, 2));
|
|
324
|
+
else
|
|
325
|
+
console.error("seyola-runtime resolve-state: day-graph.yaml not found at " + dayGraphPath);
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
328
|
+
if (!existsSync(registryPath)) {
|
|
329
|
+
const result = {
|
|
330
|
+
exitCode: 2,
|
|
331
|
+
workspace_path: workspace,
|
|
332
|
+
current_day: 0,
|
|
333
|
+
completed_days: [],
|
|
334
|
+
skipped_days: [],
|
|
335
|
+
skip_detected: false,
|
|
336
|
+
next_skill: null,
|
|
337
|
+
atlas_state_rewritten: false,
|
|
338
|
+
atlas_state_path: join(workspace, "runtime", "atlas-state.md"),
|
|
339
|
+
is_first_session: false,
|
|
340
|
+
duration_ms: Date.now() - start,
|
|
341
|
+
day_walk: [],
|
|
342
|
+
};
|
|
343
|
+
if (inputs.json)
|
|
344
|
+
console.log(JSON.stringify({ ...result, error: "artifact-registry.yaml not found" }, null, 2));
|
|
345
|
+
else
|
|
346
|
+
console.error("seyola-runtime resolve-state: artifact-registry.yaml not found at " + registryPath);
|
|
347
|
+
return result;
|
|
348
|
+
}
|
|
349
|
+
const dayGraph = parseYaml(readFileSync(dayGraphPath, "utf8"));
|
|
350
|
+
const registry = parseYaml(readFileSync(registryPath, "utf8"));
|
|
351
|
+
const walk = walkDayGraph(dayGraph, registry, workspace);
|
|
352
|
+
const computed = computeCurrentDay(walk);
|
|
353
|
+
const nextSkill = getNextSkill(dayGraph, computed.current);
|
|
354
|
+
// Atlas-state reconciliation
|
|
355
|
+
const atlasStatePath = join(workspace, "runtime", "atlas-state.md");
|
|
356
|
+
let atlasStateRewritten = false;
|
|
357
|
+
let isFirstSession = false;
|
|
358
|
+
if (existsSync(atlasStatePath)) {
|
|
359
|
+
const text = readFileSync(atlasStatePath, "utf8");
|
|
360
|
+
const cache = parseAtlasState(text);
|
|
361
|
+
isFirstSession = cache.first_touch === null;
|
|
362
|
+
// Compute the reconciled fields (Phase-0a owns only 3 fields)
|
|
363
|
+
const reconciled = {
|
|
364
|
+
...cache,
|
|
365
|
+
days_completed: computed.completed,
|
|
366
|
+
days_skipped: computed.skipped,
|
|
367
|
+
last_touch_day: Math.max(...computed.completed, 0),
|
|
368
|
+
};
|
|
369
|
+
// Compare against cache to decide if rewrite is needed
|
|
370
|
+
const sameCompleted = cache.days_completed.length === reconciled.days_completed.length &&
|
|
371
|
+
cache.days_completed.every((v, i) => v === reconciled.days_completed[i]);
|
|
372
|
+
const sameSkipped = cache.days_skipped.length === reconciled.days_skipped.length &&
|
|
373
|
+
cache.days_skipped.every((v, i) => v === reconciled.days_skipped[i]);
|
|
374
|
+
const sameLastTouch = cache.last_touch_day === reconciled.last_touch_day;
|
|
375
|
+
if (!sameCompleted || !sameSkipped || !sameLastTouch) {
|
|
376
|
+
const newText = serializeAtlasState(reconciled);
|
|
377
|
+
writeFileSync(atlasStatePath, newText, "utf8");
|
|
378
|
+
atlasStateRewritten = true;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
// No atlas-state.md present. Treat as first-session. Don't create
|
|
383
|
+
// the file here — Phase 2 first-session orientation owns creation
|
|
384
|
+
// (or the bundle's pre-shipped skeleton, since v0.12.2).
|
|
385
|
+
isFirstSession = true;
|
|
386
|
+
}
|
|
387
|
+
const result = {
|
|
388
|
+
exitCode: 0,
|
|
389
|
+
workspace_path: workspace,
|
|
390
|
+
current_day: computed.current,
|
|
391
|
+
completed_days: computed.completed,
|
|
392
|
+
skipped_days: computed.skipped,
|
|
393
|
+
skip_detected: computed.skip_detected,
|
|
394
|
+
next_skill: nextSkill,
|
|
395
|
+
atlas_state_rewritten: atlasStateRewritten,
|
|
396
|
+
atlas_state_path: atlasStatePath,
|
|
397
|
+
is_first_session: isFirstSession,
|
|
398
|
+
duration_ms: Date.now() - start,
|
|
399
|
+
day_walk: walk,
|
|
400
|
+
};
|
|
401
|
+
if (inputs.json) {
|
|
402
|
+
console.log(JSON.stringify(result, null, 2));
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
console.error(`seyola-runtime resolve-state: status=ok, exitCode=0\n` +
|
|
406
|
+
` workspace: ${workspace}\n` +
|
|
407
|
+
` current_day: ${result.current_day}\n` +
|
|
408
|
+
` completed_days: [${result.completed_days.join(", ")}]\n` +
|
|
409
|
+
` skipped_days: [${result.skipped_days.join(", ")}]\n` +
|
|
410
|
+
` skip_detected: ${result.skip_detected}\n` +
|
|
411
|
+
` next_skill: ${result.next_skill ?? "(none)"}\n` +
|
|
412
|
+
` atlas_state_rewritten: ${result.atlas_state_rewritten}\n` +
|
|
413
|
+
` is_first_session: ${result.is_first_session}\n` +
|
|
414
|
+
` duration: ${result.duration_ms}ms`);
|
|
415
|
+
}
|
|
416
|
+
return result;
|
|
417
|
+
}
|
|
418
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resolve-state/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAkE9C,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,mBAAmB,CAC1B,QAA0B,EAC1B,UAAkB,EAClB,aAAqB;IAErB,MAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC;IAChE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,EAAE,GAAG,KAAK,CAAC,aAAa,IAAI,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,gBAAgB,IAAI,EAAE,CAAC;IACxD,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC;IACjC,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;QACpD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC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