@namewta/speculo 0.7.1 → 0.7.3

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 (57) hide show
  1. package/README.md +2 -1
  2. package/dist/src/migrations.js +604 -23
  3. package/dist/src/migrations.js.map +1 -1
  4. package/package.json +1 -1
  5. package/template/canonical/canonical-specdev-engineering-cognitive-mentor.md +171 -277
  6. package/template/canonical/canonical-specdev-goal-plan.md +714 -833
  7. package/template/canonical/canonical-specdev-grill-with-docs.md +172 -278
  8. package/template/canonical/canonical-specdev-spec.md +199 -315
  9. package/template/canonical/canonical-specdev-tickets.md +405 -398
  10. package/template/canonical/canonical-specdev-wayfinder.md +170 -276
  11. package/template/skills/migrate-runtime-state/SKILL.md +6 -6
  12. package/template/skills/migrate-runtime-state/references/migration-contract.md +9 -3
  13. package/template/skills/migrate-runtime-state/scripts/migrate-runtime-state.mjs +322 -33
  14. package/template/skills/optimize-codex-config/SKILL.md +81 -0
  15. package/template/skills/optimize-codex-config/references/configuration-contract.md +103 -0
  16. package/template/skills/optimize-codex-config/references/troubleshooting.md +79 -0
  17. package/template/skills/optimize-codex-config/scripts/audit-codex-config.mjs +747 -0
  18. package/template/workflows/specdev/I-implement/I-implement.md +97 -142
  19. package/template/workflows/specdev/I-implement/evidence-template.md +60 -48
  20. package/template/workflows/specdev/I-implement/execution-preflight.md +29 -19
  21. package/template/workflows/specdev/I-implement/merge-conflict-protocol.md +12 -11
  22. package/template/workflows/specdev/I-init-setup/I-init-setup.md +4 -5
  23. package/template/workflows/specdev/I-init-setup/change-status-template.json +14 -1
  24. package/template/workflows/specdev/I-init-setup/config-template.json +3 -5
  25. package/template/workflows/specdev/I-init-setup/status-template.json +1 -1
  26. package/template/workflows/specdev/INDEX.md +12 -8
  27. package/template/workflows/specdev/P-goal-plan/P-goal-plan.md +76 -93
  28. package/template/workflows/specdev/P-goal-plan/completion-control.md +26 -44
  29. package/template/workflows/specdev/P-goal-plan/goal-plan-template.md +43 -31
  30. package/template/workflows/specdev/P-goal-plan/lead-orchestration.md +34 -0
  31. package/template/workflows/specdev/P-goal-plan/orchestration-protocol.md +31 -42
  32. package/template/workflows/specdev/P-goal-plan/planning-modes.md +42 -61
  33. package/template/workflows/specdev/T-tickets/T-tickets.md +6 -3
  34. package/template/workflows/specdev/T-tickets/ticket-readiness.md +5 -3
  35. package/template/workflows/specdev/T-tickets/ticket-template.md +8 -1
  36. package/template/workflows/specdev/T-tickets/tickets-map-template.md +5 -4
  37. package/template/workflows/specdev/_state/status.json +1 -1
  38. package/template/workflows/specdev/common/README.md +2 -2
  39. package/template/workflows/specdev/common/rules/change-completion.md +17 -19
  40. package/template/workflows/specdev/common/rules/deviation-control.md +1 -1
  41. package/template/workflows/specdev/common/rules/evidence-and-verification.md +27 -37
  42. package/template/workflows/specdev/common/rules/path-ownership.md +21 -23
  43. package/template/workflows/specdev/common/rules/readiness-and-depth.md +1 -1
  44. package/template/workflows/specdev/common/schemas/change-status.schema.json +136 -195
  45. package/template/workflows/specdev/common/schemas/config.schema.json +9 -11
  46. package/template/workflows/specdev/common/schemas/goal-plan.schema.json +24 -6
  47. package/template/workflows/specdev/common/schemas/status.schema.json +7 -63
  48. package/template/workflows/specdev/common/skills/dev-worktree/SKILL.md +42 -21
  49. package/template/workflows/specdev/common/skills/dev-worktree/references/create.md +48 -18
  50. package/template/workflows/specdev/common/skills/dev-worktree/references/finalize.md +47 -12
  51. package/template/workflows/specdev/common/skills/subagent-delivery/SKILL.md +34 -30
  52. package/template/workflows/specdev/common/skills/subagent-delivery/references/external-web-subagent.md +10 -23
  53. package/template/workflows/specdev/common/skills/subagent-delivery/references/native-subagent.md +14 -25
  54. package/template/workflows/specdev/common/tools/validate-specdev.mjs +507 -117
  55. package/template/workflows/specdev/I-implement/delegated-evidence-template.md +0 -11
  56. package/template/workflows/specdev/P-goal-plan/delegated-execution-template.md +0 -33
  57. package/template/workflows/specdev/P-goal-plan/delegated-execution.md +0 -53
