instar 1.3.10 → 1.3.12

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.10",
3
+ "version": "1.3.12",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env python3
2
+ """Parity reference: lifecycle transitions from the REAL feedback-processor.py.
3
+
4
+ Imports the reference processor without running its CLI main and calls its actual
5
+ `can_transition` + `detect_cycling` over the shared corpus. Emits JSON so the Node
6
+ harness can diff the TS port (both the allowed decision AND the reason string).
7
+
8
+ Usage: python3 _py_transitions_ref.py <processor_path> <corpus_path>
9
+ """
10
+ import sys
11
+ import json
12
+ import importlib.util
13
+
14
+
15
+ def load_processor(path):
16
+ spec = importlib.util.spec_from_file_location("_feedback_processor_ref_tx", path)
17
+ mod = importlib.util.module_from_spec(spec)
18
+ spec.loader.exec_module(mod)
19
+ return mod
20
+
21
+
22
+ def main():
23
+ if len(sys.argv) != 3:
24
+ print("usage: _py_transitions_ref.py <processor_path> <corpus_path>", file=sys.stderr)
25
+ sys.exit(2)
26
+ processor_path, corpus_path = sys.argv[1], sys.argv[2]
27
+ proc = load_processor(processor_path)
28
+ with open(corpus_path, encoding="utf-8") as f:
29
+ corpus = json.load(f)
30
+
31
+ tx_out = []
32
+ for case in corpus["transitions"]:
33
+ allowed, reason = proc.can_transition(
34
+ case["current"],
35
+ case["new"],
36
+ case.get("justification"),
37
+ case.get("context"),
38
+ )
39
+ tx_out.append({"case": case, "allowed": allowed, "reason": reason})
40
+
41
+ cyc_out = []
42
+ for cluster in corpus["cycling"]:
43
+ cyc_out.append({"cluster": cluster, "cycling": proc.detect_cycling(cluster)})
44
+
45
+ sys.stdout.write(json.dumps({"transitions": tx_out, "cycling": cyc_out}, ensure_ascii=False))
46
+
47
+
48
+ if __name__ == "__main__":
49
+ main()
@@ -0,0 +1,40 @@
1
+ {
2
+ "_comment": "Parity corpus for the lifecycle state-machine port. `transitions`: cases for can_transition {current,new,justification?,context?} → [allowed, reason]. `cycling`: cases for detect_cycling {cluster} → bool. Covers legal/illegal transitions, terminal states, the evidence gate (both sides of 20 chars), the dispatch hard gate, and the chronic circuit-breaker (recurrence 2 vs 3).",
3
+ "transitions": [
4
+ { "current": "new", "new": "investigating" },
5
+ { "current": "new", "new": "verified" },
6
+ { "current": "investigating", "new": "research_complete" },
7
+ { "current": "research_complete", "new": "investigating" },
8
+ { "current": "fix_applied", "new": "dispatched", "context": { "dispatch_id": "dsp-123" } },
9
+ { "current": "fix_applied", "new": "dispatched" },
10
+ { "current": "fix_applied", "new": "verified" },
11
+ { "current": "closed", "new": "investigating" },
12
+ { "current": "chronic_escalated", "new": "investigating" },
13
+ { "current": "wontfix", "new": "new" },
14
+ { "current": "bogus_state", "new": "investigating" },
15
+ { "current": "new", "new": "not_a_real_state" },
16
+ { "current": "investigating", "new": "wontfix" },
17
+ { "current": "investigating", "new": "wontfix", "justification": "too short" },
18
+ { "current": "investigating", "new": "wontfix", "justification": "this is a sufficiently long justification over twenty chars" },
19
+ { "current": "verified", "new": "closed", "justification": "short" },
20
+ { "current": "verified", "new": "closed", "justification": "verified stable for 30 days, closing per policy" },
21
+ { "current": "chronic", "new": "chronic_escalated", "justification": "escalating after repeated regressions across three releases" },
22
+ { "current": "verified", "new": "chronic" },
23
+ { "current": "verified", "new": "chronic", "context": { "recurrenceCount": 2 } },
24
+ { "current": "verified", "new": "chronic", "context": { "recurrenceCount": 3 } },
25
+ { "current": "fix_applied", "new": "chronic", "context": { "recurrenceCount": 5 } },
26
+ { "current": "needs_human_verify", "new": "verified" },
27
+ { "current": "deferred", "new": "new" }
28
+ ],
29
+ "cycling": [
30
+ { "status": "fix_applied", "recurrenceCount": 2 },
31
+ { "status": "fix_applied", "recurrenceCount": 1 },
32
+ { "status": "new", "recurrenceCount": 3 },
33
+ { "status": "investigating", "recurrenceCount": 2 },
34
+ { "status": "investigating", "recurrenceCount": 0 },
35
+ { "status": "verified", "recurrenceCount": 5 },
36
+ { "status": "dispatched", "recurrenceCount": 9 },
37
+ { "status": "fix_applied" },
38
+ { "recurrenceCount": 4 }
39
+ ]
40
+ }
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * transitions-parity.mjs — LOCAL parity gate for the lifecycle state-machine port.
4
+ *
5
+ * Runs the REAL reference Python (`can_transition` + `detect_cycling` from
6
+ * the-portal/.claude/scripts/feedback-processor.py) and the TS port over the
7
+ * shared corpus and asserts BOTH the `allowed` decision AND the `reason` string
8
+ * match byte-for-byte (the reason interpolates Python's sorted-list repr, which
9
+ * the port reproduces). LOCAL evidence gate, not CI (CI lacks the reference).
10
+ *
11
+ * Exit 0 = parity; exit 1 = mismatch.
12
+ */
13
+
14
+ import { spawnSync } from 'node:child_process';
15
+ import fs from 'node:fs';
16
+ import path from 'node:path';
17
+ import { fileURLToPath } from 'node:url';
18
+
19
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
20
+ const ROOT = path.resolve(__dirname, '..', '..');
21
+
22
+ const PROCESSOR = process.env.PORTAL_PROCESSOR
23
+ || '/Users/justin/Documents/Projects/the-portal/.claude/scripts/feedback-processor.py';
24
+ const CORPUS = path.join(__dirname, 'transitions-corpus.json');
25
+ const PY_REF = path.join(__dirname, '_py_transitions_ref.py');
26
+
27
+ if (!fs.existsSync(PROCESSOR)) {
28
+ console.error(`[tx-parity] reference processor not found: ${PROCESSOR}`);
29
+ console.error('[tx-parity] set PORTAL_PROCESSOR to the reference feedback-processor.py');
30
+ process.exit(2);
31
+ }
32
+
33
+ const py = spawnSync('python3', [PY_REF, PROCESSOR, CORPUS], { encoding: 'utf8' });
34
+ if (py.status !== 0) {
35
+ console.error('[tx-parity] python reference failed:\n', py.stderr || py.stdout);
36
+ process.exit(2);
37
+ }
38
+ const reference = JSON.parse(py.stdout);
39
+
40
+ const distUrl = new URL('file://' + path.join(ROOT, 'dist', 'feedback-factory', 'processor', 'transitions.js'));
41
+ const { canTransition, detectCycling } = await import(distUrl.href);
42
+
43
+ let mismatches = 0;
44
+
45
+ for (const ref of reference.transitions) {
46
+ const c = ref.case;
47
+ const [allowed, reason] = canTransition(c.current, c.new, c.justification ?? null, c.context ?? null);
48
+ if (allowed !== ref.allowed || reason !== ref.reason) {
49
+ mismatches++;
50
+ console.error(`[MISMATCH tx] ${JSON.stringify(c)}`);
51
+ console.error(` python: allowed=${ref.allowed} reason=${JSON.stringify(ref.reason)}`);
52
+ console.error(` ts : allowed=${allowed} reason=${JSON.stringify(reason)}`);
53
+ }
54
+ }
55
+
56
+ for (const ref of reference.cycling) {
57
+ const got = detectCycling(ref.cluster);
58
+ if (got !== ref.cycling) {
59
+ mismatches++;
60
+ console.error(`[MISMATCH cycling] ${JSON.stringify(ref.cluster)} — python=${ref.cycling} ts=${got}`);
61
+ }
62
+ }
63
+
64
+ const total = reference.transitions.length + reference.cycling.length;
65
+ if (mismatches === 0) {
66
+ console.error(`[tx-parity] ✓ ${total}/${total} transition decisions + reasons + cycling results match the reference Python.`);
67
+ process.exit(0);
68
+ } else {
69
+ console.error(`[tx-parity] ✗ ${mismatches}/${total} mismatches — the TS port diverges from the reference.`);
70
+ process.exit(1);
71
+ }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-05-27T05:11:33.728Z",
5
- "instarVersion": "1.3.10",
4
+ "generatedAt": "2026-05-27T05:27:08.240Z",
5
+ "instarVersion": "1.3.12",
6
6
  "entryCount": 192,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -401,7 +401,7 @@
