@holmes-lab/holmes-kit 0.40.0 → 0.41.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +312 -0
  2. package/README.md +79 -5
  3. package/dist/.build-id +1 -1
  4. package/dist/holmes/cli/approve-context.js +4 -3
  5. package/dist/holmes/cli/approve.js +22 -12
  6. package/dist/holmes/cli/autonomy.d.ts +21 -0
  7. package/dist/holmes/cli/autonomy.js +35 -5
  8. package/dist/holmes/cli/doctor.js +58 -6
  9. package/dist/holmes/cli/index.js +394 -267
  10. package/dist/holmes/cli/init.js +17 -6
  11. package/dist/holmes/cli/interactive-prompt.d.ts +39 -2
  12. package/dist/holmes/cli/interactive-prompt.js +98 -16
  13. package/dist/holmes/cli/ledger-witness.d.ts +61 -0
  14. package/dist/holmes/cli/ledger-witness.js +212 -0
  15. package/dist/holmes/cli/playbook-skills.d.ts +3 -56
  16. package/dist/holmes/cli/playbook-skills.js +26 -349
  17. package/dist/holmes/config/config.d.ts +21 -0
  18. package/dist/holmes/config/config.js +22 -3
  19. package/dist/holmes/governance/approval-queue.d.ts +65 -1
  20. package/dist/holmes/governance/approval-queue.js +279 -9
  21. package/dist/holmes/governance/autonomous-shell.d.ts +13 -1
  22. package/dist/holmes/governance/autonomous-shell.js +157 -4
  23. package/dist/holmes/governance/autonomy.d.ts +216 -0
  24. package/dist/holmes/governance/autonomy.js +1162 -10
  25. package/dist/holmes/governance/install-manifest.d.ts +7 -4
  26. package/dist/holmes/governance/install-manifest.js +144 -14
  27. package/dist/holmes/governance/ledger-witness.d.ts +63 -0
  28. package/dist/holmes/governance/ledger-witness.js +296 -0
  29. package/dist/holmes/governance/provenance-chain.d.ts +8 -1
  30. package/dist/holmes/governance/provenance-chain.js +23 -4
  31. package/dist/holmes/governance/push-gate-runner.d.ts +2 -0
  32. package/dist/holmes/governance/push-gate-runner.js +40 -3
  33. package/dist/holmes/governance/push-gate.d.ts +13 -2
  34. package/dist/holmes/governance/push-gate.js +106 -14
  35. package/dist/holmes/governance/recorded-pairs.d.ts +4 -0
  36. package/dist/holmes/governance/recorded-pairs.js +25 -1
  37. package/dist/holmes/governance/session-context.d.ts +7 -0
  38. package/dist/holmes/governance/session-context.js +34 -6
  39. package/dist/holmes/guardrail/advisory-line.d.ts +102 -0
  40. package/dist/holmes/guardrail/advisory-line.js +718 -0
  41. package/dist/holmes/guardrail/anchor-scope-text.d.ts +9 -0
  42. package/dist/holmes/guardrail/anchor-scope-text.js +7 -0
  43. package/dist/holmes/guardrail/command-traits.d.ts +102 -0
  44. package/dist/holmes/guardrail/command-traits.js +379 -0
  45. package/dist/holmes/guardrail/fixtures/manager-builtins.json +23 -0
  46. package/dist/holmes/guardrail/fixtures/npm-commands.json +7 -0
  47. package/dist/holmes/guardrail/impact-gate.d.ts +6 -0
  48. package/dist/holmes/guardrail/impact-gate.js +32 -5
  49. package/dist/holmes/guardrail/outward-acts.d.ts +47 -0
  50. package/dist/holmes/guardrail/outward-acts.js +1102 -0
  51. package/dist/holmes/guardrail/refusal-codes.js +8 -1
  52. package/dist/holmes/guardrail/refusal-templates.d.ts +15 -0
  53. package/dist/holmes/guardrail/refusal-templates.js +71 -0
  54. package/dist/holmes/guardrail/risk-classifier.d.ts +22 -6
  55. package/dist/holmes/guardrail/risk-classifier.js +12 -118
  56. package/dist/holmes/guardrail/shell-lexer.d.ts +69 -0
  57. package/dist/holmes/guardrail/shell-lexer.js +567 -0
  58. package/dist/holmes/guardrail/write-target.js +7 -1
  59. package/dist/holmes/hooks/pre-tool-use.d.ts +71 -0
  60. package/dist/holmes/hooks/pre-tool-use.js +1466 -14
  61. package/dist/holmes/hooks/session-start.js +27 -1
  62. package/dist/holmes/hooks/stop.d.ts +7 -0
  63. package/dist/holmes/hooks/stop.js +39 -2
  64. package/dist/holmes/mcp/elicit-approval.d.ts +0 -21
  65. package/dist/holmes/mcp/elicit-approval.js +5 -2
  66. package/dist/holmes/mcp/handlers/approval-ask.js +3 -2
  67. package/dist/holmes/mcp/handlers/entity-integration.d.ts +1 -1
  68. package/dist/holmes/mcp/handlers/entity-integration.js +9 -6
  69. package/dist/holmes/mcp/handlers/entity-renumber.js +2 -1
  70. package/dist/holmes/mcp/handlers/entity-store.js +7 -2
  71. package/dist/holmes/mcp/handlers/maintenance-analysis.d.ts +13 -0
  72. package/dist/holmes/mcp/handlers/maintenance-analysis.js +59 -2
  73. package/dist/holmes/mcp/handlers/operator-inspection.d.ts +2 -0
  74. package/dist/holmes/mcp/handlers/operator-inspection.js +25 -4
  75. package/dist/holmes/mcp/handlers/spec-approval.d.ts +3 -1
  76. package/dist/holmes/mcp/handlers/spec-approval.js +28 -10
  77. package/dist/holmes/mcp/handlers/spec-lifecycle.js +10 -7
  78. package/dist/holmes/mcp/handlers/test-execution.d.ts +470 -3
  79. package/dist/holmes/mcp/handlers/test-execution.js +201 -21
  80. package/dist/holmes/mcp/handlers.d.ts +473 -8
  81. package/dist/holmes/mcp/handlers.js +6 -1
  82. package/dist/holmes/mcp/maintenance-analyze.d.ts +5 -0
  83. package/dist/holmes/mcp/maintenance-analyze.js +4 -2
  84. package/dist/holmes/mcp/maintenance-evidence.d.ts +9 -0
  85. package/dist/holmes/mcp/maintenance-evidence.js +4 -1
  86. package/dist/holmes/mcp/tool-schemas.js +16 -10
  87. package/dist/holmes/project/baseline.d.ts +15 -2
  88. package/dist/holmes/project/baseline.js +11 -6
  89. package/dist/holmes/project/bounded-io.d.ts +1 -0
  90. package/dist/holmes/project/bounded-io.js +4 -2
  91. package/dist/holmes/project/change-source.d.ts +4 -0
  92. package/dist/holmes/project/change-source.js +13 -5
  93. package/dist/holmes/project/playbook-reference.d.ts +50 -0
  94. package/dist/holmes/project/playbook-reference.js +259 -0
  95. package/dist/holmes/project/playbook-skill-states.d.ts +94 -0
  96. package/dist/holmes/project/playbook-skill-states.js +396 -0
  97. package/dist/holmes/project/root.d.ts +9 -1
  98. package/dist/holmes/project/root.js +26 -3
  99. package/dist/holmes/project/running-package.d.ts +15 -0
  100. package/dist/holmes/project/running-package.js +87 -0
  101. package/dist/holmes/review/evidence-mode.d.ts +21 -0
  102. package/dist/holmes/review/evidence-mode.js +33 -0
  103. package/dist/holmes/review/head-worktree.d.ts +55 -0
  104. package/dist/holmes/review/head-worktree.js +329 -0
  105. package/dist/holmes/review/mrp.js +13 -3
  106. package/dist/holmes/review/run-provenance.d.ts +45 -0
  107. package/dist/holmes/review/run-provenance.js +314 -0
  108. package/dist/holmes/review/test-evidence.d.ts +174 -0
  109. package/dist/holmes/review/test-evidence.js +330 -2
  110. package/dist/holmes/review/test-reports.d.ts +94 -0
  111. package/dist/holmes/review/test-reports.js +382 -0
  112. package/dist/holmes/review/test-runner.d.ts +178 -65
  113. package/dist/holmes/review/test-runner.js +551 -319
  114. package/dist/holmes/review/test-units.d.ts +159 -0
  115. package/dist/holmes/review/test-units.js +814 -0
  116. package/dist/holmes/spec/entity-integration-transaction.d.ts +19 -2
  117. package/dist/holmes/spec/entity-integration-transaction.js +68 -7
  118. package/package.json +5 -2
  119. package/playbooks/publish/PLAYBOOK.md +2 -1