@@ -1530,7 +1530,7 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
1530
1530
 
1531
1531
  - 未批准的 ticket、spec、architecture 或 release 偏差不得继续实现。
1532
1532
  - 不得通过扩大 `writable_paths`、删除测试、降低断言或把风险改写成“已知限制”来绕过停止。
1533
- - 偏差影响普通并行执行时,当前集成 owner 必须暂停受影响 Wave,重新计算路径所有权、依赖和 Gate;委派执行由 Lead 承担同一责任。
1533
+ - 偏差影响并行执行、source checkpoint 或 candidate 集成时,Lead 必须暂停受影响 Wave,重新计算路径所有权、依赖、Gate 与父分支顺序;任何 subagent 都不能自行改写上层合同。
1534
1534
 
1535
1535
  </deviation-control>
1536
1536
 
@@ -1593,16 +1593,14 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
1593
1593
 
1594
1594
  ```json
1595
1595
  {
1596
- "schema_version": 3,
1596
+ "schema_version": 4,
1597
1597
  "interaction_language": "zh-CN",
1598
1598
  "artifact_language": "zh-CN",
1599
1599
  "git": {
1600
- "auto_commit": false,
1601
- "default_branch": null,
1602
- "worktree_for_parallel": true
1600
+ "default_branch": null
1603
1601
  },
1604
1602
  "execution": {
1605
- "max_parallel": 3,
1603
+ "max_implementation_agents": 3,
1606
1604
  "deep_ticket_human_approval": true,
1607
1605
  "shared_path_owner": "explicit"
1608
1606
  },
@@ -1627,33 +1625,31 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
1627
1625
  ```json
1628
1626
  {
1629
1627
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1630
- "$id": "urn:speculo:specdev:config:v3",
1628
+ "$id": "urn:speculo:specdev:config:v4",
1631
1629
  "title": "SpecDev Configuration",
1632
1630
  "type": "object",
1633
1631
  "required": ["schema_version", "interaction_language", "artifact_language", "git", "execution", "verification", "planning"],
1634
1632
  "properties": {
1635
- "schema_version": {"const": 3},
1633
+ "schema_version": {"const": 4},
1636
1634
  "interaction_language": {"type": "string", "minLength": 1},
1637
1635
  "artifact_language": {"type": "string", "minLength": 1},
1638
1636
  "git": {
1639
1637
  "type": "object",
1640
- "required": ["auto_commit", "default_branch", "worktree_for_parallel"],
1638
+ "required": ["default_branch"],
1641
1639
  "properties": {
1642
- "auto_commit": {"type": "boolean"},
1643
- "default_branch": {"type": ["string", "null"]},
1644
- "worktree_for_parallel": {"type": "boolean"}
1640
+ "default_branch": {"type": ["string", "null"]}
1645
1641
  },
1646
- "additionalProperties": true
1642
+ "additionalProperties": false
1647
1643
  },
1648
1644
  "execution": {
1649
1645
  "type": "object",
1650
- "required": ["max_parallel", "deep_ticket_human_approval", "shared_path_owner"],
1646
+ "required": ["max_implementation_agents", "deep_ticket_human_approval", "shared_path_owner"],
1651
1647
  "properties": {
1652
- "max_parallel": {"type": "integer", "minimum": 1},
1648
+ "max_implementation_agents": {"type": "integer", "minimum": 1, "maximum": 3},
1653
1649
  "deep_ticket_human_approval": {"type": "boolean"},
1654
1650
  "shared_path_owner": {"type": "string", "minLength": 1}
1655
1651
  },
1656
- "additionalProperties": true
1652
+ "additionalProperties": false
1657
1653
  },
1658
1654
  "verification": {
1659
1655
  "type": "object",
@@ -1677,7 +1673,7 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
1677
1673
  "additionalProperties": true
1678
1674
  }
1679
1675
  },
1680
- "additionalProperties": true
1676
+ "additionalProperties": false
1681
1677
  }