401
401
  "type": "route-group",
402
402
  "domain": "monitoring",
403
403
  "sourcePath": "src/server/routes.ts",
404
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
404
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
405
405
  "since": "2025-01-01"
406
406
  },
407
407
  "route-group:agents": {
@@ -409,7 +409,7 @@
409
409
  "type": "route-group",
410
410
  "domain": "sessions",
411
411
  "sourcePath": "src/server/routes.ts",
412
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
412
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
413
413
  "since": "2025-01-01"
414
414
  },
415
415
  "route-group:backups": {
@@ -417,7 +417,7 @@
417
417
  "type": "route-group",
418
418
  "domain": "operations",
419
419
  "sourcePath": "src/server/routes.ts",
420
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
420
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
421
421
  "since": "2025-01-01"
422
422
  },
423
423
  "route-group:git": {
@@ -425,7 +425,7 @@
425
425
  "type": "route-group",
426
426
  "domain": "coordination",
427
427
  "sourcePath": "src/server/routes.ts",
428
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
428
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
429
429
  "since": "2025-01-01"
430
430
  },
431
431
  "route-group:memory": {
@@ -433,7 +433,7 @@
433
433
  "type": "route-group",
434
434
  "domain": "memory",
435
435
  "sourcePath": "src/server/routes.ts",
436
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
436
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
437
437
  "since": "2025-01-01"
438
438
  },
