@holmes-lab/holmes-kit 0.40.0 → 0.40.1

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 (56) hide show
  1. package/CHANGELOG.md +234 -0
  2. package/README.md +70 -4
  3. package/dist/.build-id +1 -1
  4. package/dist/holmes/cli/index.js +25 -19
  5. package/dist/holmes/cli/interactive-prompt.d.ts +39 -2
  6. package/dist/holmes/cli/interactive-prompt.js +98 -16
  7. package/dist/holmes/config/config.d.ts +17 -0
  8. package/dist/holmes/config/config.js +13 -1
  9. package/dist/holmes/governance/autonomy.d.ts +7 -0
  10. package/dist/holmes/governance/autonomy.js +36 -5
  11. package/dist/holmes/governance/push-gate-runner.d.ts +2 -0
  12. package/dist/holmes/governance/push-gate-runner.js +40 -3
  13. package/dist/holmes/governance/push-gate.d.ts +13 -2
  14. package/dist/holmes/governance/push-gate.js +106 -14
  15. package/dist/holmes/guardrail/advisory-line.d.ts +102 -0
  16. package/dist/holmes/guardrail/advisory-line.js +718 -0
  17. package/dist/holmes/guardrail/impact-gate.d.ts +6 -0
  18. package/dist/holmes/guardrail/impact-gate.js +32 -5
  19. package/dist/holmes/hooks/pre-tool-use.d.ts +11 -0
  20. package/dist/holmes/hooks/pre-tool-use.js +44 -5
  21. package/dist/holmes/hooks/session-start.js +17 -1
  22. package/dist/holmes/mcp/handlers/maintenance-analysis.d.ts +13 -0
  23. package/dist/holmes/mcp/handlers/maintenance-analysis.js +59 -2
  24. package/dist/holmes/mcp/handlers/test-execution.d.ts +470 -3
  25. package/dist/holmes/mcp/handlers/test-execution.js +199 -21
  26. package/dist/holmes/mcp/handlers.d.ts +468 -3
  27. package/dist/holmes/mcp/handlers.js +5 -1
  28. package/dist/holmes/mcp/maintenance-analyze.d.ts +5 -0
  29. package/dist/holmes/mcp/maintenance-analyze.js +4 -2
  30. package/dist/holmes/mcp/maintenance-evidence.d.ts +9 -0
  31. package/dist/holmes/mcp/maintenance-evidence.js +4 -1
  32. package/dist/holmes/mcp/tool-schemas.js +13 -7
  33. package/dist/holmes/project/baseline.d.ts +15 -2
  34. package/dist/holmes/project/baseline.js +11 -6
  35. package/dist/holmes/project/bounded-io.d.ts +1 -0
  36. package/dist/holmes/project/bounded-io.js +4 -2
  37. package/dist/holmes/project/change-source.d.ts +4 -0
  38. package/dist/holmes/project/change-source.js +13 -5
  39. package/dist/holmes/project/root.js +3 -1
  40. package/dist/holmes/review/evidence-mode.d.ts +21 -0
  41. package/dist/holmes/review/evidence-mode.js +33 -0
  42. package/dist/holmes/review/head-worktree.d.ts +55 -0
  43. package/dist/holmes/review/head-worktree.js +329 -0
  44. package/dist/holmes/review/mrp.js +13 -3
  45. package/dist/holmes/review/run-provenance.d.ts +45 -0
  46. package/dist/holmes/review/run-provenance.js +314 -0
  47. package/dist/holmes/review/test-evidence.d.ts +174 -0
  48. package/dist/holmes/review/test-evidence.js +330 -2
  49. package/dist/holmes/review/test-reports.d.ts +94 -0
  50. package/dist/holmes/review/test-reports.js +382 -0
  51. package/dist/holmes/review/test-runner.d.ts +176 -65
  52. package/dist/holmes/review/test-runner.js +531 -316
  53. package/dist/holmes/review/test-units.d.ts +159 -0
  54. package/dist/holmes/review/test-units.js +814 -0
  55. package/package.json +1 -1
  56. package/playbooks/publish/PLAYBOOK.md +2 -1
@@ -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-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)({
@@ -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
  }