Files
gstack/lib/gate-diff/types.ts
T
Garry Tanandcapy-ai[bot] 5b9b8372c4 feat: honest work and gate integrity — gate-edit detector, review/ship gate pass, zero-run green, claims-need-evidence kernel (#3114)
* docs(designs): honest work and gate integrity plan (autoplan-reviewed)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(e2e): review-gate-integrity rule case registered in touchfiles and the PR profile

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* feat(honesty): claims-need-evidence kernel, no_claim card field, CEO value test, implementer dispatch rules, ACCEPTANCE_EDITED, Honest Work ethos

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* feat(gate-diff): gate-edit detector lib + CLI, patch fixtures, calibration script, tests_ran in gstack-evidence

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(gate-diff): RH-15? only on CI/config floors after calibration

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* feat(review,ship): Gate Integrity category, GATE_SCAN_BLOCK, one-way gate disposition, actor stamping, ZERO-RUN lanes, draft-while-open

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* chore: re-measure parity and context budgets on the integrated tree

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(touchfiles): gate-diff fixtures and helpers select review-gate-integrity

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: archaeology lint wording, paid-file census, harness-version non-behavioral record

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: pin review Step 3.5 rename, plan-path placeholder, mktemp template, per-stream evidence tail

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test: ACCEPTANCE_EDITED fence substitutes the <plan-path> placeholder

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(gate-diff): shallow boundary commits report no_base instead of a whole-tree inventory; recalibrate

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
2026-10-10 22:33:01 +00:00

78 lines
2.0 KiB
TypeScript

/** Shared shapes of the gate-edit detector (lib/gate-diff/*). */
export type DiffLineKind = 'ctx' | 'del' | 'add';
export interface DiffLine {
kind: DiffLineKind;
text: string;
}
export interface Hunk {
/** The `@@ -a,b +c,d @@ …` header as git printed it. */
header: string;
lines: DiffLine[];
}
export type FileStatus = 'added' | 'modified' | 'deleted' | 'renamed' | 'copied' | 'typechange';
/** Why a path has no readable hunks. Named coverage, never zero hunks. */
export type Unsupported = 'binary' | 'symlink' | 'submodule' | 'undecodable';
export interface FileDiff {
/** Path before the change; equals newPath unless renamed. `/dev/null` is never used: added files carry newPath in both. */
oldPath: string;
newPath: string;
status: FileStatus;
hunks: Hunk[];
unsupported?: Unsupported;
}
export interface CommitInfo {
sha: string;
/** Full message body. */
message: string;
}
export type Level = 'listed' | 'read';
export interface ListedHunk {
id: string;
path: string;
oldPath: string;
level: Level;
tags: string[];
old: string[];
new: string[];
citation: string | null;
/** Human-readable facts beside a tag (RH-15 key, values and direction). */
notes: string[];
header: string;
/** Floor class that admitted the hunk, when any. */
floor: string | null;
unsupported?: Unsupported;
/** Approximate byte size of old+new lines, for the 200 KB read budget. */
bytes: number;
}
export interface ScanSummary {
listed: number;
eligible: number;
inspected: number;
unread: number;
tagged: Record<string, number>;
unmatched: number;
coverage: string[];
languagesUnlisted: string[];
candidate: string;
artifact: string;
}
export interface ScanResult {
summary: ScanSummary;
hunks: ListedHunk[];
/** Changed paths that matched no floor class and carried no tag. */
unmatchedPaths: string[];
/** Paths with no readable hunks and why. */
unsupportedPaths: { path: string; reason: Unsupported }[];
}