439
439
  "route-group:semantic": {
@@ -441,7 +441,7 @@
441
441
  "type": "route-group",
442
442
  "domain": "memory",
443
443
  "sourcePath": "src/server/routes.ts",
444
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
444
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
445
445
  "since": "2025-01-01"
446
446
  },
447
447
  "route-group:status": {
@@ -449,7 +449,7 @@
449
449
  "type": "route-group",
450
450
  "domain": "monitoring",
451
451
  "sourcePath": "src/server/routes.ts",
452
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
452
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
453
453
  "since": "2025-01-01"
454
454
  },
455
455
  "route-group:capabilities": {
@@ -457,7 +457,7 @@
457
457
  "type": "route-group",
458
458
  "domain": "mapping",
459
459
  "sourcePath": "src/server/routes.ts",
460
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
460
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
461
461
  "since": "2025-01-01"
462
462
  },
463
463
  "route-group:project-map": {
@@ -465,7 +465,7 @@
465
465
  "type": "route-group",
466
466
  "domain": "mapping",
467
467
  "sourcePath": "src/server/routes.ts",
468
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
468
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
469
469
  "since": "2025-01-01"
470
470
  },
471
471
  "route-group:coherence": {
@@ -473,7 +473,7 @@
473
473
  "type": "route-group",
474
474
  "domain": "coherence",
475
475
  "sourcePath": "src/server/routes.ts",
476
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
476
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
477
477
  "since": "2025-01-01"
478
478
  },
