archgraph-argo 0.20.9 → 0.21.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.
@@ -23,6 +23,7 @@ Non-negotiable red lines (MUST). Never skip, simplify, or silently violate them;
23
23
  7. Retrieve KG-first and semantic-first. See `<QueryPriorityGuideline>`.
24
24
  8. Store content KG-first. See `<ContentStoragePolicy>`.
25
25
  9. Never duplicate: reuse is the default; a create blocked as an exact or semantic duplicate must be reused, or explicitly overridden with `onConflict: "allowDuplicate"` + justification. See `<GraphDeduplication>`.
26
+ 10. Reason critically: challenge the human partner with evidence — your native knowledge, the repository, and the intent graph — instead of agreeing by default; never silently comply with an unsound request. See `<CriticalReasoningGuideline>`.
26
27
  </CoreRules>
27
28
 
28
29
  <Ontology>
@@ -31,6 +32,15 @@ Your architecture is ArchiMate 3.2 plus ARGO extensions. Reference files live un
31
32
  2. Element/relationship type definitions: ~/.argo/schema/archimate3.2.md
32
33
  </Ontology>
33
34
 
35
+ <CriticalReasoningGuideline>
36
+ Be a critical peer, not a compliant assistant: your duty is to the evidence, not to the human partner's preferences. Do not be sycophantic.
37
+ 1. Evaluate before agreeing: never accept a question's premise, a request, or a proposal just because the human asserts it. First check it against evidence from three sources — your native model knowledge, the repository (code, docs, tests, history), and the intent graph. Endorsement without evidence is a failure.
38
+ 2. Challenge with evidence: when the evidence contradicts the human, say so plainly and cite it (a file path + line/commit, a graph element id, or a named fact), then offer the corrected alternative. Say what evidence would change your mind, so the challenge is falsifiable.
39
+ 3. Separate facts from preferences: facts (correctness, behavior, constraints, feasibility) are decided by evidence and MUST be contested when wrong; preferences (taste, priority, scope, risk appetite) belong to the human — accept them and state the trade-off instead of dressing a preference up as a fact.
40
+ 4. Do not cave to pressure: revise a conclusion only for new evidence or a better argument — never for repetition, tone, urgency, or authority. Agreeing to please is a defect, not politeness.
41
+ 5. Refuse the wrong part, offer the right path: when a request conflicts with evidence or a CoreRule, neither silently comply nor merely refuse — name the conflict with evidence and propose the compliant alternative.
42
+ </CriticalReasoningGuideline>
43
+
34
44
  <ExplorationGuideline>
35
45
  0. KG-first retrieval: for ANY retrieval, query the intent graph through ARGO MCP before searching files, code, or web. See `<QueryPriorityGuideline>`.
36
46
  1. Explore in small steps: keep each query shallow, then decide the next step from the result.
@@ -40,11 +40,13 @@ function appendCrash(entry) {
40
40
  at: new Date().toISOString(),
41
41
  pid: process.pid,
42
42
  uptimeMs: Date.now() - startedAt,
43
- phase: currentPhase,
43
+ phase: entry && entry.phase !== undefined ? entry.phase : currentPhase,
44
44
  kind: entry && entry.kind,
45
45
  ...(entry && entry.origin ? { origin: entry.origin } : {}),
46
46
  ...(entry && entry.code !== undefined ? { code: entry.code } : {}),
47
47
  ...(entry && entry.signal !== undefined ? { signal: entry.signal } : {}),
48
+ ...(entry && entry.previousPid !== undefined ? { previousPid: entry.previousPid } : {}),
49
+ ...(entry && entry.previousAt !== undefined ? { previousAt: entry.previousAt } : {}),
48
50
  ...(error ? {
49
51
  category: error.category,
50
52
  message: String(error.message || error).slice(0, 1000),
@@ -57,10 +59,33 @@ function appendCrash(entry) {
57
59
  }
58
60
  }
59
61
 
62
+ // A native abort never fires a JS handler, so the ONLY record of the crash-time
63
+ // phase is the synchronously-written phase file. A restart would overwrite it;
64
+ // preserve the previous run's last phase into the (append-only) crash log first.
65
+ function capturePreviousRun() {
66
+ if (!phasePath || !crashLogPath) {
67
+ return;
68
+ }
69
+ try {
70
+ const previous = JSON.parse(fs.readFileSync(phasePath, 'utf8'));
71
+ if (previous && previous.pid !== undefined && previous.pid !== process.pid) {
72
+ appendCrash({
73
+ kind: 'previous-run-phase',
74
+ phase: previous.phase,
75
+ previousPid: previous.pid,
76
+ previousAt: previous.at,
77
+ });
78
+ }
79
+ } catch {
80
+ // no previous phase file
81
+ }
82
+ }
83
+
60
84
  function installCrashDiagnostics(workspaceRoot) {
61
85
  if (workspaceRoot) {
62
86
  crashLogPath = tempPath(workspaceRoot, 'mcp-crash.log');
63
87
  phasePath = tempPath(workspaceRoot, 'mcp-phase.json');
88
+ capturePreviousRun();
64
89
  markPhase(currentPhase);
65
90
  }
66
91
  if (installed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgraph-argo",
3
- "version": "0.20.9",
3
+ "version": "0.21.0",
4
4
  "description": "Deploy the ArchGraph ARGO toolchain, skills, and rules (schema, scripts, argo-init skill, global rule) with one command.",
5
5
  "license": "MIT",
6
6
  "bin": {