hstack 0.2.0 → 0.4.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.
@@ -0,0 +1,63 @@
1
+ ---
2
+ id: KF-<NNNN>-<slug>
3
+ type: kernel-fit-finding
4
+ status: open # open | acknowledged | dismissed | promoted | superseded | archived
5
+ owner: null # git-handle of the triager; null until first triage
6
+ pattern: <KF-P1 | KF-P2 | KF-P3 | …> # detector pattern that fired; enumerated in scripts/telemetry/insights/kernel_fit.py
7
+ confidence: medium # high | medium | low
8
+ detected-by: kernel-fit-analyst
9
+ detected-via: detector # detector | flag — `detector` (default) when the finding came from kernel_fit.py pattern matching; `flag` when the finding originated from a /hstack:flag pin (ADR-0005). For folded-in findings (flag signal merged into an existing detector-finding), `detected-via` remains `detector` because the originating signal was the detector pattern.
10
+ detected-at: <ISO-8601 timestamp>
11
+ evidence-row-count: 0 # integer; must equal len(evidence-rows) per KF-01
12
+ evidence-rows: [] # YAML array of {change|adr|td, signal} dicts; one entry per row counted above
13
+ related-findings: [] # KF ids — prior or adjacent findings on the same kernel surface
14
+ promoted-to: null # `adr:<ADR-NNNN-slug>` | `tech-debt:<TD-NNNN-slug>` | null; reciprocal with the target artifact's `promoted-from-kernel-fit`; required when status: promoted
15
+ dismissed-reason: null # ≥50 chars of prose; required when status: dismissed (per KF-05)
16
+ superseded-by: null # KF id when status: superseded
17
+ created: <YYYY-MM-DD>
18
+ updated: <YYYY-MM-DD>
19
+ schema-version: 1
20
+ ---
21
+
22
+ ## Title
23
+
24
+ _Short noun phrase naming the kernel-fit gap. Example: "Category-A claim spans production paths — engineer likely meant Category B."_
25
+
26
+ ## Pattern fired
27
+
28
+ _Name the detector pattern (KF-P1 / KF-P2 / KF-P3 / …) and one paragraph describing what the detector found. Quote the pattern's defining condition from `kernel_fit.py` if helpful._
29
+
30
+ ## Evidence
31
+
32
+ _Per evidence row, a 2–3 sentence prose summary with at least one inline citation (change-id, ADR-id, TD-id, commit-sha, kernel section). KF-01 requires `len(evidence-rows)` in frontmatter to equal `evidence-row-count`; the prose here must cite each row at least once. No prose without a citation._
33
+
34
+ 1. ...
35
+ 2. ...
36
+
37
+ ## Kernel surface implicated
38
+
39
+ _Single-sentence pointer to the kernel section, template, validator rule, or Skill flow that the finding suggests revising. Examples: "`template/CLAUDE.md § Frontmatter contract` — the `internal-tooling` field"; "`template/templates/change-spec.md` frontmatter — `surfaces` enum"; "`/hstack:adversarial-review` precondition check at SKILL.md line 61"._
40
+
41
+ ## Proposed direction
42
+
43
+ _One paragraph. Name a direction the kernel revision could take — split a flag, add an enum case, add a Skill precondition, amend a section. This is NOT a full ADR — that work is done by `spec-author` if and when the engineer invokes `/hstack:kernel-fit-promote`. Keep this as a sketch, not a specification._
44
+
45
+ ## Counter-explanations (challenge prompt — mandatory)
46
+
47
+ _Two reasons this finding might NOT warrant a kernel change. If you cannot produce two, the analyst auto-downgrades `confidence` to `low` per KF-03. The challenge defends against false-positives the same way `## Consequences` § "name two consequences that look bad" defends ADRs._
48
+
49
+ 1. ...
50
+ 2. ...
51
+
52
+ ## Confidence rationale
53
+
54
+ _One paragraph defending the `confidence` enum value against the validator rules. `high` requires `evidence-row-count >= 3` AND ≥2 distinct change-specs cited (KF-02). `medium` is the conservative default. `low` carries no notification and is appropriate when evidence is thin or the challenge prompts substantially weaken the finding._
55
+
56
+ ## Triage Log
57
+
58
+ _Populated by `/hstack:kernel-fit-triage` and `/hstack:kernel-fit-promote` as the finding's status transitions. Section is empty until the first transition out of `open`._
59
+
60
+ - `status: open → acknowledged` on `<YYYY-MM-DD>` by `<owner>`. Triggered by `/hstack:kernel-fit-triage <id> --action acknowledge`.
61
+ - `status: open → dismissed` on `<YYYY-MM-DD>` by `<owner>`. Reason: `<dismissed-reason>`.
62
+ - `status: acknowledged → promoted` on `<YYYY-MM-DD>` by `<owner>`. Promoted to: `<promoted-to>`. Triggered by `/hstack:kernel-fit-promote <id> --slug <adr-slug>`.
63
+ - `status: open → superseded` on `<YYYY-MM-DD>` by the next `kernel-fit-analyst` run. Superseded by: `<superseded-by>`.
@@ -0,0 +1,52 @@
1
+ ---
2
+ id: flag-<YYYYMMDD>T<HHMMSS>-<session-id-short>
3
+ type: kernel-fit-flag
4
+ status: pending # pending | processed
5
+ session-id: <claude-code-session-uuid> # FL-01: non-null at pin-time
6
+ session-transcript-path: <abs-path-to-jsonl> # FL-01: non-null at pin-time
7
+ branch: <current-branch> # FL-01: non-null at pin-time
8
+ head: <current-HEAD-sha> # FL-01: non-null at pin-time
9
+ workspace: <abs-path-to-cwd> # FL-01: non-null at pin-time
10
+ timestamp: <ISO-8601 timestamp at pin> # FL-01: non-null at pin-time
11
+ pre-compaction-message-count: <integer> # FL-01: non-null at pin-time; analyst uses this to detect truncation between pin and scan
12
+ hint: null # one-word string from --hint arg; null when no arg given
13
+ classification: null # FL-02: non-null when status: processed; one of friction | missing-guardrail | kernel-vs-practice-mismatch | not-actionable | transcript-truncated
14
+ classification-rationale: null # FL-02: non-null when status: processed; one-line analyst note
15
+ folded-into: null # KF-NNNN-<slug> when the analyst folded the signal into an existing finding
16
+ emitted-as: null # KF-NNNN-<slug> when the analyst emitted a fresh finding from this pin
17
+ created: <YYYY-MM-DD>
18
+ updated: <YYYY-MM-DD>
19
+ schema-version: 1
20
+ ---
21
+
22
+ <!--
23
+ A kernel-fit-flag is a frontmatter-only pin. There is no body. Engineer
24
+ interpretation of the friction is deliberately excluded — the analyst reads
25
+ the transcript window and forms its own classification at processing time.
26
+
27
+ Validator rules (enforced by the proposed-diff preview in v1; validate-spec.ts
28
+ is still a {{TODO-SCRIPT}} placeholder):
29
+
30
+ - FL-01: at pin-time (status: pending) every field marked above as
31
+ "non-null at pin-time" must be populated. `hint` may be null; the four
32
+ analyst-owned fields (classification, classification-rationale,
33
+ folded-into, emitted-as) must remain null until processing.
34
+
35
+ - FL-02: at processing-time (status: processed) `classification` and
36
+ `classification-rationale` must both be non-null. When the classification
37
+ produced a finding, exactly one of `folded-into` or `emitted-as` is non-null
38
+ (never both). When the classification did not produce a finding (closed as
39
+ `not-actionable` or `transcript-truncated`), both remain null.
40
+
41
+ Pins are immutable from the engineer's perspective. The only legal writes
42
+ after creation are by the kernel-fit-analyst at processing time, setting the
43
+ four analyst-owned fields and flipping status to processed. The engineer
44
+ cannot edit a pin to add commentary — that would re-open the contamination
45
+ surface the analyst guards against. To add context, re-flag in a follow-up
46
+ turn (a new pin with a different timestamp).
47
+
48
+ Pins live at hstack/kernel-fit/flags/pending/ before processing and at
49
+ hstack/kernel-fit/flags/processed/ after. The directory is gitignored in
50
+ the consuming repo — see ADR-0005 for the rationale and the trade-off
51
+ (provenance gap unique to this artifact type).
52
+ -->