479
479
  "route-group:topic-bindings": {
@@ -481,7 +481,7 @@
481
481
  "type": "route-group",
482
482
  "domain": "sessions",
483
483
  "sourcePath": "src/server/routes.ts",
484
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
484
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
485
485
  "since": "2025-01-01"
486
486
  },
487
487
  "route-group:context": {
@@ -489,7 +489,7 @@
489
489
  "type": "route-group",
490
490
  "domain": "context",
491
491
  "sourcePath": "src/server/routes.ts",
492
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
492
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
493
493
  "since": "2025-01-01"
494
494
  },
495
495
  "route-group:scope-coherence": {
@@ -497,7 +497,7 @@
497
497
  "type": "route-group",
498
498
  "domain": "coherence",
499
499
  "sourcePath": "src/server/routes.ts",
500
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
500
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
501
501
  "since": "2025-01-01"
502
502
  },
503
503
  "route-group:canonical-state": {
@@ -505,7 +505,7 @@
505
505
  "type": "route-group",
506
506
  "domain": "state",
507
507
  "sourcePath": "src/server/routes.ts",
508
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
508
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
509
509
  "since": "2025-01-01"
510
510
  },
511
511
  "route-group:ci": {
@@ -513,7 +513,7 @@
513
513
  "type": "route-group",
514
514
  "domain": "monitoring",
515
515
  "sourcePath": "src/server/routes.ts",
516
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
516
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
517
517
  "since": "2025-01-01"
518
518
  },
519
519
  "route-group:sessions": {
@@ -521,7 +521,7 @@
521
521
  "type": "route-group",
522
522
  "domain": "sessions",
523
523
  "sourcePath": "src/server/routes.ts",
524
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
524
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
525
525
  "since": "2025-01-01"
526
526
  },
527
527
  "route-group:jobs": {
@@ -529,7 +529,7 @@
529
529
  "type": "route-group",
530
530
  "domain": "scheduling",
531
531
  "sourcePath": "src/server/routes.ts",
532
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
532
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
533
533
  "since": "2025-01-01"
534
534
  },
535
535
  "route-group:skip-ledger": {
@@ -537,7 +537,7 @@
537
537
  "type": "route-group",
538
538
  "domain": "scheduling",
539
539
  "sourcePath": "src/server/routes.ts",
540
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
540
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
541
541
  "since": "2025-01-01"
542
542
  },
543
543
  "route-group:telegram": {
@@ -545,7 +545,7 @@
545
545
  "type": "route-group",
546
546
  "domain": "communication",
547
547
  "sourcePath": "src/server/routes.ts",
548
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
548
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
549
549
  "since": "2025-01-01"
550
550
  },
551
551
  "route-group:attention": {
@@ -553,7 +553,7 @@
553
553
  "type": "route-group",
554
554
  "domain": "communication",
555
555
  "sourcePath": "src/server/routes.ts",
556
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
556
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
557
557
  "since": "2025-01-01"
558
558
  },
559
559
  "route-group:relationships": {
@@ -561,7 +561,7 @@
561
561
  "type": "route-group",
562
562
  "domain": "relationships",
563
563
  "sourcePath": "src/server/routes.ts",
564
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
564
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
565
565
  "since": "2025-01-01"
566
566
  },
567
567
  "route-group:feedback": {
@@ -569,7 +569,7 @@
569
569
  "type": "route-group",
570
570
  "domain": "feedback",
571
571
  "sourcePath": "src/server/routes.ts",
572
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
572
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
573
573
  "since": "2025-01-01"
574
574
  },
575
575
  "route-group:updates": {
@@ -577,7 +577,7 @@
577
577
  "type": "route-group",
578
578
  "domain": "updates",
579
579
  "sourcePath": "src/server/routes.ts",
580
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
580
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
581
581
  "since": "2025-01-01"
582
582
  },
