hstack 0.1.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 (99) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/LICENSE +21 -0
  3. package/README.md +169 -0
  4. package/VERSION +1 -0
  5. package/dist/cli.js +55 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/doctor.js +155 -0
  8. package/dist/commands/doctor.js.map +1 -0
  9. package/dist/commands/init.js +87 -0
  10. package/dist/commands/init.js.map +1 -0
  11. package/dist/commands/update.js +118 -0
  12. package/dist/commands/update.js.map +1 -0
  13. package/dist/lib/diff.js +120 -0
  14. package/dist/lib/diff.js.map +1 -0
  15. package/dist/lib/git.js +26 -0
  16. package/dist/lib/git.js.map +1 -0
  17. package/dist/lib/paths.js +35 -0
  18. package/dist/lib/paths.js.map +1 -0
  19. package/dist/lib/wire.js +314 -0
  20. package/dist/lib/wire.js.map +1 -0
  21. package/dist/manifest.js +53 -0
  22. package/dist/manifest.js.map +1 -0
  23. package/package.json +54 -0
  24. package/template/.claude/agents/adversarial-reviewer.md +123 -0
  25. package/template/.claude/agents/data-specialist.md +126 -0
  26. package/template/.claude/agents/implementer.md +154 -0
  27. package/template/.claude/agents/planner.md +110 -0
  28. package/template/.claude/agents/product-manager.md +111 -0
  29. package/template/.claude/agents/researcher.md +123 -0
  30. package/template/.claude/agents/security-reviewer.md +123 -0
  31. package/template/.claude/agents/spec-author.md +118 -0
  32. package/template/.claude/agents/test-strategist.md +129 -0
  33. package/template/.claude/agents/ui-ux-briefer.md +105 -0
  34. package/template/.claude/agents/verifier.md +109 -0
  35. package/template/.claude/skills/hstack-adr-new/SKILL.md +118 -0
  36. package/template/.claude/skills/hstack-adversarial-review/SKILL.md +187 -0
  37. package/template/.claude/skills/hstack-branch/SKILL.md +103 -0
  38. package/template/.claude/skills/hstack-change-new/SKILL.md +109 -0
  39. package/template/.claude/skills/hstack-change-plan/SKILL.md +119 -0
  40. package/template/.claude/skills/hstack-commit/SKILL.md +122 -0
  41. package/template/.claude/skills/hstack-configure/SKILL.md +126 -0
  42. package/template/.claude/skills/hstack-data-review/SKILL.md +132 -0
  43. package/template/.claude/skills/hstack-finalize/SKILL.md +159 -0
  44. package/template/.claude/skills/hstack-help/SKILL.md +174 -0
  45. package/template/.claude/skills/hstack-implement/SKILL.md +185 -0
  46. package/template/.claude/skills/hstack-init/SKILL.md +152 -0
  47. package/template/.claude/skills/hstack-module-spec/SKILL.md +105 -0
  48. package/template/.claude/skills/hstack-research/SKILL.md +145 -0
  49. package/template/.claude/skills/hstack-security-review/SKILL.md +133 -0
  50. package/template/.claude/skills/hstack-ship/SKILL.md +128 -0
  51. package/template/.claude/skills/hstack-story-draft/SKILL.md +117 -0
  52. package/template/.claude/skills/hstack-tech-debt-new/SKILL.md +122 -0
  53. package/template/.claude/skills/hstack-tech-debt-resolve/SKILL.md +158 -0
  54. package/template/.claude/skills/hstack-tech-debt-stale/SKILL.md +113 -0
  55. package/template/.claude/skills/hstack-tech-debt-wontfix/SKILL.md +104 -0
  56. package/template/.claude/skills/hstack-telemetry/SKILL.md +96 -0
  57. package/template/.claude/skills/hstack-test-plan/SKILL.md +182 -0
  58. package/template/.claude/skills/hstack-ui-brief/SKILL.md +108 -0
  59. package/template/.claude/skills/hstack-verify/SKILL.md +139 -0
  60. package/template/CLAUDE.md +390 -0
  61. package/template/scripts/telemetry/__init__.py +6 -0
  62. package/template/scripts/telemetry/insights/__init__.py +0 -0
  63. package/template/scripts/telemetry/insights/contract_drift.py +137 -0
  64. package/template/scripts/telemetry/insights/overengineering.py +115 -0
  65. package/template/scripts/telemetry/insights/quality_outcomes.py +131 -0
  66. package/template/scripts/telemetry/insights/token_economics.py +129 -0
  67. package/template/scripts/telemetry/insights/workflow_shape.py +198 -0
  68. package/template/scripts/telemetry/parsers/__init__.py +0 -0
  69. package/template/scripts/telemetry/parsers/bodies.py +87 -0
  70. package/template/scripts/telemetry/parsers/commits.py +219 -0
  71. package/template/scripts/telemetry/parsers/frontmatter.py +322 -0
  72. package/template/scripts/telemetry/parsers/transcripts.py +181 -0
  73. package/template/scripts/telemetry/render.py +311 -0
  74. package/template/scripts/telemetry/report.py +112 -0
  75. package/template/templates/adr.md +38 -0
  76. package/template/templates/adversarial-review.md +54 -0
  77. package/template/templates/change-spec.md +80 -0
  78. package/template/templates/ci-cd.md +27 -0
  79. package/template/templates/data-architecture.md +35 -0
  80. package/template/templates/data-review.md +54 -0
  81. package/template/templates/figma-handoff.md +38 -0
  82. package/template/templates/glossary.md +20 -0
  83. package/template/templates/hardening-checklist.md +73 -0
  84. package/template/templates/incident-runbook.md +57 -0
  85. package/template/templates/infrastructure.md +190 -0
  86. package/template/templates/module-spec.md +49 -0
  87. package/template/templates/mvp-scope.md +34 -0
  88. package/template/templates/persona.md +38 -0
  89. package/template/templates/plan.md +49 -0
  90. package/template/templates/security-review.md +63 -0
  91. package/template/templates/story.md +37 -0
  92. package/template/templates/tech-debt.md +61 -0
  93. package/template/templates/tech-stack.md +41 -0
  94. package/template/templates/telemetry-sidecar.md +184 -0
  95. package/template/templates/test-plan.md +119 -0
  96. package/template/templates/threat-model.md +54 -0
  97. package/template/templates/ui-brief.md +49 -0
  98. package/template/templates/verification.md +63 -0
  99. package/template/templates/vision.md +34 -0