@@ -802,7 +802,7 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
802
802
  };
803
803
  }[];
804
804
  graph: {
805
- status: "absent" | "current" | "empty" | "unreadable" | "stale" | "unverified";
805
+ status: "absent" | "current" | "unreadable" | "empty" | "stale" | "unverified";
806
806
  sourceCommit: string | null;
807
807
  graphAsOf: string | null;
808
808
  resolutionLimits: string[];
@@ -862,7 +862,7 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
862
862
  };
863
863
  }[];
864
864
  graph: {
865
- status: "absent" | "current" | "empty" | "unreadable" | "stale" | "unverified";
865
+ status: "absent" | "current" | "unreadable" | "empty" | "stale" | "unverified";
866
866
  sourceCommit: string | null;
867
867
  graphAsOf: string | null;
868
868
  resolutionLimits: string[];
@@ -944,7 +944,7 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
944
944
  };
945
945
  }[];
946
946
  graph: {
947
- status: "absent" | "current" | "empty" | "unreadable" | "stale" | "unverified";
947
+ status: "absent" | "current" | "unreadable" | "empty" | "stale" | "unverified";
948
948
  sourceCommit: string | null;
949
949
  graphAsOf: string | null;
950
950
  resolutionLimits: string[];
@@ -1010,7 +1010,7 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
1010
1010
  };
1011
1011
  }[];