583
583
  "route-group:dispatches": {
@@ -585,7 +585,7 @@
585
585
  "type": "route-group",
586
586
  "domain": "dispatches",
587
587
  "sourcePath": "src/server/routes.ts",
588
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
588
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
589
589
  "since": "2025-01-01"
590
590
  },
591
591
  "route-group:quota": {
@@ -593,7 +593,7 @@
593
593
  "type": "route-group",
594
594
  "domain": "monitoring",
595
595
  "sourcePath": "src/server/routes.ts",
596
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
596
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
597
597
  "since": "2025-01-01"
598
598
  },
599
599
  "route-group:publishing": {
@@ -601,7 +601,7 @@
601
601
  "type": "route-group",
602
602
  "domain": "publishing",
603
603
  "sourcePath": "src/server/routes.ts",
604
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
604
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
605
605
  "since": "2025-01-01"
606
606
  },
607
607
  "route-group:private-views": {
@@ -609,7 +609,7 @@
609
609
  "type": "route-group",
610
610
  "domain": "publishing",
611
611
  "sourcePath": "src/server/routes.ts",
612
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
612
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
613
613
  "since": "2025-01-01"
614
614
  },
615
615
  "route-group:tunnel": {
@@ -617,7 +617,7 @@
617
617
  "type": "route-group",
618
618
  "domain": "networking",
619
619
  "sourcePath": "src/server/routes.ts",
620
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
620
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
621
621
  "since": "2025-01-01"
622
622
  },
623
623
  "route-group:events": {
@@ -625,7 +625,7 @@
625
625
  "type": "route-group",
626
626
  "domain": "networking",
627
627
  "sourcePath": "src/server/routes.ts",
628
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
628
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
629
629
  "since": "2025-01-01"
630
630
  },
631
631
  "route-group:evolution": {
@@ -633,7 +633,7 @@
633
633
  "type": "route-group",
634
634
  "domain": "evolution",
635
635
  "sourcePath": "src/server/routes.ts",
636
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
636
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
637
637
  "since": "2025-01-01"
638
638
  },
639
639
  "route-group:watchdog": {
@@ -641,7 +641,7 @@
641
641
  "type": "route-group",
642
642
  "domain": "monitoring",
643
643
  "sourcePath": "src/server/routes.ts",
644
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
644
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
645
645
  "since": "2025-01-01"
646
646
  },
647
647
  "route-group:topic-memory": {
@@ -649,7 +649,7 @@
649
649
  "type": "route-group",
650
650
  "domain": "memory",
651
651
  "sourcePath": "src/server/routes.ts",
652
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
652
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
653
653
  "since": "2025-01-01"
654
654
  },
655
655
  "route-group:state-sync": {
@@ -657,7 +657,7 @@
657
657
  "type": "route-group",
658
658
  "domain": "coordination",
659
659
  "sourcePath": "src/server/routes.ts",
660
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
660
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
661
661
  "since": "2025-01-01"
662
662
  },
663
663
  "route-group:intent": {
@@ -665,7 +665,7 @@
665
665
  "type": "route-group",
666
666
  "domain": "intent",
667
667
  "sourcePath": "src/server/routes.ts",
668
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
668
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
669
669
  "since": "2025-01-01"
670
670
  },
671
671
  "route-group:triage": {
@@ -673,7 +673,7 @@
673
673
  "type": "route-group",
674
674
  "domain": "safety",
675
675
  "sourcePath": "src/server/routes.ts",
676
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
676
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
677
677
  "since": "2025-01-01"
678
678
  },
679
679
  "route-group:operations": {
@@ -681,7 +681,7 @@
681
681
  "type": "route-group",
682
682
  "domain": "safety",
683
683
  "sourcePath": "src/server/routes.ts",
684
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
684
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
685
685
  "since": "2025-01-01"
686
686
  },