@@ -0,0 +1,34 @@
1
+ ---
2
+ id: mvp-scope
3
+ type: mvp-scope
4
+ status: drafted # drafted | current | needs-refresh | archived
5
+ owner: <git-handle>
6
+ mvp-target-date: <YYYY-MM-DD>
7
+ created: <YYYY-MM-DD>
8
+ updated: <YYYY-MM-DD>
9
+ schema-version: 1
10
+ ---
11
+
12
+ ## In MVP
13
+
14
+ _Bullets. One feature or story per line. Each entry must be either a story id or a feature-cluster name (validator rule MS-01)._
15
+
16
+ -
17
+
18
+ ## v2
19
+
20
+ _The next-up list. Bullets._
21
+
22
+ -
23
+
24
+ ## Deferred
25
+
26
+ _Things we decided not to do yet, with the reason. Bullets._
27
+
28
+ -
29
+
30
+ ## MVP success criteria
31
+
32
+ _Concrete observable indicators that we are out of MVP. Bullets._
33
+
34
+ -
@@ -0,0 +1,38 @@
1
+ ---
2
+ id: persona-<slug>
3
+ type: persona
4
+ status: drafted # drafted | current | needs-refresh | archived
5
+ owner: <git-handle>
6
+ anchored-on: <design-partner-slug>
7
+ created: <YYYY-MM-DD>
8
+ updated: <YYYY-MM-DD>
9
+ schema-version: 1
10
+ ---
11
+
12
+ ## Role
13
+
14
+ _Title and seniority._
15
+
16
+ ## Context
17
+
18
+ _Tools they use today. Team size. KPI they are measured against._
19
+
20
+ ## Jobs-to-be-done
21
+
22
+ _Bullets._
23
+
24
+ -
25
+
26
+ ## Edge constraints
27
+
28
+ _Anything unusual: compliance, time zone, locale, accessibility, device class._
29
+
30
+ -
31
+
32
+ ## Anti-pattern
33
+
34
+ _What this persona explicitly is not. Helps prevent persona drift on future stories._
35
+
36
+ ## Anchored design partner
37
+
38
+ _Name and contact rhythm. Private — keep this section out of any export. When persona store is in repo, the file housing this section should be in `.gitignore` (see hstack/config.yaml personas-location)._
@@ -0,0 +1,49 @@
1
+ ---
2
+ id: <parent-change-id>-plan
3
+ type: plan
4
+ status: draft # draft | ready | in-progress | completed | archived
5
+ owner: <git-handle>
6
+ parent-change: <change-spec-id>
7
+ steps-completed: [] # populated by `implementer` as phases finish
8
+ blocked-on: null # phase id when an interactive blocker stops progress
9
+ oversized-plan-justification: null # required when phase count > 12
10
+ created: <YYYY-MM-DD>
11
+ updated: <YYYY-MM-DD>
12
+ schema-version: 1
13
+ ---
14
+
15
+ ## Phase Overview
16
+
17
+ _Table of phases. Three columns max._
18
+
19
+ | step-id | summary | depends-on |
20
+ | --- | --- | --- |
21
+ | phase-1- | | none |
22
+
23
+ ## Per-Phase Detail
24
+
25
+ _One subsection per phase. 4–8 phases typical. >12 requires `oversized-plan-justification` in frontmatter._
26
+
27
+ ### phase-1-
28
+
29
+ **Purpose.** _One sentence._
30
+
31
+ **Files Touched.** _Subset of `change-spec.in-scope`. Bullets._
32
+
33
+ -
34
+
35
+ **Test Strategy.** _Pointer to the test-plan section(s) this phase satisfies. Format: `test-plan §<section> — <one-line summary>`. The phase lands the tests named in the referenced section; do not restate or invent tests here. If this phase's work is exclusively non-test (e.g., a migration whose tests live in a later phase), state that explicitly and name the downstream phase that closes the loop._
36
+
37
+ **Risk.** _One sentence on what could go wrong locally._
38
+
39
+ **Verifier Expectations.** _What `verifier` must observe to mark this phase passed. References both this plan's Test Strategy and the test-plan sections the phase satisfies._
40
+
41
+ ## Cross-Phase Risks
42
+
43
+ _Challenge prompt: what could go wrong across phase boundaries that no single phase catches? 1–3 bullets._
44
+
45
+ -
46
+
47
+ ## Rollback
48
+
49
+ _What to do if a partial rollout in production breaks something. 2–4 sentences._
@@ -0,0 +1,63 @@
1
+ ---
2
+ id: <parent-change-id>-security-review
3
+ type: security-review
4
+ status: draft # draft | in-progress | passed | concerns-acknowledged | failed | superseded
5
+ owner: <git-handle>
6
+ parent-change: <change-spec-id>
7
+ scoring-mode: llm-scored # v1; v2 introduces 'executed'
8
+ scores:
9
+ data-at-rest: not-applicable # pass | concerns | fail | not-applicable
10
+ data-in-transit: not-applicable
11
+ authn: not-applicable
12
+ authz-rls: not-applicable
13
+ tenant-isolation: not-applicable
14
+ input-validation: not-applicable
15
+ output-encoding: not-applicable
16
+ secrets-handling: not-applicable
17
+ agent-prompt-injection: not-applicable
18
+ audit-logging: not-applicable
19
+ concerns-acknowledged-by: null # handle required when any score is `concerns`
20
+ threat-model-delta-required: false # true when surfaces touches agent | auth | api | db
21
+ challenge-prompts-answered: 0 # must equal 3 to pass
22
+ created: <YYYY-MM-DD>
23
+ updated: <YYYY-MM-DD>
24
+ schema-version: 1
25
+ ---
26
+
27
+ ## Surfaces Touched
28
+
29
+ _Pointer to change-spec `surfaces`. One sentence per surface._
30
+
31
+ ## Hardening Items Scored
32
+
33
+ _For every applicable checklist item, a one-paragraph rationale for the score. Bias toward CONCERNS rather than PASS when evidence is thin._
34
+
35
+ ### data-at-rest
36
+
37
+ ### data-in-transit
38
+
39
+ ### authz-rls
40
+
41
+ ### tenant-isolation
42
+
43
+ ### input-validation
44
+
45
+ ### audit-logging
46
+
47
+ ## Threat-Model Delta
48
+
49
+ _Required when `threat-model-delta-required: true`. One paragraph delta against the current threat-model.md. Refuse to score until this is non-empty when surfaces require it._
50
+
51
+ ## Challenge Prompts
52
+
53
+ _All three required. Each answer must be at least one paragraph._
54
+
55
+ ### (a) What attack vector did the In-Scope diff create that is NOT covered by the hardening checklist? If none, justify.
56
+
57
+ ### (b) Which tenant_isolation guarantee does this change depend on? Cite the line of code that enforces it.
58
+
59
+ ### (c) What part of this change would behave incorrectly under a malicious payload that the test suite does not cover?
60
+
61
+ ## Open Concerns
62
+
63
+ _When any score is `concerns`: what acknowledgement is required and by whom. Ack must be human-confirmed by `owner` before status: concerns-acknowledged._
@@ -0,0 +1,37 @@
1
+ ---
2
+ id: <STORE>:<store-native-id> # one of NOTION:<id> | LINEAR:<key> | GH:<num> | REPO:<slug>
3
+ type: story
4
+ status: drafted # drafted | ready | in-flight | shipped | archived
5
+ owner: <git-handle>
6
+ persona: <persona-id> # single persona id
7
+ job-to-be-done: <one-sentence summary; mirrors section 1>
8
+ success-metric: <how shipping is measured>
9
+ linked-change-specs: [] # required non-empty when status: in-flight
10
+ created: <YYYY-MM-DD>
11
+ updated: <YYYY-MM-DD>
12
+ schema-version: 1
13
+ ---
14
+
15
+ ## Who and Why
16
+
17
+ _Persona id (pointer, not duplicated) and the job-to-be-done. 1–2 sentences._
18
+
19
+ ## What Shipping Looks Like
20
+
21
+ _What the user sees, does, feels. One paragraph, 3–5 sentences._
22
+
23
+ ## Success Metric
24
+
25
+ _Pointer to the `success-metric` frontmatter field with a one-sentence explanation of how it is measured._
26
+
27
+ ## Edge Cases the User Cares About
28
+
29
+ _Challenge prompt: what does the user notice if this ships but is slightly broken? 2–5 bullets._
30
+
31
+ -
32
+
33
+ ## Out of Scope for This Story
34
+
35
+ _Adjacent functionality this story does not cover. 2–3 bullets._
36
+
37
+ -
@@ -0,0 +1,61 @@
1
+ ---
2
+ id: TD-<NNNN>-<slug>
3
+ type: tech-debt
4
+ status: open # open | in-progress | resolved | wontfix | stale-no-longer-reproducible | archived
5
+ owner: <git-handle>
6
+ severity: low # critical | high | medium | low
7
+ origin: <change-spec-id-or-found-later>
8
+ introduced-by: <change-spec-id> # required when origin is a change-spec; reciprocal with change-spec.creates-tech-debt
9
+ cost: small # small | medium | large
10
+ fix-sketch-effort: small
11
+ related-modules: []
12
+ target-resolve-by: null # required when severity: critical
13
+ resolution-attempted-at: null # ISO date set when status flips open -> in-progress (resolution begun)
14
+ resolved-by: null # change-spec id that resolved this debt; reciprocal with change-spec.resolves-tech-debt; required when status: resolved
15
+ wontfix-reason: null # one-sentence reason; required when status: wontfix
16
+ wontfix-accepted-alternative: null # one-sentence note on what we are accepting instead; required when status: wontfix
17
+ stale-verified-at: null # ISO date the absence of the original claim was verified; required when status: stale-no-longer-reproducible
18
+ stale-verification-method: null # one-sentence prose evidence; required when status: stale-no-longer-reproducible
19
+ created: <YYYY-MM-DD>
20
+ updated: <YYYY-MM-DD>
21
+ schema-version: 1
22
+ ---
23
+
24
+ ## Title
25
+
26
+ _Short noun phrase._
27
+
28
+ ## Why we took the shortcut
29
+
30
+ _One or two sentences._
31
+
32
+ ## What it costs us
33
+
34
+ _Observable cost today, projected cost at scale._
35
+
36
+ ## Fix sketch
37
+
38
+ _What fixing would look like — code shape, scope, side effects._
39
+
40
+ ## Pre-conditions for fixing
41
+
42
+ _What must be true first (other dependencies resolved, design tokens normalized, etc.)._
43
+
44
+ ## Acceptance
45
+
46
+ _What "resolved" looks like — observable, verifiable bullets the adversarial-reviewer can check against the resolving change's diff. The resolving change-spec's Target Behavior must satisfy these bullets verbatim or as a superset. Once `status: resolved`, no field rewrites are permitted (TD-03)._
47
+
48
+ ## Resolution Log
49
+
50
+ _Populated by `spec-author` as the resolution progresses. Section is empty until the first transition out of `open`._
51
+
52
+ - `status: open → in-progress` on `<resolution-attempted-at>` by `<owner>`. Triggered by `/hstack:tech-debt-resolve <id>`. Resolving change-spec scaffolded at `<change-spec-id>`.
53
+ - `status: in-progress → resolved` on `<date>` by `<owner>`. Resolving change-spec: `<change-spec-id>`. Adversarial-review Acceptance-satisfied confirmation: `<adversarial-review-id>`.
54
+
55
+ _Alternatively, for the wontfix path:_
56
+
57
+ - `status: open → wontfix` on `<date>` by `<owner>`. Reason: `<wontfix-reason>`. Accepted alternative: `<wontfix-accepted-alternative>`.
58
+
59
+ _Alternatively, for the stale-no-longer-reproducible path (the claim aged out before anyone resolved it):_
60
+
61
+ - `status: open → stale-no-longer-reproducible` on `<stale-verified-at>` by `<owner>`. Verification method: `<stale-verification-method>`.
@@ -0,0 +1,41 @@
1
+ ---
2
+ id: tech-stack
3
+ type: tech-stack
4
+ status: drafted # drafted | current | needs-refresh | archived
5
+ owner: <git-handle>
6
+ created: <YYYY-MM-DD>
7
+ updated: <YYYY-MM-DD>
8
+ schema-version: 1
9
+ ---
10
+
11
+ _Each entry below: name, version pin, why. Validator rule TS-01: every named dependency must be present in package.json at the pinned version._
12
+
13
+ ## Application
14
+
15
+ _Framework, runtime, language._
16
+
17
+ -
18
+
19
+ ## Data
20
+
21
+ _Primary store, caches, vector store._
22
+
23
+ -
24
+
25
+ ## AI
26
+
27
+ _LLM providers, embedding providers, orchestration libs._
28
+
29
+ -
30
+
31
+ ## Integrations
32
+
33
+ _Third-party platforms and the protocol layer (OAuth via Pipedream, webhook handlers)._
34
+
35
+ -
36
+
37
+ ## Operations
38
+
39
+ _CI, hosting, observability, error tracking._
40
+
41
+ -
@@ -0,0 +1,184 @@
1
+ # Telemetry sidecar — schema and discipline
2
+
3
+ This document describes the JSON sidecar files three hstack Skills emit alongside their canonical artifact writes, to make per-change telemetry attribution cheap. Sidecars are **derivative** of git + frontmatter — re-runnable from source, never authoritative. The kernel's "no parallel tracker" rule is preserved by this derivative property.
4
+
5
+ ## Where sidecars live
6
+
7
+ ```
8
+ hstack/specs/changes/<change-id>/.telemetry/
9
+ test-plan.json # one per test-plan terminal status
10
+ implement-<phase-id>.json # one per implement phase
11
+ verify.json # one per verify pass
12
+ adversarial-review.json # one per adversarial-review terminal status
13
+ finalize.json # one per ship
14
+ ```
15
+
16
+ The `.telemetry/` directory is **git-ignored** at the consuming-repo level. Sidecars are transient; the canonical truth lives in the artifact frontmatter and git history.
17
+
18
+ ## When sidecars are written
19
+
20
+ | Skill | Trigger | File |
21
+ | --- | --- | --- |
22
+ | `hstack-test-plan` | At the test-plan terminal-status commit (`passed` or `concerns-acknowledged`) | `test-plan.json` |
23
+ | `hstack-implement` | At each phase-completion auto-commit (the same `git add && git commit` that lands `plan.steps-completed`) | `implement-<phase-id>.json` |
24
+ | `hstack-verify` | At the change-spec advance commit when `verification.md` lands at `status: passed` (per ADR-0002); on `ran`/`failed`, piggybacks on the verification status commit | `verify.json` |
25
+ | `hstack-adversarial-review` | At the change-spec advance commit when `adversarial-review.md` lands at `findings-resolved` (per ADR-0002 follow-up); on `findings-open`/`in-progress`, piggybacks on the transition commit | `adversarial-review.json` |
26
+ | `hstack-finalize` | At the change-spec advance commit when status moves `ready-to-ship → shipped` | `finalize.json` |
27
+
28
+ The other 22 Skills do **not** emit sidecars in v1. Their data is reconstructible from git + frontmatter + transcripts; the five emissions above target the highest-signal events across the change lifecycle: test discipline up front (`test-plan`), per-phase scope-locked execution (`implement`), promised-vs-observed (`verify`), gate-firing critique (`adversarial-review`), lifecycle close (`finalize`).
29
+
30
+ ## Schema — `test-plan.json`
31
+
32
+ ```json
33
+ {
34
+ "schema_version": 1,
35
+ "skill": "hstack-test-plan",
36
+ "change_id": "2026-05-billing-overage-warning",
37
+ "completed_at": "2026-05-22T11:14:00Z",
38
+ "status": "passed",
39
+ "coverage_layers": {"unit": "addressed", "integration": "addressed", "e2e": "not-applicable"},
40
+ "tenant_isolation_tests_count": 0,
41
+ "tenant_isolation_required": false,
42
+ "performance_budgets_required": false,
43
+ "performance_budgets_count": 0,
44
+ "challenge_prompts_answered": 3,
45
+ "invariants_mapped_count": 4,
46
+ "invariants_declared_count": 4,
47
+ "edge_cases_count": 5,
48
+ "test_files_named_count": 7,
49
+ "fixture_strategy_declared": true,
50
+ "halt_reasons": []
51
+ }
52
+ ```
53
+
54
+ Field rules:
55
+
56
+ - `tenant_isolation_tests_count` paired with `tenant_isolation_required` is the rubber-stamp tell. `required: true` with `count: 0` at terminal status is a TS-03 contract violation that should have halted the Skill — its presence in a `passed` sidecar is a high-severity signal.
57
+ - `challenge_prompts_answered` must be exactly `3` for `passed`. Lower values at `passed` indicate either a validator gap or a Skill bypass.
58
+ - `invariants_mapped_count` lower than `invariants_declared_count` at `passed` is a TS-06 violation. Same signal-handling as above.
59
+
60
+ ## Schema — `implement-<phase-id>.json`
61
+
62
+ ```json
63
+ {
64
+ "schema_version": 1,
65
+ "skill": "hstack-implement",
66
+ "change_id": "2026-05-billing-overage-warning",
67
+ "phase_id": "phase-3-component",
68
+ "started_at": "2026-05-22T14:00:00Z",
69
+ "completed_at": "2026-05-22T14:18:42Z",
70
+ "files_touched_count": 4,
71
+ "tests_written_count": 2,
72
+ "scope_amendment_emitted": false,
73
+ "halt_reasons": [],
74
+ "test_immutability_authorizations": []
75
+ }
76
+ ```
77
+
78
+ Field rules:
79
+
80
+ - `started_at`, `completed_at` — ISO-8601. The implementer records them from session timestamps.
81
+ - `files_touched_count` — count of distinct files modified by the phase's commit. Computed mechanically; not a judgment.
82
+ - `tests_written_count` — count of test files newly created in the phase (kernel test-immutability rule allows new tests without authorization).
83
+ - `scope_amendment_emitted` — `true` only when the implementer halted and surfaced a scope-amendment request during this phase.
84
+ - `halt_reasons` — array of enum values from the kernel halt sentinel (see CLAUDE.md § Halt sentinel).
85
+ - `test_immutability_authorizations` — array of canonical authorization phrases echoed during this phase (e.g., `"Ok to change test foo"`).
86
+
87
+ ## Schema — `verify.json`
88
+
89
+ ```json
90
+ {
91
+ "schema_version": 1,
92
+ "skill": "hstack-verify",
93
+ "change_id": "2026-05-billing-overage-warning",
94
+ "ran_at": "2026-05-22T15:32:00Z",
95
+ "test_suite_runtime_s": 187.4,
96
+ "phase_coverage": {"phase-1-types": "pass", "phase-2-component": "pass"},
97
+ "test_plan_coverage": {
98
+ "edge-cases": "all-observed",
99
+ "tenant-isolation": "not-applicable",
100
+ "performance-budgets": "not-applicable"
101
+ },
102
+ "discrepancies_count": 0,
103
+ "status": "passed"
104
+ }
105
+ ```
106
+
107
+ Field rules:
108
+
109
+ - `test_suite_runtime_s` — float seconds. Wall-clock elapsed across all canonical commands.
110
+ - `phase_coverage`, `test_plan_coverage` — mirror `verification.md` frontmatter for cheap downstream parsing. When verification fails, the sidecar still lands at the corresponding `ran` or `failed` status; the canonical artifact is the source of truth for any discrepancy.
111
+ - `discrepancies_count` — count of bullet points under `verification.md § Discrepancies`. A non-zero value should always pair with a non-empty Discrepancies section in the canonical artifact.
112
+
113
+ ## Schema — `adversarial-review.json`
114
+
115
+ ```json
116
+ {
117
+ "schema_version": 1,
118
+ "skill": "hstack-adversarial-review",
119
+ "change_id": "2026-05-billing-overage-warning",
120
+ "reviewed_at": "2026-05-22T16:42:00Z",
121
+ "findings_floor": 5,
122
+ "findings_count": 6,
123
+ "findings_fewer_than_floor": false,
124
+ "category_counts": {
125
+ "security": 1,
126
+ "scope-drift": 0,
127
+ "invariant-breach": 1,
128
+ "spec-compliance": 2,
129
+ "data-integrity": 1,
130
+ "code-quality": 1
131
+ },
132
+ "severity_counts": {"critical": 0, "high": 1, "medium": 3, "low": 2},
133
+ "resolution_mix": {"commit": 4, "tech-debt": 1, "justified-in-prose": 1},
134
+ "fresh_session_attestation": "session abc-123; opened 2026-05-22T16:40Z; no implementer transcripts loaded",
135
+ "halt_reasons": []
136
+ }
137
+ ```
138
+
139
+ Field rules:
140
+
141
+ - `findings_floor` is `3` by default, `5` when `change-spec.area` is in `{agent, auth, billing}` per AR-06.
142
+ - `findings_count` < `findings_floor` is permitted only when `findings_fewer_than_floor: true` (with a defended justification in the canonical artifact's Findings Floor Justification section). Aggregating across changes: a rising `findings_fewer_than_floor: true` rate means either the floors are wrong or the reviewer is gaming the escape hatch.
143
+ - `category_counts` clustering — e.g., 5 of 5 findings in `code-quality` — is the quota-gaming smell the kernel's "spread findings across categories" guidance is designed to detect. The telemetry layer surfaces it via OE-7.
144
+ - `severity_counts.high + critical` paired with `resolution_mix.justified-in-prose > 0` is a high-severity-in-prose smell flagged by QO-2. The Skill's stop condition should have caught it before terminal status; sidecar presence indicates a bypass.
145
+
146
+ ## Schema — `finalize.json`
147
+
148
+ ```json
149
+ {
150
+ "schema_version": 1,
151
+ "skill": "hstack-finalize",
152
+ "change_id": "2026-05-billing-overage-warning",
153
+ "shipped_at": "2026-05-23T10:14:00Z",
154
+ "merge_commit_sha": "abc1234567890",
155
+ "change_duration_days": 4,
156
+ "tds_resolved": ["TD-0042-overage-banner-tailwind-class"]
157
+ }
158
+ ```
159
+
160
+ Field rules:
161
+
162
+ - `merge_commit_sha` — full SHA of the merge commit on the default branch.
163
+ - `change_duration_days` — integer days from `change-spec.created` to the merge commit's author date.
164
+ - `tds_resolved` — list of TD ids; mirrors `change-spec.resolves-tech-debt`. Empty array on changes that resolve no debt.
165
+
166
+ ## Discipline preserved
167
+
168
+ Per the kernel § Mechanical operations § Discipline preserved:
169
+
170
+ - **Atomic with the canonical commit.** Each sidecar is written and `git add`-ed in the same commit as the canonical artifact write. No separate commit. The sidecar piggybacks on a commit that was happening anyway — zero new LLM turns, zero new confirmation gates.
171
+ - **Idempotency.** Re-running a Skill on a phase that already landed produces a no-op on the sidecar (file already present, content unchanged aside from `schema_version` bumps if any).
172
+ - **Derivative property.** Every value in every sidecar is reconstructible from git + frontmatter + transcripts. The sidecar is a cache, not a source. Deleting a sidecar is harmless — the next `/hstack:telemetry` run will compute the same metrics from the slower path.
173
+ - **Schema versioning.** `schema_version: 1` in v1. Bumping to `2` requires either a backward-compatible additive change (new optional field) or a migration in `scripts/telemetry/parsers/`.
174
+
175
+ ## What sidecars are NOT
176
+
177
+ - Not authoritative. The artifact frontmatter and git history are. If a sidecar disagrees with the artifact, the artifact wins.
178
+ - Not an audit trail. The kernel reserves "agent-ledger" naming for the v2 substrate when it ships with cryptographic guarantees.
179
+ - Not blocking. A sidecar write failure is logged but does not block the canonical commit.
180
+ - Not a parallel tracker. The kernel forbids parallel trackers; sidecars survive that rule only because they are derivative.
181
+
182
+ ## Adding sidecar emission to a new Skill
183
+
184
+ The v1 emission list is fixed at five Skills (`test-plan`, `implement`, `verify`, `adversarial-review`, `finalize`). Adding a sixth is a follow-up change-spec, not a unilateral Skill edit. The cost-benefit threshold: a Skill is sidecar-eligible when its terminal event is per-change (not per-session), the data the sidecar would carry is non-trivial to reconstruct from git alone, and the Skill already auto-commits at the terminal event (no new commit needed). The "tier 2" candidates already evaluated and held back are `hstack-security-review` and `hstack-data-review`; both pass the criteria but their data is already first-class in frontmatter, so the sidecar's only value is parse-cost reduction. Promote them when WS-2 body parsing becomes a felt bottleneck.
@@ -0,0 +1,119 @@
1
+ ---
2
+ id: <parent-change-id>-test-plan
3
+ type: test-plan
4
+ status: draft # draft | in-progress | passed | concerns-acknowledged | failed | superseded
5
+ owner: <git-handle>
6
+ parent-change: <change-spec-id>
7
+ scoring-mode: llm-strategized # v1; v2 introduces 'executed' once mutation/coverage tooling is wired
8
+ coverage-layers:
9
+ unit: not-applicable # addressed | partial | not-applicable
10
+ integration: not-applicable
11
+ e2e: not-applicable
12
+ tenant-isolation-tests: [] # required non-empty when surfaces includes db | api | agent
13
+ fixture-strategy-declared: false # must be true before status: passed
14
+ performance-budgets-required: false # true when change touches hot paths or high-traffic surfaces
15
+ challenge-prompts-answered: 0 # must equal 3
16
+ concerns-acknowledged-by: null # handle required when any coverage layer is `partial` and deferred
17
+ invariants-mapped: [] # change-spec invariant ids that have a mapped test in this plan
18
+ created: <YYYY-MM-DD>
19
+ updated: <YYYY-MM-DD>
20
+ schema-version: 1
21
+ ---
22
+
23
+ ## Surfaces and Risk Profile
24
+
25
+ _Pointer to change-spec `surfaces`. One sentence per surface naming the dominant test-risk layer it adds (e.g., "ui — interaction state regressions; db — RLS bypass risk on new table")._
26
+
27
+ ## Test Pyramid
28
+
29
+ _Per-layer decisions: which behaviors land at which layer and why. Bias toward integration over end-to-end for behavior coverage; bias toward unit for pure functions and reducers. Name the test files that will exist; estimate count roughly. If a layer is `not-applicable`, justify in one sentence._
30
+
31
+ ### unit
32
+
33
+ **Coverage status.** _addressed | partial | not-applicable._
34
+
35
+ **Files.** _Test files in scope (relative paths)._
36
+
37
+ -
38
+
39
+ **What's covered.** _Behaviors validated at this layer. 2–4 bullets._
40
+
41
+ -
42
+
43
+ **Rationale.** _Why this layer is the right home for these behaviors._
44
+
45
+ ### integration
46
+
47
+ **Coverage status.**
48
+
49
+ **Files.**
50
+
51
+ -
52
+
53
+ **What's covered.**
54
+
55
+ -
56
+
57
+ **Rationale.**
58
+
59
+ ### e2e
60
+
61
+ **Coverage status.**
62
+
63
+ **Files.**
64
+
65
+ -
66
+
67
+ **What's covered.**
68
+
69
+ -
70
+
71
+ **Rationale.**
72
+
73
+ ## Edge Cases
74
+
75
+ _Enumerate the edge cases the change must handle, and name the test that catches each. Bias toward cases the change-spec's Target Behavior does not explicitly name — empty inputs, max-length inputs, concurrent writes, partial failure, retries, idempotency, time-zone boundaries, off-by-one on pagination, NULL vs empty-string, locale-sensitive formatting. Minimum three bullets unless the change is genuinely trivial. Format: `case → test file::test name`._
76
+
77
+ -
78
+ -
79
+ -
80
+
81
+ ## Tenant Isolation Tests
82
+
83
+ _Required non-empty section when `surfaces` includes `db`, `api`, or `agent`. For every new RLS-protected table, new tenant-scoped RPC, new tool boundary, or new cross-tenant data path: name an explicit negative test that proves cross-tenant reads/writes are refused. The change-spec's `tenant_isolation` invariants must each map to at least one test here. Format: `surface → test file::test name → what it proves`._
84
+
85
+ -
86
+
87
+ ## Test Data and Fixture Strategy
88
+
89
+ _Required section. How test data is seeded, what factories or fixtures are reused, how tests are isolated from each other, and how multi-tenant data is partitioned in test runs. Name the factory module or fixture file. State whether tests share a database between runs (transactional rollback per test, full reset per suite, in-memory mock) and why._
90
+
91
+ **Seed strategy.**
92
+
93
+ **Factory / fixture module.**
94
+
95
+ **Isolation between tests.**
96
+
97
+ **Multi-tenant partitioning.**
98
+
99
+ ## Performance and Regression Budgets
100
+
101
+ _Required when `performance-budgets-required: true`. For each hot path the change touches, declare a numeric budget (p50/p95 latency, throughput, payload size, query count) and the test that asserts the budget. Budgets without an asserting test are not budgets; they are wishes._
102
+
103
+ | path | budget | asserting test |
104
+ | --- | --- | --- |
105
+ | | | |
106
+
107
+ ## Challenge Prompts
108
+
109
+ _All three required. Each answer must be at least one paragraph. These exist because the v1 mitigation for "humans miss what's missing" is to force the strategist to name gaps the planner and the implementer will not._
110
+
111
+ ### (a) What behavior in this change would silently pass the test suite but break in production? Name the test that would catch it, or declare that no such test is planned and justify.
112
+
113
+ ### (b) Which invariant from the change-spec has no corresponding negative or regression test? If every invariant has a mapped test, cite the test for each invariant by id.
114
+
115
+ ### (c) What concurrent, multi-tenant, or failure-mode scenario is not exercised by the planned tests? If none is plausibly relevant, justify why this change has no such scenario.
116
+
117
+ ## Open Concerns
118
+
119
+ _When any coverage layer is `partial` and being deferred rather than addressed: enumerate what is uncovered, why it is acceptable to defer, who is acknowledging, and what tech-debt id captures the deferral. Ack must be human-confirmed by `owner` before status: concerns-acknowledged. Empty when every layer is `addressed` or `not-applicable`._