1682
1678
  ```
1683
1679
 
@@ -1687,7 +1683,7 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
1687
1683
 
1688
1684
  ```json
1689
1685
  {
1690
- "schema_version": 4,
1686
+ "schema_version": 5,
1691
1687
  "workflow": "specdev",
1692
1688
  "active": [],
1693
1689
  "archived": []
@@ -1701,83 +1697,27 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
1701
1697
  ```json
1702
1698
  {
1703
1699
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1704
- "$id": "urn:speculo:specdev:status:v4",
1700
+ "$id": "urn:speculo:specdev:status:v5",
1705
1701
  "title": "SpecDev Global Status",
1706
1702
  "type": "object",
1707
- "required": [
1708
- "schema_version",
1709
- "workflow",
1710
- "active",
1711
- "archived"
1712
- ],
1703
+ "required": ["schema_version", "workflow", "active", "archived"],
1713
1704
  "properties": {
1714
- "schema_version": {
1715
- "const": 4
1716
- },
1717
- "workflow": {
1718
- "const": "specdev"
1719
- },
1705
+ "schema_version": {"const": 5},
1706
+ "workflow": {"const": "specdev"},
1720
1707
  "active": {
1721
1708
  "type": "array",
1722
1709
  "items": {
1723
1710
  "type": "object",
1724
- "required": [
1725
- "change",
1726
- "current_work",
1727
- "works_run"
1728
- ],
1711
+ "required": ["change"],
1729
1712
  "properties": {
1730
1713
  "change": {
1731
1714
  "type": "string",
1732
1715
  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"
1733
- },
1734
- "current_work": {
1735
- "type": [
1736
- "string",
1737
- "null"
1738
- ],
1739
- "pattern": "^specdev/"
1740
- },
1741
- "works_run": {
1742
- "type": "array",
1743
- "items": {
1744
- "type": "string",
1745
- "pattern": "^specdev/"
1746
- },
1747
- "uniqueItems": true
1748
- },
1749
- "claimed_investigations": {
1750
- "type": "array",
1751
- "items": {
1752
- "type": "object",
1753
- "required": [
1754
- "id",
1755
- "owner",
1756
- "claimed_at"
1757
- ],
1758
- "properties": {
1759
- "id": {
1760
- "type": "string"
1761
- },
1762
- "owner": {
1763
- "type": "string"
1764
- },
1765
- "session": {
1766
- "type": [
1767
- "string",
1768
- "null"
1769
- ]
1770
- },
1771
- "claimed_at": {
1772
- "type": "string"
1773
- }
1774
- },
1775
- "additionalProperties": false
1776
- }
1777
1716
  }
1778
1717
  },
1779
1718
  "additionalProperties": false
1780
- }
1719
+ },
1720
+ "uniqueItems": true
1781
1721
  },
1782
1722
  "archived": {
1783
1723
  "type": "array",
@@ -1798,11 +1738,24 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
1798
1738
 
1799
1739
  ```json
1800
1740
  {
1801
- "schema_version": 3,
1741
+ "schema_version": 5,
1802
1742
  "artifact": "change-status",
1803
1743
  "change": "<YYYY-MM-DD-topic>",
1804
1744
  "change_status": "active",
1805
1745
  "current_work": null,
1746
+ "works_run": [],
1747
+ "claimed_investigations": [],
1748
+ "execution_authorization": {
1749
+ "implementation_commit": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Ticket source commits"},
1750
+ "local_candidate_integration": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Lead-owned local parent candidate integration and parent update"},
1751
+ "source_cleanup": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Source worktree and branch cleanup"}
1752
+ },
1753
+ "leadership": {
1754
+ "current": "<owner-or-session-locator>",
1755
+ "epoch": 1,
1756
+ "assigned_at": "<ISO-8601>",
1757
+ "history": []
1758
+ },
1806
1759
  "created_at": "<ISO-8601>",
1807
1760
  "updated_at": "<ISO-8601>",
1808
1761
  "completed_at": null,
@@ -1821,216 +1774,157 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
1821
1774
  ```json
1822
1775
  {
1823
1776
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1824
- "$id": "urn:speculo:specdev:change-status:v3",
1777
+ "$id": "urn:speculo:specdev:change-status:v5",
1825
1778
  "title": "SpecDev Change Status",
1826
1779
  "type": "object",
1827
1780
  "required": [
1828
- "schema_version",
1829
- "artifact",
1830
- "change",
1831
- "change_status",
1832
- "current_work",
1833
- "created_at",
1834
- "updated_at",
1835
- "completed_at",
1836
- "archived",
1837
- "archive_path",
1838
- "blockers",
1839
- "deviations"
1781
+ "schema_version", "artifact", "change", "change_status", "current_work", "works_run",
1782
+ "claimed_investigations", "execution_authorization", "leadership", "created_at", "updated_at",
1783
+ "completed_at", "archived", "archive_path", "blockers", "deviations", "worktrees"
1840
1784
  ],
1841
1785
  "properties": {
1842
- "schema_version": {
1843
- "const": 3
1844
- },
1845
- "artifact": {
1846
- "const": "change-status"
1847
- },
1848
- "change": {
1849
- "type": "string",
1850
- "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"
1851
- },
1852
- "change_status": {
1853
- "enum": [
1854
- "active",
1855
- "blocked",
1856
- "completed",
1857
- "archived"
1858
- ]
1859
- },
1860
- "current_work": {
1861
- "type": [
1862
- "string",
1863
- "null"
1864
- ]
1865
- },
1866
- "created_at": {
1867
- "type": "string",
1868
- "minLength": 1
1869
- },
1870
- "updated_at": {
1871
- "type": "string",
1872
- "minLength": 1
1786
+ "schema_version": {"const": 5},
1787
+ "artifact": {"const": "change-status"},
1788
+ "change": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"},
1789
+ "change_status": {"enum": ["active", "blocked", "completed", "archived"]},
1790
+ "current_work": {"type": ["string", "null"], "pattern": "^specdev/"},
1791
+ "works_run": {"type": "array", "items": {"type": "string", "pattern": "^specdev/"}, "uniqueItems": true},
1792
+ "claimed_investigations": {"type": "array", "items": {"$ref": "#/$defs/claim"}},
1793
+ "execution_authorization": {"$ref": "#/$defs/authorization"},
1794
+ "leadership": {"$ref": "#/$defs/leadership"},
1795
+ "created_at": {"type": "string", "minLength": 1},
1796
+ "updated_at": {"type": "string", "minLength": 1},
1797
+ "completed_at": {"type": ["string", "null"]},
1798
+ "archived": {"type": "boolean"},
1799
+ "archive_path": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"}]},
1800
+ "blockers": {"type": "array", "items": {"type": "string"}},
1801
+ "deviations": {"type": "array", "items": {"type": "string"}},
1802
+ "worktrees": {"type": "array", "items": {"$ref": "#/$defs/worktree"}}
1803
+ },
1804
+ "$defs": {
1805
+ "claim": {
1806
+ "type": "object",
1807
+ "required": ["id", "owner", "session", "claimed_at"],
1808
+ "properties": {
1809
+ "id": {"type": "string", "minLength": 1},
1810
+ "owner": {"type": "string", "minLength": 1},
1811
+ "session": {"type": ["string", "null"]},
1812
+ "claimed_at": {"type": "string", "minLength": 1}
1813
+ },
1814
+ "additionalProperties": false
1873
1815
  },
1874
- "completed_at": {
1875
- "type": [
1876
- "string",
1877
- "null"
1878
- ]
1816
+ "authorization-entry": {
1817
+ "type": "object",
1818
+ "required": ["status", "source", "granted_at", "scope"],
1819
+ "properties": {
1820
+ "status": {"enum": ["authorized", "not-authorized", "revoked"]},
1821
+ "source": {"type": ["string", "null"]},
1822
+ "granted_at": {"type": ["string", "null"]},
1823
+ "scope": {"type": "string", "minLength": 1}
1824
+ },
1825
+ "allOf": [{
1826
+ "if": {"properties": {"status": {"const": "authorized"}}, "required": ["status"]},
1827
+ "then": {"properties": {"source": {"type": "string", "minLength": 1}, "granted_at": {"type": "string", "minLength": 1}}}
1828
+ }],
1829
+ "additionalProperties": false
1879
1830
  },
1880
- "archived": {
1881
- "type": "boolean"
1831
+ "authorization": {
1832
+ "type": "object",
1833
+ "required": ["implementation_commit", "local_candidate_integration", "source_cleanup"],
1834
+ "properties": {
1835
+ "implementation_commit": {"$ref": "#/$defs/authorization-entry"},
1836
+ "local_candidate_integration": {"$ref": "#/$defs/authorization-entry"},
1837
+ "source_cleanup": {"$ref": "#/$defs/authorization-entry"}
1838
+ },
1839
+ "additionalProperties": false
1882
1840
  },
1883
- "archive_path": {
1884
- "anyOf": [
1885
- {
1886
- "type": "null"
1887
- },
1888
- {
1889
- "type": "string",
1890
- "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"
1891
- }
1892
- ]
1841
+ "leadership-history": {
1842
+ "type": "object",
1843
+ "required": ["owner", "epoch", "assigned_at", "ended_at"],
1844
+ "properties": {
1845
+ "owner": {"type": "string", "minLength": 1},
1846
+ "epoch": {"type": "integer", "minimum": 1},
1847
+ "assigned_at": {"type": "string", "minLength": 1},
1848
+ "ended_at": {"type": "string", "minLength": 1}
1849
+ },
1850
+ "additionalProperties": false
1893
1851
  },
1894
- "blockers": {
1895
- "type": "array",
1896
- "items": {
1897
- "type": "string"
1898
- }
1852
+ "leadership": {
1853
+ "type": "object",
1854
+ "required": ["current", "epoch", "assigned_at", "history"],
1855
+ "properties": {
1856
+ "current": {"type": "string", "minLength": 1},
1857
+ "epoch": {"type": "integer", "minimum": 1},
1858
+ "assigned_at": {"type": "string", "minLength": 1},
1859
+ "history": {"type": "array", "items": {"$ref": "#/$defs/leadership-history"}}
1860
+ },
1861
+ "additionalProperties": false
1899
1862
  },
1900
- "deviations": {
1901
- "type": "array",
1902
- "items": {
1903
- "type": "string"
1904
- }
1863
+ "full-suite": {
1864
+ "type": "object",
1865
+ "required": ["required", "status", "reason", "evidence"],
1866
+ "properties": {
1867
+ "required": {"type": "boolean"},
1868
+ "status": {"enum": ["not-required", "pending", "passed", "failed"]},
1869
+ "reason": {"type": ["string", "null"]},
1870
+ "evidence": {"type": ["string", "null"]}
1871
+ },
1872
+ "allOf": [{
1873
+ "if": {"properties": {"required": {"const": false}}, "required": ["required"]},
1874
+ "then": {"properties": {"status": {"const": "not-required"}, "reason": {"type": "string", "minLength": 1}}}
1875
+ }],
1876
+ "additionalProperties": false
1905
1877
  },
1906
- "worktrees": {
1907
- "type": "array",
1908
- "items": {
1909
- "type": "object",
1910
- "required": [
1911
- "ticket_id",
1912
- "owner",
1913
- "provider",
1914
- "base_sha",
1915
- "branch",
1916
- "workspace_ref",
1917
- "status",
1918
- "updated_at"
1919
- ],
1920
- "properties": {
1921
- "ticket_id": {
1922
- "type": "string",
1923
- "pattern": "^T-[0-9]{2,}$"
1924
- },
1925
- "owner": {
1926
- "type": "string",
1927
- "minLength": 1
1928
- },
1929
- "provider": {
1930
- "enum": [
1931
- "native",
1932
- "git",
1933
- "external"
1934
- ]
1935
- },
1936
- "base_sha": {
1937
- "type": "string",
1938
- "minLength": 1
1939
- },
1940
- "branch": {
1941
- "type": "string",
1942
- "minLength": 1
1943
- },
1944
- "workspace_ref": {
1945
- "type": "string",
1946
- "minLength": 1,
1947
- "pattern": "^(?!/)(?![A-Za-z]:[\\\\/]).+"
1948
- },
1949
- "status": {
1950
- "enum": [
1951
- "planned",
1952
- "active",
1953
- "review",
1954
- "integrated",
1955
- "removed",
1956
- "blocked"
1957
- ]
1958
- },
1959
- "updated_at": {
1960
- "type": "string",
1961
- "minLength": 1
1962
- }
1963
- },
1964
- "additionalProperties": true
1965
- }
1966
- }
1967
- },
1968
- "allOf": [
1969
- {
1970
- "if": {
1971
- "properties": {
1972
- "worktrees": {
1973
- "contains": {
1974
- "properties": {
1975
- "provider": {
1976
- "const": "git"
1977
- }
1978
- },
1979
- "required": [
1980
- "provider"
1981
- ]
1982
- }
1983
- }
1984
- }
1878
+ "worktree": {
1879
+ "type": "object",
1880
+ "required": ["ticket_id", "owner", "implementation_owner", "integration_owner", "provider", "base_sha", "parent_branch", "branch", "workspace_ref", "source_checkpoint", "integration", "status", "updated_at"],
1881
+ "properties": {
1882
+ "ticket_id": {"type": "string", "pattern": "^T-[0-9]{2,}$"},
1883
+ "owner": {"type": "string", "minLength": 1},
1884
+ "implementation_owner": {"type": "string", "minLength": 1},
1885
+ "integration_owner": {"type": "string", "minLength": 1},
1886
+ "provider": {"const": "git"},
1887
+ "base_sha": {"type": "string", "minLength": 1},
1888
+ "parent_branch": {"type": "string", "minLength": 1},
1889
+ "branch": {"type": "string", "minLength": 1},
1890
+ "workspace_ref": {"type": "string", "pattern": "^specdev-worktree/[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*/T-[0-9]{2,}$"},
1891
+ "source_checkpoint": {"type": ["string", "null"]},
1892
+ "integration": {"$ref": "#/$defs/integration"},
1893
+ "status": {"enum": ["planned", "active", "review", "integrating", "integrated", "removed", "blocked"]},
1894
+ "updated_at": {"type": "string", "minLength": 1}
1985
1895
  },
1986
- "then": {
1987
- "properties": {
1988
- "worktrees": {
1989
- "items": {
1990
- "if": {
1991
- "properties": {
1992
- "provider": {
1993
- "const": "git"
1994
- }
1995
- },
1996
- "required": [
1997
- "provider"
1998
- ]
1999
- },
2000
- "then": {
2001
- "properties": {
2002
- "workspace_ref": {
2003
- "pattern": "^specdev-worktree/T-[0-9]{2,}$"
2004
- }
2005
- }
2006
- }
2007
- }
2008
- }
2009
- }
2010
- }
1896
+ "additionalProperties": false
2011
1897
  },
2012
- {
2013
- "if": {
2014
- "properties": {
2015
- "change_status": {
2016
- "const": "archived"
2017
- }
2018
- }
1898
+ "integration": {
1899
+ "type": "object",
1900
+ "required": ["status", "parent_ref", "parent_before_sha", "source_sha", "candidate_sha", "candidate_tree_sha", "candidate_branch", "candidate_workspace_ref", "result_sha", "method", "conflict_paths", "verification", "full_suite", "e2e", "evidence", "attempts", "promotion_status"],
1901
+ "properties": {
1902
+ "status": {"enum": ["pending", "candidate", "passed", "failed", "stale"]},
1903
+ "parent_ref": {"type": ["string", "null"]},
1904
+ "parent_before_sha": {"type": ["string", "null"]},
1905
+ "source_sha": {"type": ["string", "null"]},
1906
+ "candidate_sha": {"type": ["string", "null"]},
1907
+ "candidate_tree_sha": {"type": ["string", "null"]},
1908
+ "candidate_branch": {"type": ["string", "null"]},
1909
+ "candidate_workspace_ref": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^specdev-worktree/\\.integration/[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*/T-[0-9]{2,}$"}]},
1910
+ "result_sha": {"type": ["string", "null"]},
1911
+ "method": {"enum": [null, "fast-forward", "merge-commit"]},
1912
+ "conflict_paths": {"type": "array", "items": {"type": "string"}},
1913
+ "verification": {"enum": ["pending", "passed", "failed"]},
1914
+ "full_suite": {"$ref": "#/$defs/full-suite"},
1915
+ "e2e": {"$ref": "#/$defs/full-suite"},
1916
+ "evidence": {"type": "string", "pattern": "^\\{roots\\.state\\}/specdev/changes/[^<]+/evidence/T-[0-9]{2,}\\.md$"},
1917
+ "attempts": {"type": "integer", "minimum": 0},
1918
+ "promotion_status": {"enum": ["pending", "applying", "applied", "failed", "stale"]}
2019
1919
  },
2020
- "then": {
2021
- "properties": {
2022
- "archived": {
2023
- "const": true
2024
- },
2025
- "archive_path": {
2026
- "type": "string",
2027
- "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"
2028
- }
2029
- }
2030
- }
1920
+ "additionalProperties": false
2031
1921
  }
2032
- ],
2033
- "additionalProperties": true
1922
+ },
1923
+ "allOf": [{
1924
+ "if": {"properties": {"change_status": {"const": "archived"}}, "required": ["change_status"]},
1925
+ "then": {"properties": {"archived": {"const": true}, "archive_path": {"type": "string", "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"}}}
1926
+ }],
1927
+ "additionalProperties": false
2034
1928
  }
2035
1929
  ```
2036
1930