687
687
  "route-group:sentinel": {
@@ -689,7 +689,7 @@
689
689
  "type": "route-group",
690
690
  "domain": "safety",
691
691
  "sourcePath": "src/server/routes.ts",
692
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
692
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
693
693
  "since": "2025-01-01"
694
694
  },
695
695
  "route-group:trust": {
@@ -697,7 +697,7 @@
697
697
  "type": "route-group",
698
698
  "domain": "safety",
699
699
  "sourcePath": "src/server/routes.ts",
700
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
700
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
701
701
  "since": "2025-01-01"
702
702
  },
703
703
  "route-group:monitoring": {
@@ -705,7 +705,7 @@
705
705
  "type": "route-group",
706
706
  "domain": "monitoring",
707
707
  "sourcePath": "src/server/routes.ts",
708
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
708
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
709
709
  "since": "2025-01-01"
710
710
  },
711
711
  "route-group:commitments": {
@@ -713,7 +713,7 @@
713
713
  "type": "route-group",
714
714
  "domain": "commitments",
715
715
  "sourcePath": "src/server/routes.ts",
716
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
716
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
717
717
  "since": "2025-01-01"
718
718
  },
719
719
  "route-group:episodes": {
@@ -721,7 +721,7 @@
721
721
  "type": "route-group",
722
722
  "domain": "memory",
723
723
  "sourcePath": "src/server/routes.ts",
724
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
724
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
725
725
  "since": "2025-01-01"
726
726
  },
727
727
  "route-group:messages": {
@@ -729,7 +729,7 @@
729
729
  "type": "route-group",
730
730
  "domain": "coordination",
731
731
  "sourcePath": "src/server/routes.ts",
732
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
732
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
733
733
  "since": "2025-01-01"
734
734
  },
735
735
  "route-group:system-reviews": {
@@ -737,7 +737,7 @@
737
737
  "type": "route-group",
738
738
  "domain": "monitoring",
739
739
  "sourcePath": "src/server/routes.ts",
740
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
740
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
741
741
  "since": "2025-01-01"
742
742
  },
743
743
  "route-group:machine-mesh": {
@@ -753,7 +753,7 @@
753
753
  "type": "route-group",
754
754
  "domain": "security",
755
755
  "sourcePath": "src/server/routes.ts",
756
- "contentHash": "94f598954bbaa4a106d3b546e822387eea96f3ea04973f2d6a053685aa410724",
756
+ "contentHash": "768d0dfd6edc7bfa93f3a33e271607a5a4264183c43204900480b84cb9a4e294",
757
757
  "since": "2025-01-01"
758
758
  },