1012
1012
  graph: {
1013
- status: "absent" | "current" | "empty" | "unreadable" | "stale" | "unverified";
1013
+ status: "absent" | "current" | "unreadable" | "empty" | "stale" | "unverified";
1014
1014
  sourceCommit: string | null;
1015
1015
  graphAsOf: string | null;
1016
1016
  resolutionLimits: string[];
@@ -1362,7 +1362,7 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
1362
1362
  advisoryIds?: Partial<Record<string, string>> | undefined;
1363
1363
  killsAdvisory?: import("../review/kills-check").KillsAdvisory | undefined;
1364
1364
  fttFulfilment?: import("../rtm/ftt-fulfilment").FttFulfilment | undefined;
1365
- impactAdvisoryUnavailable?: "empty" | "unreadable" | undefined;
1365
+ impactAdvisoryUnavailable?: "unreadable" | "empty" | undefined;
1366
1366
  impactGraph?: {
1367
1367
  status: "current" | "stale" | "unverified";
1368
1368
  sourceCommit: string | null;
@@ -1572,11 +1572,14 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
1572
1572
  }>;
1573
1573
  test_run: (a: {
1574
1574
  root: string;
1575
- base?: string;
1576
- head?: string;
1575
+ base?: string | null;
1576
+ head?: string | null;
1577
1577
  since?: string;
1578
1578
  mark?: string;
1579
1579
  mutate?: string;
1580
+ workers?: number;
1581
+ timeoutMinutes?: number | null;
1582
+ full?: boolean;
1580
1583
  }) => Promise<{
1581
1584
  mutate: {
1582
1585
  tspec: string;
@@ -1598,7 +1601,313 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
1598
1601
  reason: string;
1599
1602
  }[];
1600
1603
  };
1604
+ workers: null;
1605
+ workersIgnored: "mutate" | undefined;
1606
+ timeoutMinutes: number;
1607
+ } | {
1608
+ worktreeLeft?: string | undefined;
1609
+ anchorDiagnostics?: {
1610
+ hint: string;
1611
+ file: string;
1612
+ line: number;
1613
+ separator: string;
1614
+ dropped: string[];
1615
+ }[] | undefined;
1616
+ calibrationClosed?: string[] | undefined;
1617
+ nextCall?: string | undefined;
1618
+ notFullBecause?: string | undefined;
1619
+ excludeDirsIgnored?: {
1620
+ entry: string;
1621
+ reason: string;
1622
+ }[] | undefined;
1623
+ recordFailed?: string[] | undefined;
1624
+ ranIn: "head-worktree";
1625
+ worktree: {
1626
+ createMs: number;
1627
+ prepareMs: number;
1628
+ runMs: number;
1629
+ };
1630
+ notBuilt?: string[] | undefined;
1631
+ notDetected?: import("../review/test-evidence").NotDetected[] | undefined;
1632
+ untestedCode?: {
1633
+ root: string;
1634
+ sample: string[];
1635
+ missingBuildFile?: string;
1636
+ }[] | undefined;
1637
+ notExecuted?: string[] | undefined;
1638
+ notTests?: string[] | undefined;
1639
+ implementationCount?: number | undefined;
1640
+ environment?: {
1641
+ ecosystem: string;
1642
+ dir: string;
1643
+ reason: string;
1644
+ }[] | undefined;
1645
+ units?: import("../review/test-runner").UnitResult[] | undefined;
1646
+ notRun?: import("../review/test-evidence").NotRun[] | undefined;
1647
+ detected?: string[] | undefined;
1648
+ testsRun: number;
1649
+ testsRunBy: Record<string, number>;
1650
+ scopedEvidenceRecorded?: true | undefined;
1651
+ baselineSkipped?: "not a full run" | undefined;
1652
+ baselineRecorded?: string | undefined;
1653
+ scopeFallback?: "full" | undefined;
1654
+ timeoutMinutes: number;
1655
+ unresolvedFiles: string[];
1656
+ changeSource: ChangeSourceInfo;
1657
+ workersIgnoredBy: string[];
1658
+ workersIgnored: "nothing ran" | "no jest group";
1659
+ tier: import("../rtm/test-scope").RegressionTier;
1660
+ mode: "full" | "scoped" | "noop";
1661
+ passed: boolean;
1662
+ skipped: boolean;
1663
+ ranFiles: string[];
1664
+ ranWith: string[];
1665
+ executedByAspec: Record<string, number>;
1666
+ tail: string;
1667
+ workers: number | null;
1668
+ mutate?: undefined;
1669
+ } | {
1670
+ worktreeLeft?: string | undefined;
1671
+ anchorDiagnostics?: {
1672
+ hint: string;
1673
+ file: string;
1674
+ line: number;
1675
+ separator: string;
1676
+ dropped: string[];
1677
+ }[] | undefined;
1678
+ calibrationClosed?: string[] | undefined;
1679
+ nextCall?: string | undefined;
1680
+ notFullBecause?: string | undefined;
1681
+ excludeDirsIgnored?: {
1682
+ entry: string;
1683
+ reason: string;
1684
+ }[] | undefined;
1685
+ recordFailed?: string[] | undefined;
1686
+ ranIn?: undefined;
1687
+ worktree?: undefined;
1688
+ notBuilt?: string[] | undefined;
1689
+ notDetected?: import("../review/test-evidence").NotDetected[] | undefined;
1690
+ untestedCode?: {
1691
+ root: string;
1692
+ sample: string[];
1693
+ missingBuildFile?: string;
1694
+ }[] | undefined;
1695
+ notExecuted?: string[] | undefined;
1696
+ notTests?: string[] | undefined;
1697
+ implementationCount?: number | undefined;
1698
+ environment?: {
1699
+ ecosystem: string;
1700
+ dir: string;
1701
+ reason: string;
1702
+ }[] | undefined;
1703
+ units?: import("../review/test-runner").UnitResult[] | undefined;
1704
+ notRun?: import("../review/test-evidence").NotRun[] | undefined;
1705
+ detected?: string[] | undefined;
1706
+ testsRun: number;
1707
+ testsRunBy: Record<string, number>;
1708
+ scopedEvidenceRecorded?: true | undefined;
1709
+ baselineSkipped?: "not a full run" | undefined;
1710
+ baselineRecorded?: string | undefined;
1711
+ scopeFallback?: "full" | undefined;
1712
+ timeoutMinutes: number;
1713
+ unresolvedFiles: string[];
1714
+ changeSource: ChangeSourceInfo;
1715
+ workersIgnoredBy: string[];
1716
+ workersIgnored: "nothing ran" | "no jest group";
1717
+ tier: import("../rtm/test-scope").RegressionTier;
1718
+ mode: "full" | "scoped" | "noop";
1719
+ passed: boolean;
1720
+ skipped: boolean;
1721
+ ranFiles: string[];
1722
+ ranWith: string[];
1723
+ executedByAspec: Record<string, number>;
1724
+ tail: string;
1725
+ workers: number | null;
1726
+ mutate?: undefined;
1727
+ } | {
1728
+ worktreeLeft?: string | undefined;
1729
+ anchorDiagnostics?: {
1730
+ hint: string;
1731
+ file: string;
1732
+ line: number;
1733
+ separator: string;
1734
+ dropped: string[];
1735
+ }[] | undefined;
1736
+ calibrationClosed?: string[] | undefined;
1737
+ nextCall?: string | undefined;
1738
+ notFullBecause?: string | undefined;
1739
+ excludeDirsIgnored?: {
1740
+ entry: string;
1741
+ reason: string;
1742
+ }[] | undefined;
1743
+ recordFailed?: string[] | undefined;
1744
+ ranIn: "head-worktree";
1745
+ worktree: {
1746
+ createMs: number;
1747
+ prepareMs: number;
1748
+ runMs: number;
1749
+ };
1750
+ notBuilt?: string[] | undefined;
1751
+ notDetected?: import("../review/test-evidence").NotDetected[] | undefined;
1752
+ untestedCode?: {
1753
+ root: string;
1754
+ sample: string[];
1755
+ missingBuildFile?: string;
1756
+ }[] | undefined;
1757
+ notExecuted?: string[] | undefined;
1758
+ notTests?: string[] | undefined;
1759
+ implementationCount?: number | undefined;
1760
+ environment?: {
1761
+ ecosystem: string;
1762
+ dir: string;
1763
+ reason: string;
1764
+ }[] | undefined;
1765
+ units?: import("../review/test-runner").UnitResult[] | undefined;
1766
+ notRun?: import("../review/test-evidence").NotRun[] | undefined;
1767
+ detected?: string[] | undefined;
1768
+ testsRun: number;
1769
+ testsRunBy: Record<string, number>;
1770
+ scopedEvidenceRecorded?: true | undefined;
1771
+ baselineSkipped?: "not a full run" | undefined;
1772
+ baselineRecorded?: string | undefined;
1773
+ scopeFallback?: "full" | undefined;
1774
+ timeoutMinutes: number;
1775
+ unresolvedFiles: string[];
1776
+ changeSource: ChangeSourceInfo;
1777
+ workersIgnoredBy?: undefined;
1778
+ workersIgnored: "nothing ran" | "no jest group";
1779
+ tier: import("../rtm/test-scope").RegressionTier;
1780
+ mode: "full" | "scoped" | "noop";
1781
+ passed: boolean;
1782
+ skipped: boolean;
1783
+ ranFiles: string[];
1784
+ ranWith: string[];
1785
+ executedByAspec: Record<string, number>;
1786
+ tail: string;
1787
+ workers: number | null;
1788
+ mutate?: undefined;
1789
+ } | {
1790
+ worktreeLeft?: string | undefined;
1791
+ anchorDiagnostics?: {
1792
+ hint: string;
1793
+ file: string;
1794
+ line: number;
1795
+ separator: string;
1796
+ dropped: string[];
1797
+ }[] | undefined;
1798
+ calibrationClosed?: string[] | undefined;
1799
+ nextCall?: string | undefined;
1800
+ notFullBecause?: string | undefined;
1801
+ excludeDirsIgnored?: {
1802
+ entry: string;
1803
+ reason: string;
1804
+ }[] | undefined;
1805
+ recordFailed?: string[] | undefined;
1806
+ ranIn?: undefined;
1807
+ worktree?: undefined;
1808
+ notBuilt?: string[] | undefined;
1809
+ notDetected?: import("../review/test-evidence").NotDetected[] | undefined;
1810
+ untestedCode?: {
1811
+ root: string;
1812
+ sample: string[];
1813
+ missingBuildFile?: string;
1814
+ }[] | undefined;
1815
+ notExecuted?: string[] | undefined;
1816
+ notTests?: string[] | undefined;
1817
+ implementationCount?: number | undefined;
1818
+ environment?: {
1819
+ ecosystem: string;
1820
+ dir: string;
1821
+ reason: string;
1822
+ }[] | undefined;
1823
+ units?: import("../review/test-runner").UnitResult[] | undefined;
1824
+ notRun?: import("../review/test-evidence").NotRun[] | undefined;
1825
+ detected?: string[] | undefined;
1826
+ testsRun: number;
1827
+ testsRunBy: Record<string, number>;
1828
+ scopedEvidenceRecorded?: true | undefined;
1829
+ baselineSkipped?: "not a full run" | undefined;
1830
+ baselineRecorded?: string | undefined;
1831
+ scopeFallback?: "full" | undefined;
1832
+ timeoutMinutes: number;
1833
+ unresolvedFiles: string[];
1834
+ changeSource: ChangeSourceInfo;
1835
+ workersIgnoredBy?: undefined;
1836
+ workersIgnored: "nothing ran" | "no jest group";
1837
+ tier: import("../rtm/test-scope").RegressionTier;
1838
+ mode: "full" | "scoped" | "noop";
1839
+ passed: boolean;
1840
+ skipped: boolean;
1841
+ ranFiles: string[];
1842
+ ranWith: string[];
1843
+ executedByAspec: Record<string, number>;
1844
+ tail: string;
1845
+ workers: number | null;
1846
+ mutate?: undefined;
1847
+ } | {
1848
+ worktreeLeft?: string | undefined;
1849
+ anchorDiagnostics?: {
1850
+ hint: string;
1851
+ file: string;
1852
+ line: number;
1853
+ separator: string;
1854
+ dropped: string[];
1855
+ }[] | undefined;
1856
+ calibrationClosed?: string[] | undefined;
1857
+ nextCall?: string | undefined;
1858
+ notFullBecause?: string | undefined;
1859
+ excludeDirsIgnored?: {
1860
+ entry: string;
1861
+ reason: string;
1862
+ }[] | undefined;
1863
+ recordFailed?: string[] | undefined;
1864
+ ranIn: "head-worktree";
1865
+ worktree: {
1866
+ createMs: number;
1867
+ prepareMs: number;
1868
+ runMs: number;
1869
+ };
1870
+ notBuilt?: string[] | undefined;
1871
+ notDetected?: import("../review/test-evidence").NotDetected[] | undefined;
1872
+ untestedCode?: {
1873
+ root: string;
1874
+ sample: string[];
1875
+ missingBuildFile?: string;
1876
+ }[] | undefined;
1877
+ notExecuted?: string[] | undefined;
1878
+ notTests?: string[] | undefined;
1879
+ implementationCount?: number | undefined;
1880
+ environment?: {
1881
+ ecosystem: string;
1882
+ dir: string;
1883
+ reason: string;
1884
+ }[] | undefined;
1885
+ units?: import("../review/test-runner").UnitResult[] | undefined;
1886
+ notRun?: import("../review/test-evidence").NotRun[] | undefined;
1887
+ detected?: string[] | undefined;
1888
+ testsRun: number;
1889
+ testsRunBy: Record<string, number>;
1890
+ scopedEvidenceRecorded?: true | undefined;
1891
+ baselineSkipped?: "not a full run" | undefined;
1892
+ baselineRecorded?: string | undefined;
1893
+ scopeFallback?: "full" | undefined;
1894
+ timeoutMinutes: number;
1895
+ unresolvedFiles: string[];
1896
+ changeSource: ChangeSourceInfo;
1897
+ workersIgnoredBy: string[];
1898
+ workersIgnored?: undefined;
1899
+ tier: import("../rtm/test-scope").RegressionTier;
1900
+ mode: "full" | "scoped" | "noop";
1901
+ passed: boolean;
1902
+ skipped: boolean;
1903
+ ranFiles: string[];
1904
+ ranWith: string[];
1905
+ executedByAspec: Record<string, number>;
1906
+ tail: string;
1907
+ workers: number | null;
1908
+ mutate?: undefined;
1601
1909
  } | {
1910
+ worktreeLeft?: string | undefined;
1602
1911
  anchorDiagnostics?: {
1603
1912
  hint: string;
1604
1913
  file: string;
@@ -1607,17 +1916,173 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
1607
1916
  dropped: string[];
1608
1917
  }[] | undefined;
1609
1918
  calibrationClosed?: string[] | undefined;
1919
+ nextCall?: string | undefined;
1920
+ notFullBecause?: string | undefined;
1921
+ excludeDirsIgnored?: {
1922
+ entry: string;
1923
+ reason: string;
1924
+ }[] | undefined;
1925
+ recordFailed?: string[] | undefined;
1926
+ ranIn?: undefined;
1927
+ worktree?: undefined;
1928
+ notBuilt?: string[] | undefined;
1929
+ notDetected?: import("../review/test-evidence").NotDetected[] | undefined;
1930
+ untestedCode?: {
1931
+ root: string;
1932
+ sample: string[];
1933
+ missingBuildFile?: string;
1934
+ }[] | undefined;
1935
+ notExecuted?: string[] | undefined;
1936
+ notTests?: string[] | undefined;
1937
+ implementationCount?: number | undefined;
1938
+ environment?: {
1939
+ ecosystem: string;
1940
+ dir: string;
1941
+ reason: string;
1942
+ }[] | undefined;
1943
+ units?: import("../review/test-runner").UnitResult[] | undefined;
1944
+ notRun?: import("../review/test-evidence").NotRun[] | undefined;
1945
+ detected?: string[] | undefined;
1946
+ testsRun: number;
1947
+ testsRunBy: Record<string, number>;
1948
+ scopedEvidenceRecorded?: true | undefined;
1949
+ baselineSkipped?: "not a full run" | undefined;
1610
1950
  baselineRecorded?: string | undefined;
1611
1951
  scopeFallback?: "full" | undefined;
1952
+ timeoutMinutes: number;
1953
+ unresolvedFiles: string[];
1954
+ changeSource: ChangeSourceInfo;
1955
+ workersIgnoredBy: string[];
1956
+ workersIgnored?: undefined;
1612
1957
  tier: import("../rtm/test-scope").RegressionTier;
1613
- mode: "full" | "noop" | "scoped";
1958
+ mode: "full" | "scoped" | "noop";
1614
1959
  passed: boolean;
1615
1960
  skipped: boolean;
1616
1961
  ranFiles: string[];
1962
+ ranWith: string[];
1617
1963
  executedByAspec: Record<string, number>;
1618
1964
  tail: string;
1965
+ workers: number | null;
1966
+ mutate?: undefined;
1967
+ } | {
1968
+ worktreeLeft?: string | undefined;
1969
+ anchorDiagnostics?: {
1970
+ hint: string;
1971
+ file: string;
1972
+ line: number;
1973
+ separator: string;
1974
+ dropped: string[];
1975
+ }[] | undefined;
1976
+ calibrationClosed?: string[] | undefined;
1977
+ nextCall?: string | undefined;
1978
+ notFullBecause?: string | undefined;
1979
+ excludeDirsIgnored?: {
1980
+ entry: string;
1981
+ reason: string;
1982
+ }[] | undefined;
1983
+ recordFailed?: string[] | undefined;
1984
+ ranIn: "head-worktree";
1985
+ worktree: {
1986
+ createMs: number;
1987
+ prepareMs: number;
1988
+ runMs: number;
1989
+ };
1990
+ notBuilt?: string[] | undefined;
1991
+ notDetected?: import("../review/test-evidence").NotDetected[] | undefined;
1992
+ untestedCode?: {
1993
+ root: string;
1994
+ sample: string[];
1995
+ missingBuildFile?: string;
1996
+ }[] | undefined;
1997
+ notExecuted?: string[] | undefined;
1998
+ notTests?: string[] | undefined;
1999
+ implementationCount?: number | undefined;
2000
+ environment?: {
2001
+ ecosystem: string;
2002
+ dir: string;
2003
+ reason: string;
2004
+ }[] | undefined;
2005
+ units?: import("../review/test-runner").UnitResult[] | undefined;
2006
+ notRun?: import("../review/test-evidence").NotRun[] | undefined;
2007
+ detected?: string[] | undefined;
2008
+ testsRun: number;
2009
+ testsRunBy: Record<string, number>;
2010
+ scopedEvidenceRecorded?: true | undefined;
2011
+ baselineSkipped?: "not a full run" | undefined;
2012
+ baselineRecorded?: string | undefined;
2013
+ scopeFallback?: "full" | undefined;
2014
+ timeoutMinutes: number;
2015
+ unresolvedFiles: string[];
2016
+ changeSource: ChangeSourceInfo;
2017
+ workersIgnoredBy?: undefined;
2018
+ workersIgnored?: undefined;
2019
+ tier: import("../rtm/test-scope").RegressionTier;
2020
+ mode: "full" | "scoped" | "noop";
2021
+ passed: boolean;
2022
+ skipped: boolean;
2023
+ ranFiles: string[];
2024
+ ranWith: string[];
2025
+ executedByAspec: Record<string, number>;
2026
+ tail: string;
2027
+ workers: number | null;
2028
+ mutate?: undefined;
2029
+ } | {
2030
+ worktreeLeft?: string | undefined;
2031
+ anchorDiagnostics?: {
2032
+ hint: string;
2033
+ file: string;
2034
+ line: number;
2035
+ separator: string;
2036
+ dropped: string[];
2037
+ }[] | undefined;
2038
+ calibrationClosed?: string[] | undefined;
2039
+ nextCall?: string | undefined;
2040
+ notFullBecause?: string | undefined;
2041
+ excludeDirsIgnored?: {
2042
+ entry: string;
2043
+ reason: string;
2044
+ }[] | undefined;
2045
+ recordFailed?: string[] | undefined;
2046
+ ranIn?: undefined;
2047
+ worktree?: undefined;
2048
+ notBuilt?: string[] | undefined;
2049
+ notDetected?: import("../review/test-evidence").NotDetected[] | undefined;
2050
+ untestedCode?: {
2051
+ root: string;
2052
+ sample: string[];
2053
+ missingBuildFile?: string;
2054
+ }[] | undefined;
2055
+ notExecuted?: string[] | undefined;
2056
+ notTests?: string[] | undefined;
2057
+ implementationCount?: number | undefined;
2058
+ environment?: {
2059
+ ecosystem: string;
2060
+ dir: string;
2061
+ reason: string;
2062
+ }[] | undefined;
2063
+ units?: import("../review/test-runner").UnitResult[] | undefined;
2064
+ notRun?: import("../review/test-evidence").NotRun[] | undefined;
2065
+ detected?: string[] | undefined;
2066
+ testsRun: number;
2067
+ testsRunBy: Record<string, number>;
2068
+ scopedEvidenceRecorded?: true | undefined;
2069
+ baselineSkipped?: "not a full run" | undefined;
2070
+ baselineRecorded?: string | undefined;
2071
+ scopeFallback?: "full" | undefined;
2072
+ timeoutMinutes: number;
1619
2073
  unresolvedFiles: string[];
1620
2074
  changeSource: ChangeSourceInfo;
2075
+ workersIgnoredBy?: undefined;
2076
+ workersIgnored?: undefined;
2077
+ tier: import("../rtm/test-scope").RegressionTier;
2078
+ mode: "full" | "scoped" | "noop";
2079
+ passed: boolean;
2080
+ skipped: boolean;
2081
+ ranFiles: string[];
2082
+ ranWith: string[];
2083
+ executedByAspec: Record<string, number>;
2084
+ tail: string;
2085
+ workers: number | null;
1621
2086
  mutate?: undefined;
1622
2087
  }>;
