agentxchain 2.142.0 → 2.143.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/package.json
CHANGED
|
@@ -42,12 +42,10 @@ function updateSidebarPosition(content, nextPosition) {
|
|
|
42
42
|
const body = content.slice(frontmatterEnd + 5);
|
|
43
43
|
const expectedLine = `sidebar_position: ${nextPosition}`;
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
updatedFrontmatter = frontmatter.replace(/^---\n/, `---\n${expectedLine}\n`);
|
|
50
|
-
}
|
|
45
|
+
// Strip ALL existing sidebar_position lines (handles duplicates from manual edits)
|
|
46
|
+
let strippedFrontmatter = frontmatter.replace(/^sidebar_position:\s*-?\d+\s*\n/gm, '');
|
|
47
|
+
// Insert the canonical position after the opening delimiter
|
|
48
|
+
let updatedFrontmatter = strippedFrontmatter.replace(/^---\n/, `---\n${expectedLine}\n`);
|
|
51
49
|
|
|
52
50
|
const updated = updatedFrontmatter + body;
|
|
53
51
|
return {
|
package/src/lib/export.js
CHANGED
|
@@ -6,6 +6,10 @@ import { join, relative, resolve } from 'node:path';
|
|
|
6
6
|
import { loadProjectContext, loadProjectState } from './config.js';
|
|
7
7
|
import { loadCoordinatorConfig, COORDINATOR_CONFIG_FILE } from './coordinator-config.js';
|
|
8
8
|
import { loadCoordinatorState } from './coordinator-state.js';
|
|
9
|
+
import {
|
|
10
|
+
RUN_CONTINUITY_DIRECTORY_ROOTS,
|
|
11
|
+
RUN_CONTINUITY_STATE_FILES,
|
|
12
|
+
} from './repo-observer.js';
|
|
9
13
|
import { normalizeRunProvenance } from './run-provenance.js';
|
|
10
14
|
import { getDashboardPid, getDashboardSession } from '../commands/dashboard.js';
|
|
11
15
|
import { readRepoDecisions, summarizeRepoDecisions } from './repo-decisions.js';
|
|
@@ -23,62 +27,24 @@ const COORDINATOR_INCLUDED_ROOTS = [
|
|
|
23
27
|
'.agentxchain/multirepo/RECOVERY_REPORT.md',
|
|
24
28
|
];
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
const RUN_EXPORT_ONLY_ROOTS = [
|
|
27
31
|
'agentxchain.json',
|
|
28
|
-
'TALK.md',
|
|
29
32
|
'.agentxchain-dashboard.pid',
|
|
30
33
|
'.agentxchain-dashboard.json',
|
|
31
|
-
'.agentxchain/state.json',
|
|
32
|
-
'.agentxchain/session.json',
|
|
33
|
-
'.agentxchain/history.jsonl',
|
|
34
|
-
'.agentxchain/decision-ledger.jsonl',
|
|
35
|
-
'.agentxchain/repo-decisions.jsonl',
|
|
36
|
-
'.agentxchain/hook-audit.jsonl',
|
|
37
|
-
'.agentxchain/hook-annotations.jsonl',
|
|
38
|
-
'.agentxchain/notification-audit.jsonl',
|
|
39
|
-
'.agentxchain/run-history.jsonl',
|
|
40
|
-
'.agentxchain/events.jsonl',
|
|
41
|
-
'.agentxchain/schedule-state.json',
|
|
42
|
-
'.agentxchain/schedule-daemon.json',
|
|
43
|
-
'.agentxchain/continuous-session.json',
|
|
44
|
-
'.agentxchain/human-escalations.jsonl',
|
|
45
|
-
'.agentxchain/sla-reminders.json',
|
|
46
|
-
'.agentxchain/dispatch',
|
|
47
|
-
'.agentxchain/staging',
|
|
48
|
-
'.agentxchain/transactions/accept',
|
|
49
|
-
'.agentxchain/intake',
|
|
50
|
-
'.agentxchain/multirepo',
|
|
51
|
-
'.agentxchain/reviews',
|
|
52
|
-
'.agentxchain/proposed',
|
|
53
|
-
'.agentxchain/reports',
|
|
54
34
|
'.planning',
|
|
55
35
|
];
|
|
56
36
|
|
|
37
|
+
export const RUN_EXPORT_INCLUDED_ROOTS = [
|
|
38
|
+
'agentxchain.json',
|
|
39
|
+
...RUN_CONTINUITY_STATE_FILES,
|
|
40
|
+
...RUN_CONTINUITY_DIRECTORY_ROOTS,
|
|
41
|
+
...RUN_EXPORT_ONLY_ROOTS.filter((root) => root !== 'agentxchain.json'),
|
|
42
|
+
];
|
|
43
|
+
|
|
57
44
|
export const RUN_RESTORE_ROOTS = [
|
|
58
45
|
'agentxchain.json',
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
'.agentxchain/session.json',
|
|
62
|
-
'.agentxchain/history.jsonl',
|
|
63
|
-
'.agentxchain/decision-ledger.jsonl',
|
|
64
|
-
'.agentxchain/hook-audit.jsonl',
|
|
65
|
-
'.agentxchain/hook-annotations.jsonl',
|
|
66
|
-
'.agentxchain/notification-audit.jsonl',
|
|
67
|
-
'.agentxchain/run-history.jsonl',
|
|
68
|
-
'.agentxchain/events.jsonl',
|
|
69
|
-
'.agentxchain/schedule-state.json',
|
|
70
|
-
'.agentxchain/schedule-daemon.json',
|
|
71
|
-
'.agentxchain/continuous-session.json',
|
|
72
|
-
'.agentxchain/human-escalations.jsonl',
|
|
73
|
-
'.agentxchain/sla-reminders.json',
|
|
74
|
-
'.agentxchain/dispatch',
|
|
75
|
-
'.agentxchain/staging',
|
|
76
|
-
'.agentxchain/transactions/accept',
|
|
77
|
-
'.agentxchain/intake',
|
|
78
|
-
'.agentxchain/multirepo',
|
|
79
|
-
'.agentxchain/reviews',
|
|
80
|
-
'.agentxchain/proposed',
|
|
81
|
-
'.agentxchain/reports',
|
|
46
|
+
...RUN_CONTINUITY_STATE_FILES,
|
|
47
|
+
...RUN_CONTINUITY_DIRECTORY_ROOTS,
|
|
82
48
|
'.planning',
|
|
83
49
|
];
|
|
84
50
|
|
|
@@ -3547,6 +3547,7 @@ function _acceptGovernedTurnLocked(root, config, opts) {
|
|
|
3547
3547
|
// protocol violation for authoritative completed turns. A workspace artifact
|
|
3548
3548
|
// declares "I mutated repo files" — if files_changed is empty, the declaration
|
|
3549
3549
|
// is incoherent and must be rejected before replay or history persistence.
|
|
3550
|
+
// proposed turns cannot use workspace artifacts (validator rejects earlier).
|
|
3550
3551
|
if (artifactType === 'workspace'
|
|
3551
3552
|
&& writeAuthority === 'authoritative'
|
|
3552
3553
|
&& turnResult.status === 'completed'
|
package/src/lib/repo-observer.js
CHANGED
|
@@ -22,20 +22,21 @@ import { join } from 'path';
|
|
|
22
22
|
// They must never be attributed to agents in observation or baseline checks.
|
|
23
23
|
// Frozen per Session #19 decision.
|
|
24
24
|
|
|
25
|
-
const OPERATIONAL_PATH_PREFIXES = [
|
|
25
|
+
export const OPERATIONAL_PATH_PREFIXES = Object.freeze([
|
|
26
26
|
'.agentxchain/dispatch/',
|
|
27
|
-
'.agentxchain/dispatch-progress
|
|
27
|
+
'.agentxchain/dispatch-progress',
|
|
28
28
|
'.agentxchain/staging/',
|
|
29
29
|
'.agentxchain/intake/',
|
|
30
30
|
'.agentxchain/locks/',
|
|
31
31
|
'.agentxchain/transactions/',
|
|
32
32
|
'.agentxchain/missions/',
|
|
33
33
|
'.agentxchain/multirepo/',
|
|
34
|
-
|
|
34
|
+
'.agentxchain/prompts/',
|
|
35
|
+
]);
|
|
35
36
|
|
|
36
37
|
// Orchestrator-owned state files that agents must never be blamed for modifying.
|
|
37
38
|
// These are written exclusively by the orchestrator (§4.1 State Ownership Rule).
|
|
38
|
-
const ORCHESTRATOR_STATE_FILES = [
|
|
39
|
+
export const ORCHESTRATOR_STATE_FILES = Object.freeze([
|
|
39
40
|
'.agentxchain/state.json',
|
|
40
41
|
'.agentxchain/session.json',
|
|
41
42
|
'.agentxchain/history.jsonl',
|
|
@@ -52,18 +53,36 @@ const ORCHESTRATOR_STATE_FILES = [
|
|
|
52
53
|
'.agentxchain/continuous-session.json',
|
|
53
54
|
'.agentxchain/human-escalations.jsonl',
|
|
54
55
|
'.agentxchain/sla-reminders.json',
|
|
56
|
+
'.agentxchain/SESSION_RECOVERY.md',
|
|
57
|
+
'.agentxchain/migration-report.md',
|
|
55
58
|
'TALK.md',
|
|
56
59
|
'HUMAN_TASKS.md',
|
|
57
|
-
];
|
|
60
|
+
]);
|
|
58
61
|
|
|
59
62
|
// Evidence paths may legitimately remain dirty across turns without blocking the
|
|
60
63
|
// next code-writing assignment. They still remain actor-observable so review
|
|
61
64
|
// accountability is preserved during acceptance.
|
|
62
|
-
const BASELINE_EXEMPT_PATH_PREFIXES = [
|
|
65
|
+
export const BASELINE_EXEMPT_PATH_PREFIXES = Object.freeze([
|
|
63
66
|
'.agentxchain/reviews/',
|
|
64
67
|
'.agentxchain/reports/',
|
|
65
68
|
'.agentxchain/proposed/',
|
|
66
|
-
];
|
|
69
|
+
]);
|
|
70
|
+
|
|
71
|
+
// Continuity export/restore must stay aligned with orchestrator ownership,
|
|
72
|
+
// but only for the subset that represents governed run state.
|
|
73
|
+
export const RUN_CONTINUITY_STATE_FILES = Object.freeze([
|
|
74
|
+
...ORCHESTRATOR_STATE_FILES.filter((filePath) => filePath !== 'HUMAN_TASKS.md'),
|
|
75
|
+
]);
|
|
76
|
+
|
|
77
|
+
export const RUN_CONTINUITY_DIRECTORY_ROOTS = Object.freeze([
|
|
78
|
+
'.agentxchain/dispatch',
|
|
79
|
+
'.agentxchain/staging',
|
|
80
|
+
'.agentxchain/transactions/accept',
|
|
81
|
+
'.agentxchain/intake',
|
|
82
|
+
'.agentxchain/missions',
|
|
83
|
+
'.agentxchain/multirepo',
|
|
84
|
+
...BASELINE_EXEMPT_PATH_PREFIXES.map((prefix) => prefix.replace(/\/$/, '')),
|
|
85
|
+
]);
|
|
67
86
|
|
|
68
87
|
/**
|
|
69
88
|
* Check whether a file path belongs to orchestrator-owned operational state.
|