its-magic 0.1.2-9 → 0.1.2
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/README.md +1602 -755
- package/bin/its-magic.js +121 -11
- package/bin/postinstall.js +21 -0
- package/installer.ps1 +759 -0
- package/installer.py +981 -0
- package/installer.sh +649 -0
- package/package.json +18 -14
- package/scripts/check_intake_template_parity.py +284 -0
- package/scripts/doc_profile_lib.py +415 -0
- package/scripts/guard_installer_publish.py +88 -0
- package/scripts/intake_bug_routing_guard.py +67 -0
- package/scripts/intake_evidence_lib.py +802 -0
- package/scripts/intake_evidence_validate.py +73 -0
- package/scripts/materialize_codebase_map.py +184 -0
- package/scripts/remote_config_summary.py +243 -0
- package/template/.cursor/agents/curator.mdc +35 -0
- package/template/.cursor/agents/dev.mdc +29 -0
- package/template/.cursor/agents/po.mdc +141 -0
- package/template/.cursor/agents/qa.mdc +28 -0
- package/template/.cursor/agents/release.mdc +28 -0
- package/template/.cursor/agents/security.mdc +98 -0
- package/template/.cursor/agents/tech-lead.mdc +57 -0
- package/template/.cursor/commands/architecture.md +127 -0
- package/template/.cursor/commands/ask.md +55 -0
- package/template/.cursor/commands/auto.md +533 -0
- package/template/.cursor/commands/discovery.md +47 -0
- package/template/.cursor/commands/execute.md +343 -0
- package/template/.cursor/commands/intake.md +323 -0
- package/template/.cursor/commands/map-codebase.md +46 -0
- package/template/.cursor/commands/memory-audit.md +175 -0
- package/template/.cursor/commands/milestone-complete.md +51 -0
- package/template/.cursor/commands/milestone-start.md +59 -0
- package/template/.cursor/commands/pause.md +64 -0
- package/{.cursor/commands/gsd-phase-context.md → template/.cursor/commands/phase-context.md} +6 -2
- package/template/.cursor/commands/plan-verify.md +34 -0
- package/template/.cursor/commands/qa.md +226 -0
- package/template/.cursor/commands/quick.md +41 -0
- package/template/.cursor/commands/refresh-context.md +82 -0
- package/template/.cursor/commands/release.md +505 -0
- package/template/.cursor/commands/research.md +49 -0
- package/template/.cursor/commands/resume.md +67 -0
- package/template/.cursor/commands/security-review.md +81 -0
- package/template/.cursor/commands/sprint-plan.md +103 -0
- package/template/.cursor/commands/status-reconcile.md +95 -0
- package/template/.cursor/commands/verify-work.md +152 -0
- package/template/.cursor/dev-environment.json.example +22 -0
- package/{.cursor → template/.cursor}/hooks/README.md +3 -2
- package/{.cursor/hooks/gsd-hook.py → template/.cursor/hooks/hook.py} +15 -6
- package/template/.cursor/hooks.json +26 -0
- package/template/.cursor/remote.json +31 -0
- package/template/.cursor/rules/caveman.mdc +184 -0
- package/template/.cursor/rules/coding-standards.mdc +39 -0
- package/template/.cursor/rules/core.mdc +111 -0
- package/template/.cursor/rules/handoffs.mdc +27 -0
- package/template/.cursor/rules/quality.mdc +49 -0
- package/template/.cursor/scratchpad.local.example.md +323 -0
- package/template/.cursor/scratchpad.md +324 -0
- package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/SKILL.md +2 -2
- package/template/.cursorignore +6 -0
- package/template/.env.example +28 -0
- package/template/.github/workflows/ci.yml +194 -0
- package/{.github → template/.github}/workflows/deploy.yml +5 -2
- package/template/.its-magic-version +1 -0
- package/template/README.md +1602 -0
- package/template/decisions/DEC-0001.md +11 -0
- package/template/decisions/DEC-0002.md +11 -0
- package/template/docs/developer/README.md +44 -0
- package/template/docs/engineering/architecture.md +9 -0
- package/template/docs/engineering/artifact-ordering-policy.md +48 -0
- package/template/docs/engineering/artifact-ownership-policy.md +57 -0
- package/template/docs/engineering/auto-orchestration-reference.md +1211 -0
- package/{docs → template/docs}/engineering/codebase-map.md +0 -5
- package/template/docs/engineering/compatibility-report.md +20 -0
- package/template/docs/engineering/compatibility-signals.md +7 -0
- package/template/docs/engineering/component-scope-report.md +16 -0
- package/template/docs/engineering/component-scope.md +19 -0
- package/template/docs/engineering/context/installer-owned-paths.manifest +96 -0
- package/template/docs/engineering/context/readme-section-affinity.json +30 -0
- package/template/docs/engineering/decisions.md +16 -0
- package/template/docs/engineering/legacy-drift-audit.md +21 -0
- package/template/docs/engineering/manifests/components/api-gateway.manifest.yaml +12 -0
- package/template/docs/engineering/manifests/registry.manifest.yaml +20 -0
- package/template/docs/engineering/manifests/repo.manifest.yaml +11 -0
- package/template/docs/engineering/phase-context.md +16 -0
- package/template/docs/engineering/release-targets.json +123 -0
- package/template/docs/engineering/research.md +29 -0
- package/template/docs/engineering/runbook.md +2320 -0
- package/template/docs/engineering/runtime-connectivity.md +81 -0
- package/template/docs/engineering/security-review.md +33 -0
- package/template/docs/engineering/spec-pack/README.md +20 -0
- package/template/docs/engineering/state-archive/README.md +15 -0
- package/template/docs/engineering/state.md +20 -0
- package/template/docs/engineering/status-normalization-report.md +19 -0
- package/template/docs/engineering/token-cost-parity-manifest.md +16 -0
- package/template/docs/engineering/us-0084-remote-e2e.md +44 -0
- package/template/docs/product/acceptance.md +1 -0
- package/template/docs/product/backlog.md +5 -0
- package/template/docs/product/vision.md +11 -0
- package/template/docs/user-guides/README.md +40 -0
- package/{handoffs → template/handoffs}/dev_to_qa.md +0 -3
- package/{handoffs → template/handoffs}/po_to_tl.md +0 -3
- package/{handoffs → template/handoffs}/qa_to_dev.md +1 -2
- package/template/handoffs/release_notes.md +51 -0
- package/template/handoffs/release_queue.md +47 -0
- package/template/handoffs/release_to_dev.md +31 -0
- package/template/handoffs/releases/Sxxxx-release-notes.md +62 -0
- package/template/handoffs/resume_brief.md +14 -0
- package/{handoffs → template/handoffs}/tl_to_dev.md +0 -2
- package/template/handoffs/token_cost_runs/README.md +26 -0
- package/template/its_magic/.its-magic-version +1 -0
- package/template/its_magic/README.md +9 -0
- package/template/scripts/auto_outer_driver.py +521 -0
- package/template/scripts/caveman_compress_input.py +903 -0
- package/template/scripts/check_downstream_ci_guard.py +67 -0
- package/template/scripts/check_intake_template_parity.py +284 -0
- package/template/scripts/check_token_cost_parity.py +69 -0
- package/template/scripts/dev_environment_lib.py +463 -0
- package/template/scripts/doc_profile_lib.py +415 -0
- package/template/scripts/downstream_ci_guard_lib.py +222 -0
- package/template/scripts/enforce-triad-hot-surface.py +753 -0
- package/template/scripts/guard_installer_publish.py +88 -0
- package/template/scripts/intake_bug_resume_brief_refresh.py +303 -0
- package/template/scripts/intake_bug_routing_guard.py +67 -0
- package/template/scripts/intake_evidence_lib.py +802 -0
- package/template/scripts/intake_evidence_validate.py +73 -0
- package/template/scripts/materialize_codebase_map.py +184 -0
- package/template/scripts/pack_json_validate.py +130 -0
- package/template/scripts/project_readme_coverage_lib.py +417 -0
- package/template/scripts/readme_feature_coverage_lib.py +608 -0
- package/template/scripts/remote_config_summary.py +243 -0
- package/template/scripts/sync_push_gates.py +198 -0
- package/template/scripts/token_cost_compare.py +40 -0
- package/template/scripts/token_cost_lib.py +108 -0
- package/template/scripts/uat_probe_lib.py +868 -0
- package/template/scripts/validate-and-push.ps1 +280 -0
- package/template/scripts/validate-and-push.sh +243 -0
- package/template/scripts/validate_doc_profile.py +103 -0
- package/template/scripts/validate_project_readme_coverage.py +151 -0
- package/template/scripts/validate_readme_feature_coverage.py +140 -0
- package/template/sprints/S0001/progress.md +1 -0
- package/template/sprints/S0001/qa-findings.md +9 -0
- package/template/sprints/S0001/release-findings.md +24 -0
- package/template/sprints/S0001/sprint.md +9 -0
- package/template/sprints/S0001/summary.md +7 -0
- package/template/sprints/S0001/tasks.md +1 -0
- package/template/sprints/S0001/uat.json +6 -0
- package/template/sprints/S0001/uat.md +5 -0
- package/template/sprints/quick/Q0001/summary.md +1 -0
- package/{sprints → template/sprints}/quick/Q0001/task.json +0 -1
- package/.cursor/agents/curator.mdc +0 -21
- package/.cursor/agents/dev.mdc +0 -20
- package/.cursor/agents/po.mdc +0 -19
- package/.cursor/agents/qa.mdc +0 -19
- package/.cursor/agents/release.mdc +0 -19
- package/.cursor/agents/tech-lead.mdc +0 -21
- package/.cursor/commands/gsd-architecture.md +0 -29
- package/.cursor/commands/gsd-auto.md +0 -27
- package/.cursor/commands/gsd-discovery.md +0 -27
- package/.cursor/commands/gsd-execute.md +0 -32
- package/.cursor/commands/gsd-intake.md +0 -28
- package/.cursor/commands/gsd-map-codebase.md +0 -25
- package/.cursor/commands/gsd-milestone-complete.md +0 -24
- package/.cursor/commands/gsd-milestone-start.md +0 -26
- package/.cursor/commands/gsd-pause.md +0 -25
- package/.cursor/commands/gsd-plan-verify.md +0 -26
- package/.cursor/commands/gsd-qa.md +0 -28
- package/.cursor/commands/gsd-quick.md +0 -24
- package/.cursor/commands/gsd-refresh-context.md +0 -26
- package/.cursor/commands/gsd-release.md +0 -29
- package/.cursor/commands/gsd-research.md +0 -28
- package/.cursor/commands/gsd-resume.md +0 -26
- package/.cursor/commands/gsd-sprint-plan.md +0 -30
- package/.cursor/commands/gsd-verify-work.md +0 -25
- package/.cursor/hooks.json +0 -26
- package/.cursor/plans/cursor-gsd-team-kit_8cfee9b8.plan.md +0 -57
- package/.cursor/remote.json +0 -18
- package/.cursor/rules/gsd-core.mdc +0 -18
- package/.cursor/rules/gsd-handoffs.mdc +0 -10
- package/.cursor/rules/gsd-quality.mdc +0 -15
- package/.cursor/scratchpad.md +0 -34
- package/.github/workflows/ci.yml +0 -47
- package/decisions/DEC-0001.md +0 -21
- package/decisions/DEC-0002.md +0 -21
- package/docs/engineering/architecture.md +0 -354
- package/docs/engineering/decisions.md +0 -6
- package/docs/engineering/research.md +0 -11
- package/docs/engineering/runbook.md +0 -32
- package/docs/engineering/state.md +0 -33
- package/docs/product/acceptance.md +0 -6
- package/docs/product/backlog.md +0 -7
- package/docs/product/vision.md +0 -46
- package/gsd-installer.ps1 +0 -189
- package/gsd-installer.py +0 -195
- package/gsd-installer.sh +0 -201
- package/handoffs/release_notes.md +0 -14
- package/handoffs/resume_brief.md +0 -8
- package/milestones/M0001/milestone.json +0 -7
- package/milestones/M0001/phases.json +0 -9
- package/milestones/M0001/progress.md +0 -3
- package/milestones/M0001/summary.md +0 -3
- package/scripts/generate-release-notes.ps1 +0 -74
- package/scripts/generate-release-notes.sh +0 -63
- package/scripts/release-all.ps1 +0 -423
- package/scripts/release-all.sh +0 -226
- package/sprints/S0001/progress.md +0 -4
- package/sprints/S0001/qa-findings.md +0 -113
- package/sprints/S0001/sprint.md +0 -70
- package/sprints/S0001/summary.md +0 -46
- package/sprints/S0001/tasks.md +0 -35
- package/sprints/S0001/uat.json +0 -8
- package/sprints/S0001/uat.md +0 -8
- package/sprints/quick/Q0001/summary.md +0 -3
- /package/{.cursor/rules/gsd-escalation.mdc → template/.cursor/rules/escalation.mdc} +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/acceptance.json +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/acceptance.md +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/architecture.json +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/architecture.md +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/decision.json +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/decision.md +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/handoff.json +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/handoff.md +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/milestone.json +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/phase-context.json +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/plan-verify.json +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/sprint.json +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/sprint.md +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/story.json +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/story.md +0 -0
- /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/uat.json +0 -0
- /package/{docs → template/docs}/engineering/context/phase-template.json +0 -0
- /package/{docs → template/docs}/engineering/dependencies.json +0 -0
- /package/{sprints → template/sprints}/S0001/plan-verify.json +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Downstream CI drift guard CLI (BUG-0009 / DEC-0075).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import argparse
|
|
9
|
+
import json
|
|
10
|
+
import os
|
|
11
|
+
import sys
|
|
12
|
+
|
|
13
|
+
_SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
14
|
+
_REPO_ROOT = os.path.normpath(os.path.join(_SCRIPT_DIR, ".."))
|
|
15
|
+
|
|
16
|
+
if _SCRIPT_DIR not in sys.path:
|
|
17
|
+
sys.path.insert(0, _SCRIPT_DIR)
|
|
18
|
+
|
|
19
|
+
import downstream_ci_guard_lib as dci # noqa: E402
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def main() -> int:
|
|
23
|
+
parser = argparse.ArgumentParser(
|
|
24
|
+
description="Downstream CI drift guard (template forbidden scan + active inventory)."
|
|
25
|
+
)
|
|
26
|
+
parser.add_argument(
|
|
27
|
+
"--repo",
|
|
28
|
+
default=_REPO_ROOT,
|
|
29
|
+
help="Target repository root (default: parent of scripts/).",
|
|
30
|
+
)
|
|
31
|
+
parser.add_argument(
|
|
32
|
+
"--self-test",
|
|
33
|
+
action="store_true",
|
|
34
|
+
help="Run stable marker subtests.",
|
|
35
|
+
)
|
|
36
|
+
parser.add_argument(
|
|
37
|
+
"--report",
|
|
38
|
+
action="store_true",
|
|
39
|
+
help="Emit JSON inventory to stdout.",
|
|
40
|
+
)
|
|
41
|
+
args = parser.parse_args()
|
|
42
|
+
|
|
43
|
+
if args.self_test:
|
|
44
|
+
try:
|
|
45
|
+
dci.self_test()
|
|
46
|
+
except AssertionError as exc:
|
|
47
|
+
print(f"self-test failed: {exc}", file=sys.stderr)
|
|
48
|
+
return 2
|
|
49
|
+
print("[DOWNSTREAM_CI_GUARD_SELF_TEST_OK]")
|
|
50
|
+
return 0
|
|
51
|
+
|
|
52
|
+
target = os.path.abspath(args.repo)
|
|
53
|
+
report, stderr_lines = dci.build_report(target)
|
|
54
|
+
|
|
55
|
+
if args.report:
|
|
56
|
+
print(json.dumps(dci.report_to_dict(report), sort_keys=True, separators=(",", ":")))
|
|
57
|
+
|
|
58
|
+
for line in stderr_lines:
|
|
59
|
+
print(line, file=sys.stderr)
|
|
60
|
+
|
|
61
|
+
if not report.ok:
|
|
62
|
+
return 1
|
|
63
|
+
return 0
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
if __name__ == "__main__":
|
|
67
|
+
sys.exit(main())
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Verify active vs template/scripts/ bytes match for DEC-0063 intake gate modules (BUG-0001).
|
|
3
|
+
|
|
4
|
+
Scoped modes (DEC-0073 §10 / US-0090):
|
|
5
|
+
--scope=intake (default) DEC-0063 intake pair table.
|
|
6
|
+
--scope=caveman-compress DEC-0073 caveman input-compression pair table.
|
|
7
|
+
--scope=readme-feature-coverage DEC-0074 README feature-coverage pair table.
|
|
8
|
+
--scope=downstream-ci-guard DEC-0075 downstream CI guard script pair table.
|
|
9
|
+
--scope=us-0092 DEC-0078 full-autonomy outer driver + probe surfaces.
|
|
10
|
+
--scope=us-0093 DEC-0079 browser UAT probe surfaces.
|
|
11
|
+
--scope=us-0095 DEC-0080 native in-chat auto-chain surfaces.
|
|
12
|
+
--scope=bug-0012 DEC-0081 native-chain compliance surfaces (BUG-0012).
|
|
13
|
+
--scope=us-0096 DEC-0082 delivery modes surfaces (US-0096).
|
|
14
|
+
--scope=project-readme DEC-0083 project README bootstrap surfaces (US-0097).
|
|
15
|
+
--scope=dev-environment DEC-0084 dev auto-launch profile surfaces (US-0098).
|
|
16
|
+
--scope=all union of all tables.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
import argparse
|
|
22
|
+
import sys
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
|
|
25
|
+
INTAKE_TEMPLATE_PAIRS: tuple[tuple[str, str], ...] = (
|
|
26
|
+
("scripts/intake_evidence_validate.py", "template/scripts/intake_evidence_validate.py"),
|
|
27
|
+
("scripts/intake_evidence_lib.py", "template/scripts/intake_evidence_lib.py"),
|
|
28
|
+
("scripts/intake_bug_routing_guard.py", "template/scripts/intake_bug_routing_guard.py"),
|
|
29
|
+
("scripts/intake_bug_resume_brief_refresh.py", "template/scripts/intake_bug_resume_brief_refresh.py"),
|
|
30
|
+
("scripts/check_intake_template_parity.py", "template/scripts/check_intake_template_parity.py"),
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# DEC-0073 §10 / US-0090 — Caveman input-compression surface pairs. Contents
|
|
34
|
+
# must be byte-identical between active and template paths; installer delivers
|
|
35
|
+
# template copies (BUG-0003 / DEC-0066).
|
|
36
|
+
CAVEMAN_COMPRESS_PAIRS: tuple[tuple[str, str], ...] = (
|
|
37
|
+
("scripts/caveman_compress_input.py", "template/scripts/caveman_compress_input.py"),
|
|
38
|
+
("docs/engineering/context/installer-owned-paths.manifest",
|
|
39
|
+
"template/docs/engineering/context/installer-owned-paths.manifest"),
|
|
40
|
+
("docs/engineering/runbook.md", "template/docs/engineering/runbook.md"),
|
|
41
|
+
("docs/engineering/auto-orchestration-reference.md",
|
|
42
|
+
"template/docs/engineering/auto-orchestration-reference.md"),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
README_FEATURE_COVERAGE_PAIRS: tuple[tuple[str, str], ...] = (
|
|
46
|
+
(
|
|
47
|
+
"scripts/validate_readme_feature_coverage.py",
|
|
48
|
+
"template/scripts/validate_readme_feature_coverage.py",
|
|
49
|
+
),
|
|
50
|
+
(
|
|
51
|
+
"scripts/readme_feature_coverage_lib.py",
|
|
52
|
+
"template/scripts/readme_feature_coverage_lib.py",
|
|
53
|
+
),
|
|
54
|
+
(
|
|
55
|
+
"docs/engineering/context/readme-section-affinity.json",
|
|
56
|
+
"template/docs/engineering/context/readme-section-affinity.json",
|
|
57
|
+
),
|
|
58
|
+
(".cursor/commands/release.md", "template/.cursor/commands/release.md"),
|
|
59
|
+
("docs/engineering/runbook.md", "template/docs/engineering/runbook.md"),
|
|
60
|
+
(
|
|
61
|
+
"docs/engineering/context/installer-owned-paths.manifest",
|
|
62
|
+
"template/docs/engineering/context/installer-owned-paths.manifest",
|
|
63
|
+
),
|
|
64
|
+
(
|
|
65
|
+
"scripts/check_intake_template_parity.py",
|
|
66
|
+
"template/scripts/check_intake_template_parity.py",
|
|
67
|
+
),
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
US0092_PAIRS: tuple[tuple[str, str], ...] = (
|
|
71
|
+
("scripts/auto_outer_driver.py", "template/scripts/auto_outer_driver.py"),
|
|
72
|
+
("scripts/uat_probe_lib.py", "template/scripts/uat_probe_lib.py"),
|
|
73
|
+
(
|
|
74
|
+
"docs/engineering/context/installer-owned-paths.manifest",
|
|
75
|
+
"template/docs/engineering/context/installer-owned-paths.manifest",
|
|
76
|
+
),
|
|
77
|
+
(".cursor/commands/auto.md", "template/.cursor/commands/auto.md"),
|
|
78
|
+
(".cursor/commands/verify-work.md", "template/.cursor/commands/verify-work.md"),
|
|
79
|
+
(".cursor/commands/qa.md", "template/.cursor/commands/qa.md"),
|
|
80
|
+
(
|
|
81
|
+
"docs/engineering/auto-orchestration-reference.md",
|
|
82
|
+
"template/docs/engineering/auto-orchestration-reference.md",
|
|
83
|
+
),
|
|
84
|
+
("docs/engineering/runbook.md", "template/docs/engineering/runbook.md"),
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
US0093_PAIRS: tuple[tuple[str, str], ...] = (
|
|
88
|
+
("scripts/uat_probe_lib.py", "template/scripts/uat_probe_lib.py"),
|
|
89
|
+
(".cursor/commands/verify-work.md", "template/.cursor/commands/verify-work.md"),
|
|
90
|
+
(".cursor/commands/qa.md", "template/.cursor/commands/qa.md"),
|
|
91
|
+
(".cursor/commands/execute.md", "template/.cursor/commands/execute.md"),
|
|
92
|
+
(
|
|
93
|
+
".cursor/scratchpad.local.example.md",
|
|
94
|
+
"template/.cursor/scratchpad.local.example.md",
|
|
95
|
+
),
|
|
96
|
+
("docs/engineering/runbook.md", "template/docs/engineering/runbook.md"),
|
|
97
|
+
(
|
|
98
|
+
"docs/engineering/auto-orchestration-reference.md",
|
|
99
|
+
"template/docs/engineering/auto-orchestration-reference.md",
|
|
100
|
+
),
|
|
101
|
+
(
|
|
102
|
+
"docs/engineering/context/installer-owned-paths.manifest",
|
|
103
|
+
"template/docs/engineering/context/installer-owned-paths.manifest",
|
|
104
|
+
),
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
US0095_PAIRS: tuple[tuple[str, str], ...] = (
|
|
108
|
+
(".cursor/commands/auto.md", "template/.cursor/commands/auto.md"),
|
|
109
|
+
(
|
|
110
|
+
"docs/engineering/auto-orchestration-reference.md",
|
|
111
|
+
"template/docs/engineering/auto-orchestration-reference.md",
|
|
112
|
+
),
|
|
113
|
+
("docs/engineering/runbook.md", "template/docs/engineering/runbook.md"),
|
|
114
|
+
("README.md", "template/README.md"),
|
|
115
|
+
(
|
|
116
|
+
"scripts/check_intake_template_parity.py",
|
|
117
|
+
"template/scripts/check_intake_template_parity.py",
|
|
118
|
+
),
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
BUG0012_PAIRS: tuple[tuple[str, str], ...] = (
|
|
122
|
+
(".cursor/commands/auto.md", "template/.cursor/commands/auto.md"),
|
|
123
|
+
(
|
|
124
|
+
"docs/engineering/auto-orchestration-reference.md",
|
|
125
|
+
"template/docs/engineering/auto-orchestration-reference.md",
|
|
126
|
+
),
|
|
127
|
+
("docs/engineering/runbook.md", "template/docs/engineering/runbook.md"),
|
|
128
|
+
(
|
|
129
|
+
"scripts/check_intake_template_parity.py",
|
|
130
|
+
"template/scripts/check_intake_template_parity.py",
|
|
131
|
+
),
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
US0096_PAIRS: tuple[tuple[str, str], ...] = (
|
|
135
|
+
(
|
|
136
|
+
".cursor/scratchpad.local.example.md",
|
|
137
|
+
"template/.cursor/scratchpad.local.example.md",
|
|
138
|
+
),
|
|
139
|
+
(".cursor/commands/auto.md", "template/.cursor/commands/auto.md"),
|
|
140
|
+
(
|
|
141
|
+
"docs/engineering/auto-orchestration-reference.md",
|
|
142
|
+
"template/docs/engineering/auto-orchestration-reference.md",
|
|
143
|
+
),
|
|
144
|
+
("docs/engineering/runbook.md", "template/docs/engineering/runbook.md"),
|
|
145
|
+
(".cursor/commands/quick.md", "template/.cursor/commands/quick.md"),
|
|
146
|
+
(
|
|
147
|
+
"scripts/check_intake_template_parity.py",
|
|
148
|
+
"template/scripts/check_intake_template_parity.py",
|
|
149
|
+
),
|
|
150
|
+
("scripts/pack_json_validate.py", "template/scripts/pack_json_validate.py"),
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
PROJECT_README_PAIRS: tuple[tuple[str, str], ...] = (
|
|
154
|
+
(
|
|
155
|
+
"scripts/validate_project_readme_coverage.py",
|
|
156
|
+
"template/scripts/validate_project_readme_coverage.py",
|
|
157
|
+
),
|
|
158
|
+
(
|
|
159
|
+
"scripts/project_readme_coverage_lib.py",
|
|
160
|
+
"template/scripts/project_readme_coverage_lib.py",
|
|
161
|
+
),
|
|
162
|
+
(".cursor/commands/execute.md", "template/.cursor/commands/execute.md"),
|
|
163
|
+
(".cursor/commands/release.md", "template/.cursor/commands/release.md"),
|
|
164
|
+
("docs/engineering/runbook.md", "template/docs/engineering/runbook.md"),
|
|
165
|
+
(
|
|
166
|
+
"docs/engineering/context/installer-owned-paths.manifest",
|
|
167
|
+
"template/docs/engineering/context/installer-owned-paths.manifest",
|
|
168
|
+
),
|
|
169
|
+
(
|
|
170
|
+
".cursor/scratchpad.local.example.md",
|
|
171
|
+
"template/.cursor/scratchpad.local.example.md",
|
|
172
|
+
),
|
|
173
|
+
(
|
|
174
|
+
"scripts/check_intake_template_parity.py",
|
|
175
|
+
"template/scripts/check_intake_template_parity.py",
|
|
176
|
+
),
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
DEV_ENVIRONMENT_PAIRS: tuple[tuple[str, str], ...] = (
|
|
180
|
+
(".cursor/commands/execute.md", "template/.cursor/commands/execute.md"),
|
|
181
|
+
(".cursor/scratchpad.md", "template/.cursor/scratchpad.md"),
|
|
182
|
+
(
|
|
183
|
+
".cursor/scratchpad.local.example.md",
|
|
184
|
+
"template/.cursor/scratchpad.local.example.md",
|
|
185
|
+
),
|
|
186
|
+
(
|
|
187
|
+
"template/.cursor/dev-environment.json.example",
|
|
188
|
+
"template/.cursor/dev-environment.json.example",
|
|
189
|
+
),
|
|
190
|
+
(
|
|
191
|
+
"scripts/dev_environment_lib.py",
|
|
192
|
+
"template/scripts/dev_environment_lib.py",
|
|
193
|
+
),
|
|
194
|
+
("docs/engineering/runbook.md", "template/docs/engineering/runbook.md"),
|
|
195
|
+
(
|
|
196
|
+
"docs/engineering/auto-orchestration-reference.md",
|
|
197
|
+
"template/docs/engineering/auto-orchestration-reference.md",
|
|
198
|
+
),
|
|
199
|
+
(
|
|
200
|
+
"scripts/check_intake_template_parity.py",
|
|
201
|
+
"template/scripts/check_intake_template_parity.py",
|
|
202
|
+
),
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
DOWNSTREAM_CI_GUARD_PAIRS: tuple[tuple[str, str], ...] = (
|
|
206
|
+
(
|
|
207
|
+
"scripts/check_downstream_ci_guard.py",
|
|
208
|
+
"template/scripts/check_downstream_ci_guard.py",
|
|
209
|
+
),
|
|
210
|
+
(
|
|
211
|
+
"scripts/downstream_ci_guard_lib.py",
|
|
212
|
+
"template/scripts/downstream_ci_guard_lib.py",
|
|
213
|
+
),
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
SCOPES: dict[str, tuple[tuple[str, str], ...]] = {
|
|
217
|
+
"intake": INTAKE_TEMPLATE_PAIRS,
|
|
218
|
+
"caveman-compress": CAVEMAN_COMPRESS_PAIRS,
|
|
219
|
+
"readme-feature-coverage": README_FEATURE_COVERAGE_PAIRS,
|
|
220
|
+
"downstream-ci-guard": DOWNSTREAM_CI_GUARD_PAIRS,
|
|
221
|
+
"us-0092": US0092_PAIRS,
|
|
222
|
+
"us-0093": US0093_PAIRS,
|
|
223
|
+
"us-0095": US0095_PAIRS,
|
|
224
|
+
"bug-0012": BUG0012_PAIRS,
|
|
225
|
+
"us-0096": US0096_PAIRS,
|
|
226
|
+
"project-readme": PROJECT_README_PAIRS,
|
|
227
|
+
"dev-environment": DEV_ENVIRONMENT_PAIRS,
|
|
228
|
+
"all": (
|
|
229
|
+
INTAKE_TEMPLATE_PAIRS
|
|
230
|
+
+ CAVEMAN_COMPRESS_PAIRS
|
|
231
|
+
+ README_FEATURE_COVERAGE_PAIRS
|
|
232
|
+
+ DOWNSTREAM_CI_GUARD_PAIRS
|
|
233
|
+
+ US0092_PAIRS
|
|
234
|
+
+ US0093_PAIRS
|
|
235
|
+
+ US0095_PAIRS
|
|
236
|
+
+ BUG0012_PAIRS
|
|
237
|
+
+ US0096_PAIRS
|
|
238
|
+
+ PROJECT_README_PAIRS
|
|
239
|
+
+ DEV_ENVIRONMENT_PAIRS
|
|
240
|
+
),
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def main() -> int:
|
|
245
|
+
p = argparse.ArgumentParser(description=__doc__)
|
|
246
|
+
p.add_argument(
|
|
247
|
+
"--repo",
|
|
248
|
+
type=Path,
|
|
249
|
+
default=Path(__file__).resolve().parent.parent,
|
|
250
|
+
help="Repository root",
|
|
251
|
+
)
|
|
252
|
+
p.add_argument(
|
|
253
|
+
"--scope",
|
|
254
|
+
choices=sorted(SCOPES.keys()),
|
|
255
|
+
default="intake",
|
|
256
|
+
help="Parity pair table to verify.",
|
|
257
|
+
)
|
|
258
|
+
args = p.parse_args()
|
|
259
|
+
root: Path = args.repo
|
|
260
|
+
pairs = SCOPES[args.scope]
|
|
261
|
+
failed = False
|
|
262
|
+
for rel_active, rel_tpl in pairs:
|
|
263
|
+
a = root / rel_active
|
|
264
|
+
t = root / rel_tpl
|
|
265
|
+
if not a.is_file() or not t.is_file():
|
|
266
|
+
print(f"[INTAKE_TEMPLATE_PARITY_ERROR] missing file: {rel_active} or {rel_tpl}")
|
|
267
|
+
failed = True
|
|
268
|
+
continue
|
|
269
|
+
ba = a.read_bytes()
|
|
270
|
+
bt = t.read_bytes()
|
|
271
|
+
if ba != bt:
|
|
272
|
+
print(
|
|
273
|
+
f"[INTAKE_TEMPLATE_PARITY_ERROR] mismatch: {rel_active} ({len(ba)}b) "
|
|
274
|
+
f"!= {rel_tpl} ({len(bt)}b)"
|
|
275
|
+
)
|
|
276
|
+
failed = True
|
|
277
|
+
if failed:
|
|
278
|
+
return 2
|
|
279
|
+
print(f"[INTAKE_TEMPLATE_PARITY_OK] scope={args.scope}")
|
|
280
|
+
return 0
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
if __name__ == "__main__":
|
|
284
|
+
sys.exit(main())
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Verify active vs template/ bytes match for DEC-0062 token-cost parity manifest paths."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import re
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
_PAIR_RE = re.compile(r"`([^`]+)`\s*→\s*`([^`]+)`")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def load_pairs(manifest_text: str) -> list[tuple[Path, Path]]:
|
|
15
|
+
pairs: list[tuple[Path, Path]] = []
|
|
16
|
+
for line in manifest_text.splitlines():
|
|
17
|
+
line = line.strip()
|
|
18
|
+
if not line.startswith("- "):
|
|
19
|
+
continue
|
|
20
|
+
m = _PAIR_RE.search(line)
|
|
21
|
+
if not m:
|
|
22
|
+
continue
|
|
23
|
+
pairs.append((Path(m.group(1)), Path(m.group(2))))
|
|
24
|
+
return pairs
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def main() -> int:
|
|
28
|
+
p = argparse.ArgumentParser(description=__doc__)
|
|
29
|
+
p.add_argument(
|
|
30
|
+
"--repo",
|
|
31
|
+
type=Path,
|
|
32
|
+
default=Path(__file__).resolve().parent.parent,
|
|
33
|
+
help="Repository root",
|
|
34
|
+
)
|
|
35
|
+
args = p.parse_args()
|
|
36
|
+
root: Path = args.repo
|
|
37
|
+
manifest = root / "docs/engineering/token-cost-parity-manifest.md"
|
|
38
|
+
if not manifest.is_file():
|
|
39
|
+
print(f"[TOKEN_COST_PARITY_ERROR] missing manifest: {manifest}")
|
|
40
|
+
return 2
|
|
41
|
+
text = manifest.read_text(encoding="utf-8")
|
|
42
|
+
pairs = load_pairs(text)
|
|
43
|
+
if not pairs:
|
|
44
|
+
print("[TOKEN_COST_PARITY_ERROR] no path pairs parsed from manifest")
|
|
45
|
+
return 2
|
|
46
|
+
failed = False
|
|
47
|
+
for rel_active, rel_tpl in pairs:
|
|
48
|
+
a = root / rel_active
|
|
49
|
+
t = root / rel_tpl
|
|
50
|
+
if not a.is_file() or not t.is_file():
|
|
51
|
+
print(f"[TOKEN_COST_PARITY_ERROR] missing file: {rel_active} or {rel_tpl}")
|
|
52
|
+
failed = True
|
|
53
|
+
continue
|
|
54
|
+
ba = a.read_bytes()
|
|
55
|
+
bt = t.read_bytes()
|
|
56
|
+
if ba != bt:
|
|
57
|
+
print(
|
|
58
|
+
f"[TOKEN_COST_PARITY_ERROR] mismatch: {rel_active} ({len(ba)}b) "
|
|
59
|
+
f"!= {rel_tpl} ({len(bt)}b)"
|
|
60
|
+
)
|
|
61
|
+
failed = True
|
|
62
|
+
if failed:
|
|
63
|
+
return 2
|
|
64
|
+
print("[TOKEN_COST_PARITY_OK]")
|
|
65
|
+
return 0
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
if __name__ == "__main__":
|
|
69
|
+
sys.exit(main())
|