759
759
  "cli:init": {
@@ -0,0 +1,40 @@
1
+ # Instar Upgrade Guide — NEXT
2
+
3
+ <!-- bump: patch -->
4
+
5
+ ## What Changed
6
+
7
+ **Framework-Onboarding Mentor System — playbook promotion + observability (§19.5).** The final
8
+ buildable-while-dormant piece. Adds the playbook lifecycle (`none → candidate → extracted →
9
+ superseded`) with a **non-Echo attestation gate**: the mentor can flag a lesson as a candidate, but
10
+ it cannot promote its own lesson into the reusable onboarding checklist — `candidate → extracted`
11
+ requires a non-Echo party to attest, and who attested is recorded. This is the structural anti-gaming
12
+ guard that keeps the playbook from being end-to-end under the proposing agent's control. Also adds an
13
+ adversarial-telemetry read-out: bucket-distribution (a spike in "blame the mentee" is the tell),
14
+ leak-suspected count, probable-loop count, and how many lessons reached the playbook.
15
+
16
+ Two new read-only routes; the `promoted_by` column migrates forward on existing ledgers via an
17
+ idempotent `ALTER TABLE`. Still part of the dormant mentor system — nothing activates.
18
+
19
+ ## What to Tell Your User
20
+
21
+ - The mentor can now nominate a lesson for the reusable checklist, but it can't graduate its own
22
+ lessons — that needs a sign-off from someone other than the mentor, and the system records who.
23
+ - There's a one-glance read-out of the issue mix and the safety counters (leak hits, runaway-loop
24
+ flags), so drift is visible.
25
+
26
+ ## Summary of New Capabilities
27
+
28
+ | Capability | How to Use |
29
+ |-----------|-----------|
30
+ | Playbook promotion | `POST /framework-issues/:id/promote` `{status, promotedBy}` — `extracted` requires a non-Echo attester |
31
+ | Observability telemetry | `curl -H "Authorization: Bearer $AUTH" http://localhost:<port>/framework-issues/observability` — bucket distribution + leak/loop/extracted counts |
32
+
33
+ ## Evidence
34
+
35
+ Net-new feature, not a bug fix — no prior failure to reproduce. The non-Echo gate is proven on both
36
+ sides: a unit test asserts `candidate→extracted` is **refused when the attester is `echo` or empty**
37
+ (throws "non-Echo attestation required") and **allowed + records `promoted_by`** for a non-Echo actor;
38
+ an integration test confirms the same over HTTP (400 for Echo, 200 + `promotedBy` for a non-Echo
39
+ attester). Observability counts are asserted against a seeded ledger. 11 new tests; affected
40
+ push-config suite green vs canonical main; route docs-coverage 56% ≥ 55% floor.
@@ -0,0 +1,26 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- bump: patch -->
4
+
5
+ ## What Changed
6
+
7
+ Third increment of the **Feedback Factory Migration** (Dawn → Echo; spec `docs/specs/feedback-factory-migration.md`, approved). Ports the **lifecycle state machine** — `can_transition` + `detect_cycling` and their state/transition/gate constants — from the reference Python (`the-portal/.claude/scripts/feedback-processor.py`) to TypeScript at `src/feedback-factory/processor/transitions.ts`.
8
+
9
+ This is the heart of the evidence gate: the rules for how a bug cluster legally moves between lifecycle states (new → investigating → research_complete → fix_applied → dispatched → verified → closed, plus chronic/escalated/deferred/wontfix/duplicate), the requirement that any terminal transition (wontfix/closed/chronic_escalated) carry a ≥20-character justification, the atomic dispatch hard-gate, and the chronic circuit-breaker that blocks `chronic` once a bug has recurred 3+ times (forcing human escalation instead). Plus the cycling detector. Pure functions; **not wired into any route or job yet** — no behavioral change.
10
+
11
+ ## What to Tell Your User
12
+
13
+ - More of the feedback "brain" moved in-house — this is the part that enforces "you can't quietly mark a bug closed without writing down why," and the circuit-breaker that escalates a bug to a human once it keeps coming back.
14
+ - Same discipline: I proved my rewrite makes the exact same allow/deny decisions as Dawn's original — and even produces the exact same explanation text — across 33 cases.
15
+
16
+ ## Summary of New Capabilities
17
+
18
+ | Capability | How to Use |
19
+ |-----------|-----------|
20
+ | Lifecycle state machine (TS port) | Internal module `src/feedback-factory/processor/transitions.ts` — not yet wired |
21
+ | Transitions parity harness | `node scripts/feedback-factory/transitions-parity.mjs` (local; set `PORTAL_PROCESSOR`) |
22
+
23
+ ## Evidence
24
+
25
+ - **Parity vs the real reference Python:** ran `can_transition` + `detect_cycling` from the reference processor and the TS port over 33 cases (legal/illegal transitions, terminal states, the evidence gate on both sides of 20 chars, the dispatch hard-gate, the chronic circuit-breaker at recurrence 2 vs 3, cycling). Result: **33/33 match** — both the allow/deny decision AND the exact reason text (the reasons interpolate Python's sorted-list formatting, which the port reproduces byte-for-byte), plus all cycling results.
26
+ - **CI anchors:** unit tests assert the evidence gate, the circuit-breaker, terminal-state handling, and that every transition target is a known state — so a state-machine regression fails in CI even without the reference checkout.