1623
2088
  issue_localize: (a: {
@@ -39,7 +39,7 @@ exports.isHandlerRefusal = isHandlerRefusal;
39
39
  exports.unreadableAmong = unreadableAmong;
40
40
  exports.makeHandlers = makeHandlers;
41
41
  exports.collectDecisions = collectDecisions;
42
- // @implements A-SPEC-251.4, A-SPEC-774.25, A-SPEC-770.12,A-SPEC-718.1, A-SPEC-718.2, A-SPEC-723, A-SPEC-723.1, A-SPEC-545.6, A-SPEC-720, A-SPEC-718, A-SPEC-703, A-SPEC-629, A-SPEC-628, A-SPEC-599, A-SPEC-603, A-SPEC-604, A-SPEC-605, A-SPEC-606, A-SPEC-607, A-SPEC-608, A-SPEC-609, A-SPEC-610, A-SPEC-611, A-SPEC-612, A-SPEC-613, A-SPEC-614, A-SPEC-615, A-SPEC-616, A-SPEC-617, A-SPEC-618, A-SPEC-621, A-SPEC-622, A-SPEC-624, A-SPEC-625, A-SPEC-627, A-SPEC-713, A-SPEC-732, A-SPEC-754, A-SPEC-792.4
42
+ // @implements A-SPEC-794.85, A-SPEC-128.2, A-SPEC-128.5, A-SPEC-251.4,A-SPEC-466.2,A-SPEC-774.25, A-SPEC-770.12,A-SPEC-718.1, A-SPEC-718.2, A-SPEC-723, A-SPEC-723.1, A-SPEC-545.6, A-SPEC-720, A-SPEC-718, A-SPEC-703, A-SPEC-629, A-SPEC-628, A-SPEC-599, A-SPEC-603, A-SPEC-604, A-SPEC-605, A-SPEC-606, A-SPEC-607, A-SPEC-608, A-SPEC-609, A-SPEC-610, A-SPEC-611, A-SPEC-612, A-SPEC-613, A-SPEC-614, A-SPEC-615, A-SPEC-616, A-SPEC-617, A-SPEC-618, A-SPEC-621, A-SPEC-622, A-SPEC-624, A-SPEC-625, A-SPEC-627, A-SPEC-713, A-SPEC-732, A-SPEC-754, A-SPEC-792.4
43
43
  const operator_recovery_1 = require("./operator-recovery");
44
44
  // @implements A-SPEC-643
45
45
  // @implements A-SPEC-642
@@ -175,6 +175,7 @@ function isHandlerRefusal(e) {
175
175
  // @implements A-SPEC-128
176
176
  const root_1 = require("../project/root");
177
177
  const change_source_1 = require("../project/change-source");
178
+ const evidence_mode_1 = require("../review/evidence-mode");
178
179
  const ignore_1 = require("../project/ignore");
179
180
  const human_channel_1 = require("../governance/human-channel");
180
181
  // @implements A-SPEC-126
@@ -483,6 +484,8 @@ function makeChangeSource(root, a) {
483
484
  return new change_source_1.SnapshotChangeSource(root, a.since ?? DEFAULT_BASELINE, {
484
485
  isIgnored: (p) => ignore.isIgnored(p),
485
486
  verify: path.join(root, '.ax', 'ledger', 'provenance.jsonl'),
487
+ // @implements A-SPEC-128.2 — narrow only against a tree a full run verified (A-SPEC-128.5: the shared token)
488
+ requireMode: evidence_mode_1.FULL_MODE,
486
489
  });
487
490
  }
488
491
  // ContentSource factory shared by context_bundle and review_prepare: specMap
@@ -822,6 +825,7 @@ function makeRawHandlers(store, opts) {
822
825
  // @implements A-SPEC-616, A-SPEC-100.2, A-SPEC-102.1, A-SPEC-121.2, A-SPEC-121.3, A-SPEC-128, A-SPEC-130, A-SPEC-189, A-SPEC-233, A-SPEC-419, A-SPEC-433, A-SPEC-534.5, A-SPEC-534.8, A-SPEC-578.4, A-SPEC-614
823
826
  const testExecution = (0, test_execution_1.createTestExecutionHandlers)({
824
827
  defaultBaseline: DEFAULT_BASELINE,
828
+ refusal: reason => new HandlerRefusal(reason), // @implements A-SPEC-466.2
825
829
  deriveChangedContext: (root, args, tool) => deriveChangedContext(store, root, args, tool),
826
830
  });
827
831
  const reviewQueries = (0, review_queries_1.createReviewQueryHandlers)({
@@ -981,6 +985,7 @@ function makeRawHandlers(store, opts) {
981
985
  });
982
986
  // @implements A-SPEC-622, A-SPEC-100.2, A-SPEC-128, A-SPEC-132, A-SPEC-133, A-SPEC-151, A-SPEC-188, A-SPEC-189, A-SPEC-244, A-SPEC-245
983
987
  const specApproval = (0, spec_approval_1.createSpecApprovalHandlers)({
988
+ serverInstance: () => opts?.serverInstance?.(), // @implements A-SPEC-794.85 — the seal's session, injected
984
989
  store, resolver, projectRootOf, cachedScan, tryElicit, elicitApproval, autonomousApproval,
985
990
  approvalAdapter,
986
991
  approvalHarness: attestedHarness, // @implements A-SPEC-792.24 — the recorded harness is the attested one
@@ -185,6 +185,11 @@ export interface MaintenanceAnalysisInput {
185
185
  * assessed rather than as empty.
186
186
  */
187
187
  changedFiles?: readonly string[];
188
+ /**
189
+ * @implements A-SPEC-293.1 — the working tree's own diff, read for the architecture axis only when `changedFiles` is
190
+ * absent. It never seeds, ranks or predicts: those read `changedFiles` alone, so the prediction is the same either way.
191
+ */
192
+ architectureBasis?: readonly string[];
188
193
  basis: {
189
194
  head: string;
190
195
  loadedBuild: string;
@@ -973,8 +973,10 @@ function analyzeMaintenance(input) {
973
973
  // them a maintenance analysis could hand back a NARROWER tier than the runner would compute for
974
974
  // the identical impact set, which is the one direction this codebase treats as unacceptable.
975
975
  const obligationGaps = (0, scope_1.obligationGapsFor)(specs, specIds);
976
- const architectureAssessed = input.changedFiles !== undefined;
977
- const architectureTouched = architectureAssessed ? (0, test_scope_1.architectureGoverningFiles)([...input.changedFiles]) : [];
976
+ // @implements A-SPEC-293.1 — the caller's list first; the working tree's own diff when there is none
977
+ const architectureFiles = input.changedFiles ?? input.architectureBasis;
978
+ const architectureAssessed = architectureFiles !== undefined;
979
+ const architectureTouched = architectureAssessed ? (0, test_scope_1.architectureGoverningFiles)([...architectureFiles]) : [];
978
980
  const testScope = (0, test_scope_1.computeTestScope)(specIds, input.testAnchors, specs, testCoverageGaps, undefined, { unresolvedFiles: unresolvedCoverage, architectureTouched, obligationGaps });
979
981
  const candidateFiles = new Set(candidates.map((candidate) => candidate.file));
980
982
  const history = input.history
@@ -75,6 +75,11 @@ export interface EvidenceArtifact {
75
75
  */
76
76
  securityAssessed: boolean;
77
77
  compatibilityAssessed: boolean;
78
+ /**
79
+ * @implements A-SPEC-333.9 — the governing documents the architecture basis held. The gate keeps the axis open for
80
+ * an edit of a governing document a diff-built basis did not hold. Optional: older artifacts read as before.
81
+ */
82
+ architectureTouched?: string[];
78
83
  };
79
84
  outcome?: EvidenceOutcome;
80
85
  /**
@@ -84,11 +89,15 @@ export interface EvidenceArtifact {
84
89
  */
85
90
  request?: string;
86
91
  changedFiles?: string[];
92
+ /** @implements A-SPEC-293.1 — where the architecture axis's changed files came from; never itself a list the gate reads. */
93
+ changedFilesSource?: ChangedFilesSource;
87
94
  }
95
+ export type ChangedFilesSource = 'caller' | 'git-diff-default' | 'none';
88
96
  /** What the caller supplied to the analysis, recorded beside the prediction (A-SPEC-278.3). */
89
97
  export interface AnalysisIntake {
90
98
  request?: string;
91
99
  changedFiles?: string[];
100
+ changedFilesSource?: ChangedFilesSource;
92
101
  }
93
102
  /**
94
103
  * A digest reaches the filesystem as a filename, and it arrives from an MCP caller. Refuse anything
@@ -43,7 +43,7 @@ exports.openArtifacts = openArtifacts;
43
43
  exports.closeOpenArtifacts = closeOpenArtifacts;
44
44
  exports.scopeCauses = scopeCauses;
45
45
  exports.computeCalibration = computeCalibration;
46
- // @implements A-SPEC-744, A-SPEC-740, A-SPEC-724.1, A-SPEC-271, A-SPEC-278.3
46
+ // @implements A-SPEC-744, A-SPEC-740, A-SPEC-724.1, A-SPEC-271, A-SPEC-278.3, A-SPEC-293.1, A-SPEC-333.9
47
47
  // @implements A-SPEC-268
48
48
  const fs = __importStar(require("node:fs"));
49
49
  const path = __importStar(require("node:path"));
@@ -86,6 +86,8 @@ function intakeRecord(intake) {
86
86
  const out = {};
87
87
  if (typeof intake.request === 'string')
88
88
  out.request = intake.request.slice(0, exports.INTAKE_REQUEST_MAX);
89
+ if (intake.changedFilesSource)
90
+ out.changedFilesSource = intake.changedFilesSource;
89
91
  if (Array.isArray(intake.changedFiles)) {
90
92
  const files = [];
91
93
  for (const raw of intake.changedFiles) {
@@ -136,6 +138,7 @@ function artifactFrom(analysis, recordedAt, fileDigests = {}, intake) {
136
138
  impactedFiles: [...analysis.impacts.impactedFiles],
137
139
  securityAssessed: analysis.constraints.security.assessed,
138
140
  compatibilityAssessed: analysis.constraints.compatibility.assessed,
141
+ architectureTouched: [...(analysis.testScope.architectureTouched ?? [])],
139
142
  },
140
143
  };
141
144
  }