@lannguyensi/harness 0.39.0 → 0.40.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.
- package/CHANGELOG.md +22 -0
- package/dist/cli/approve/stdin-report.d.ts +42 -0
- package/dist/cli/approve/stdin-report.js +143 -0
- package/dist/cli/approve/stdin-report.js.map +1 -0
- package/dist/cli/approve/understanding.d.ts +20 -0
- package/dist/cli/approve/understanding.js +16 -0
- package/dist/cli/approve/understanding.js.map +1 -1
- package/dist/cli/diff/git.d.ts +5 -0
- package/dist/cli/diff/git.js +25 -3
- package/dist/cli/diff/git.js.map +1 -1
- package/dist/cli/index.js +34 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/composer.js +1 -1
- package/dist/cli/init/composer.js.map +1 -1
- package/dist/cli/init/profiles.d.ts +2 -2
- package/dist/cli/init/profiles.js +2 -2
- package/dist/cli/init/templates.d.ts +1 -1
- package/dist/cli/init/templates.js +21 -1
- package/dist/cli/init/templates.js.map +1 -1
- package/dist/cli/pack/approve-escape.d.ts +19 -0
- package/dist/cli/pack/approve-escape.js +120 -0
- package/dist/cli/pack/approve-escape.js.map +1 -0
- package/dist/cli/pack/hook-pre-tool-use.js +15 -24
- package/dist/cli/pack/hook-pre-tool-use.js.map +1 -1
- package/dist/cli/pack/understanding-report-schema-hint.js +12 -1
- package/dist/cli/pack/understanding-report-schema-hint.js.map +1 -1
- package/dist/runtime/ledger-add.js +5 -1
- package/dist/runtime/ledger-add.js.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
7
|
|
|
8
|
+
## [0.40.0] - 2026-07-10
|
|
9
|
+
|
|
10
|
+
**Headline: `harness approve understanding` can finally persist the Understanding Report it approves.** Attach the report as a quoted heredoc on the command's stdin and the same run parses it, persists it session-bound, and flips it to `approved`, and the `report: ⚠ skipped` line that every approval printed is gone, and the audit trail is no longer structurally empty. The gate's escape matcher was rebuilt around a character whitelist after review found a shell-parse divergence that let a backslash-escaped redirect smuggle commands past it. Also: `init --template full` makes the runtime-reality hook discoverable, CI enforces coverage thresholds, the test suite runs on macOS, and the curated OKF knowledge bundle ships. Re-run `npm i -g @lannguyensi/harness` to upgrade.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Report capture on `harness approve understanding` (task 61fd36db, PR #337).** The command now accepts the Understanding Report as a quoted heredoc on stdin, parses it with the canonical `@lannguyensi/understanding-gate` `parseReport` (new dependency, `^0.4.5`), persists it session-bound with `approvalStatus: "pending"` into the reports dir, and lets the existing selection → validation → flip path approve it in the same run. Why this channel and not the Stop hook: the Stop-hook producer fires at END of turn, i.e. after a same-turn `approve` has already looked for a report, and current Claude Code builds no longer reliably persist mid-turn assistant text to the transcript JSONL, so no transcript-based capture (Stop-hook fallback, tier-6 session-id fallback, PreToolUse harvest) can work. The approval command is the only reliable carrier, and as a bonus the operator reads the full report inside the permission prompt before approving. Unparseable stdin degrades loudly (a `stdin: ⚠` line plus a parse-error log in the standalone hook's format, so `findLatestParseError` surfaces the reason) but never blocks the approval itself; a parsed-but-hollow `grill_me` report still refuses the marker through the existing validation short-circuit; incomplete piped input (timeout, stream error, size cap) is refused rather than captured, so a truncated report can never be persisted and approved as if it were whole. The deny message, the `init` profiles/templates/composer `ux.run` texts, and `docs/okf/understanding-gate-lockout-recovery.md` all teach the heredoc form.
|
|
15
|
+
- **The runtime-reality PreToolUse hook is discoverable from `harness init --template full`** (task 9f10267e, PRs #333, #334). `grep runtime-reality src/cli/init/` used to return zero hits, so operators only found the hook through `docs/runtime-reality-hook.md`. FULL_TEMPLATE now carries a fully commented-out `hooks[]` entry with placeholder env values and a docs pointer: enable-in-place, but not an active default, because the hook is host-coupled and without `RUNTIME_REALITY_KEYWORD`, an expectations file, and `RUNTIME_REALITY_PROBE_CMD` it degrades to a silent allow that looks like protection. A parity test asserts `parseManifest(FULL_TEMPLATE).hooks` contains no active runtime-reality entry and that the commented block still exists; mutation-verified (uncommenting the block turns the guard red).
|
|
16
|
+
- **Curated OKF knowledge bundle for harness** (PR #336): eight cross-file concept docs under `docs/okf/` capturing semantics no single source file states: gate fail-posture matrix, evidence-ledger trust boundary, version-sensitive producer wiring, whole-manifest validation scope, understanding-gate lockout recovery, pause-vs-gate-disable kill switches, Codex adapter parity gaps, and debug verb selection. Every claim verified against sources at `f3c1727`; `okf-kit check --strict` clean.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **The understanding-gate escape matcher moved to `src/cli/pack/approve-escape.ts`** (PR #337) and is now shared by the hook rather than defined inside it. Beyond the bare `harness approve …` line it accepts exactly one extra shape: a clean command part plus one single-quoted heredoc, terminated by the first line exactly equal to the delimiter (mirroring shell semantics), with nothing but whitespace after it. Single-line behavior is byte-for-byte unchanged.
|
|
21
|
+
- **CI enforces the coverage thresholds it declares** (PR #331). The Test step runs `npm run test:cov` instead of `npm test`, so the 90/90/90/75 lines/functions/statements/branches thresholds in `vitest.config.ts` gate merges instead of silently rotting. Master clears the gate (statements 91.69%, branches 82.57%, functions 93.46%, lines 93.41%); verified the gate trips by locally raising the lines threshold to 100.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- **SECURITY: a backslash-escaped redirect could smuggle commands past the understanding gate** (PR #337, found by review before release). `harness approve understanding \<<'UR'` was accepted as a report heredoc by the escape matcher, but bash reads `\<` as a literal `<` followed by a file redirect: no heredoc exists and the "body" lines execute as ordinary shell commands. Reproduced live in bash. The matcher would then emit `permissionDecision: "ask"` on a command visually near-identical to the legitimate one, and under a `Bash(harness approve understanding:*)` allowlist it would have auto-approved the smuggled command with no prompt at all. The heredoc command part is now held to a character whitelist (`/^[A-Za-z0-9_\s,./=:@~-]*$/`) instead of a metacharacter blacklist, so no quoting or escaping trick can change how the shell tokenizes the line. Mutation-verified: removing the whitelist fails exactly the three new exploit tests. Negative tests cover `\<<`, `foo\<<`, `\\<<`, quote-obscured intros, `<(id)`, `>(cmd)`, unquoted/double-quoted/`<<-` delimiters, second redirects, trailing commands, early terminators, unterminated bodies, and CR-in-head.
|
|
26
|
+
- **`addLedgerFact` could lose the tail of a failing MCP server's stderr** (task 5839b59e, PR #329). stderr was captured in the child's `exit` handler, but Node does not guarantee the stderr `data` event fires before `exit`, so the surfaced reason could collapse to `(no stderr)`. Capture on `close` (fires only after all stdio pipes drain), mirroring `ledger-client.ts`'s `queryLedgerByTag`. Also adds a subprocess E2E case asserting the real block/deny envelope from `hook-pre-tool-use.ts`, which was previously only exercised on the allow path.
|
|
27
|
+
- **The test suite runs on macOS** (PR #335): four Darwin-only failure clusters (14 tests), with Linux CI staying green. Tests hardcoding `/bin/true` (absent on macOS) use `/usr/bin/true`; `locateGitContext` / `repoRelativePath` resolve paths to their physical form before relativizing against git's physical work-tree root, which fixes real symlinked-path usage (macOS `/var` → `/private/var`), not just the tests.
|
|
28
|
+
- **Two fixed-window test flakes replaced with readiness handshakes** (PRs #330, #332). The smoke SIGKILL-escalation test spawns its trap child directly and waits for the trap to be installed before handing it to `runSmoke`, so the runner's timeout window only starts once SIGTERM is guaranteed to be swallowed. The io lock concurrency test polls for worker A's `A:lock-acquired` marker instead of assuming a fixed 50ms head start, which under CPU contention let worker B win the first-acquire race and flip the `[A,B]` assertion.
|
|
29
|
+
|
|
8
30
|
## [0.39.0] - 2026-07-02
|
|
9
31
|
|
|
10
32
|
**Headline: the 2026-07-01 deep-review remediation ships — enforcement no longer degrades under load, the `grounding:` section finally does something, and `apply --merge` stops eating operator edits.** The PreToolUse gate pools one grounding-mcp session per intercept (a hook timeout no longer silently fail-opens enforcement), `grounding.evidence_ledger.path` now actually configures the grounding-mcp entry, `apply --merge` preserves operator-added mcpServers with provenance, the Codex understanding-gate reaches approval-lifecycle parity with Claude Code, `diff --since` stops reporting override layers as phantom history, and CI gains two architecture fitness gates plus new `validate` lints (git-ignored OW knob, block policies without declared producers). Re-run `npm i -g @lannguyensi/harness` to upgrade.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type StdinReportOutcome = {
|
|
2
|
+
ok: true;
|
|
3
|
+
filePath: string;
|
|
4
|
+
} | {
|
|
5
|
+
ok: false;
|
|
6
|
+
reason: string;
|
|
7
|
+
parseErrorLogPath?: string;
|
|
8
|
+
};
|
|
9
|
+
export interface PersistStdinReportArgs {
|
|
10
|
+
/** The heredoc body: Understanding Report markdown. */
|
|
11
|
+
markdown: string;
|
|
12
|
+
/** Directory the approve flow lists reports from. */
|
|
13
|
+
reportsDir: string;
|
|
14
|
+
/** Resolved session id; stamped onto the persisted JSON. */
|
|
15
|
+
sessionId: string;
|
|
16
|
+
/** Clock injection for deterministic tests. */
|
|
17
|
+
now: Date;
|
|
18
|
+
}
|
|
19
|
+
/** Reports are a few KB; anything beyond this is not a report. */
|
|
20
|
+
export declare const STDIN_REPORT_MAX_BYTES: number;
|
|
21
|
+
export interface PipedStdinResult {
|
|
22
|
+
text: string;
|
|
23
|
+
/**
|
|
24
|
+
* True only when the stream ended cleanly within the size cap. A
|
|
25
|
+
* timeout with partial data, a stream error, or a size-cap hit all
|
|
26
|
+
* yield `complete: false` — the caller must NOT feed such text into
|
|
27
|
+
* the capture path, or a truncated-but-still-parseable report could
|
|
28
|
+
* be persisted and approved as if it were whole (review 2026-07-10).
|
|
29
|
+
*/
|
|
30
|
+
complete: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Read piped stdin fully, with a hang guard. The caller must already
|
|
34
|
+
* have established that stdin is NOT a TTY. The timeout exists because
|
|
35
|
+
* this read sits on the operator-approval path: if some harness wires
|
|
36
|
+
* the CLI to an open-but-idle pipe, a blocked read here would brick
|
|
37
|
+
* approvals — after `timeoutMs` we proceed with whatever arrived
|
|
38
|
+
* (a real heredoc is delivered immediately by the shell), flagged
|
|
39
|
+
* `complete: false`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function readPipedStdin(stream: NodeJS.ReadableStream, maxBytes?: number, timeoutMs?: number): Promise<PipedStdinResult>;
|
|
42
|
+
export declare function persistStdinReport(args: PersistStdinReportArgs): StdinReportOutcome;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Report capture for `harness approve understanding` (task 61fd36db).
|
|
2
|
+
//
|
|
3
|
+
// The Understanding Report arrives as a heredoc on the approve command's
|
|
4
|
+
// stdin (see src/cli/pack/approve-escape.ts for why this is the only
|
|
5
|
+
// channel that reliably carries it: the Stop-hook producer fires after
|
|
6
|
+
// approve already ran, and current Claude Code builds do not reliably
|
|
7
|
+
// persist mid-turn assistant text to the transcript JSONL). This module
|
|
8
|
+
// parses the markdown with the canonical parser from
|
|
9
|
+
// `@lannguyensi/understanding-gate` and persists it — session-bound and
|
|
10
|
+
// `pending` — into the same reports directory the Stop hook targets, so
|
|
11
|
+
// the approve flow's existing selection / validation / flip path picks
|
|
12
|
+
// it up via a strict sessionId match.
|
|
13
|
+
//
|
|
14
|
+
// On parse failure it writes a parse-error log in the exact format the
|
|
15
|
+
// standalone Stop hook uses (JSON header incl. sessionId, `--- raw ---`
|
|
16
|
+
// separator, raw markdown), so `findLatestParseError` in
|
|
17
|
+
// approve/understanding.ts surfaces the reason on the `report:` line
|
|
18
|
+
// instead of a silent dead end.
|
|
19
|
+
import * as path from "node:path";
|
|
20
|
+
import { createHash } from "node:crypto";
|
|
21
|
+
import { parseReport } from "@lannguyensi/understanding-gate";
|
|
22
|
+
import { atomicWriteFile } from "../../io/atomic-write.js";
|
|
23
|
+
/** Mirror of the standalone package's slug rule (persistence.ts). */
|
|
24
|
+
function sanitizeSlug(raw) {
|
|
25
|
+
const cleaned = raw.replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
26
|
+
return cleaned.slice(0, 40);
|
|
27
|
+
}
|
|
28
|
+
function summarizeParseError(error) {
|
|
29
|
+
if (error.message.length > 0)
|
|
30
|
+
return error.message;
|
|
31
|
+
const missing = error.missing.length > 0 ? ` (missing: ${error.missing.join(", ")})` : "";
|
|
32
|
+
return `${error.reason}${missing}`;
|
|
33
|
+
}
|
|
34
|
+
/** Reports are a few KB; anything beyond this is not a report. */
|
|
35
|
+
export const STDIN_REPORT_MAX_BYTES = 512 * 1024;
|
|
36
|
+
/**
|
|
37
|
+
* Read piped stdin fully, with a hang guard. The caller must already
|
|
38
|
+
* have established that stdin is NOT a TTY. The timeout exists because
|
|
39
|
+
* this read sits on the operator-approval path: if some harness wires
|
|
40
|
+
* the CLI to an open-but-idle pipe, a blocked read here would brick
|
|
41
|
+
* approvals — after `timeoutMs` we proceed with whatever arrived
|
|
42
|
+
* (a real heredoc is delivered immediately by the shell), flagged
|
|
43
|
+
* `complete: false`.
|
|
44
|
+
*/
|
|
45
|
+
export function readPipedStdin(stream, maxBytes = STDIN_REPORT_MAX_BYTES, timeoutMs = 2_000) {
|
|
46
|
+
return new Promise((resolve) => {
|
|
47
|
+
const chunks = [];
|
|
48
|
+
let length = 0;
|
|
49
|
+
let done = false;
|
|
50
|
+
const finish = (complete) => {
|
|
51
|
+
if (done)
|
|
52
|
+
return;
|
|
53
|
+
done = true;
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
resolve({
|
|
56
|
+
text: Buffer.concat(chunks).toString("utf8"),
|
|
57
|
+
complete: complete && length <= maxBytes,
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const timer = setTimeout(() => finish(false), timeoutMs);
|
|
61
|
+
// Let a finished CLI exit even if the timer is still pending.
|
|
62
|
+
timer.unref?.();
|
|
63
|
+
stream.on("data", (chunk) => {
|
|
64
|
+
if (done)
|
|
65
|
+
return;
|
|
66
|
+
if (length < maxBytes) {
|
|
67
|
+
const remaining = maxBytes - length;
|
|
68
|
+
chunks.push(chunk.length > remaining ? chunk.subarray(0, remaining) : chunk);
|
|
69
|
+
}
|
|
70
|
+
length += chunk.length;
|
|
71
|
+
});
|
|
72
|
+
stream.on("end", () => finish(true));
|
|
73
|
+
stream.on("error", () => finish(false));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export function persistStdinReport(args) {
|
|
77
|
+
// Defaults mirror the standalone Stop hook (handle-stop.ts): the
|
|
78
|
+
// report's own `**Metadata**` block wins for any field it declares;
|
|
79
|
+
// these only fill gaps. approvalStatus is forced to "pending" by
|
|
80
|
+
// parseReport regardless of input.
|
|
81
|
+
const result = parseReport(args.markdown, {
|
|
82
|
+
taskId: args.sessionId,
|
|
83
|
+
createdAt: args.now.toISOString(),
|
|
84
|
+
mode: "fast_confirm",
|
|
85
|
+
riskLevel: "medium",
|
|
86
|
+
});
|
|
87
|
+
const stamp = args.now.toISOString().replace(/[:.]/g, "-");
|
|
88
|
+
if (!result.ok) {
|
|
89
|
+
const summary = summarizeParseError(result.error);
|
|
90
|
+
// Same side-channel location + format as the standalone Stop hook:
|
|
91
|
+
// <reportsDir>/../parse-errors/<stamp>.log with a JSON header that
|
|
92
|
+
// carries sessionId (findLatestParseError skips logs it cannot
|
|
93
|
+
// attribute to the approving session).
|
|
94
|
+
const parseErrorDir = path.join(path.dirname(args.reportsDir), "parse-errors");
|
|
95
|
+
const payload = `${JSON.stringify({
|
|
96
|
+
reason: result.error.reason,
|
|
97
|
+
missing: result.error.missing,
|
|
98
|
+
schemaErrors: result.error.schemaErrors,
|
|
99
|
+
message: result.error.message,
|
|
100
|
+
stamp,
|
|
101
|
+
sessionId: args.sessionId,
|
|
102
|
+
source: "harness-approve-stdin",
|
|
103
|
+
}, null, 2)}\n\n--- raw ---\n${args.markdown}\n`;
|
|
104
|
+
let parseErrorLogPath;
|
|
105
|
+
try {
|
|
106
|
+
parseErrorLogPath = path.join(parseErrorDir, `${stamp}.log`);
|
|
107
|
+
atomicWriteFile(parseErrorLogPath, payload);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
// Best-effort side channel; the loud `stdin:` line still names the
|
|
111
|
+
// parse failure even when the log write itself fails.
|
|
112
|
+
parseErrorLogPath = undefined;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
ok: false,
|
|
116
|
+
reason: `report on stdin did not parse: ${summary}`,
|
|
117
|
+
...(parseErrorLogPath !== undefined ? { parseErrorLogPath } : {}),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
// The standalone package's saveReport cannot be used here: its
|
|
121
|
+
// canonical serializer whitelists the schema keys and would strip the
|
|
122
|
+
// sessionId binding, which is exactly what makes the approve flow's
|
|
123
|
+
// strict match (and the tier-6 session-id fallback) work. Persist the
|
|
124
|
+
// same JSON shape plus `sessionId`, with the package's filename
|
|
125
|
+
// convention (<isoStamp>-<slug>-<hash8>.json) so directory listings
|
|
126
|
+
// read uniformly.
|
|
127
|
+
const persisted = { ...result.report, sessionId: args.sessionId };
|
|
128
|
+
const json = `${JSON.stringify(persisted, null, 2)}\n`;
|
|
129
|
+
const hash = createHash("sha256").update(json).digest("hex").slice(0, 8);
|
|
130
|
+
const slug = sanitizeSlug(result.report.taskId) || "report";
|
|
131
|
+
const filePath = path.join(args.reportsDir, `${stamp}-${slug}-${hash}.json`);
|
|
132
|
+
try {
|
|
133
|
+
atomicWriteFile(filePath, json);
|
|
134
|
+
}
|
|
135
|
+
catch (err) {
|
|
136
|
+
return {
|
|
137
|
+
ok: false,
|
|
138
|
+
reason: `report parsed but could not be persisted to ${filePath}: ${err.message}`,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
return { ok: true, filePath };
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=stdin-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin-report.js","sourceRoot":"","sources":["../../../src/cli/approve/stdin-report.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,yEAAyE;AACzE,qEAAqE;AACrE,uEAAuE;AACvE,sEAAsE;AACtE,wEAAwE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,+CAA+C,QAAQ,KAAM,GAAa,CAAC,OAAO,EAAE;SAC7F,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Manifest } from "../../schema/index.js";
|
|
2
2
|
import { type LoaderOptions } from "../loader.js";
|
|
3
|
+
import { type StdinReportOutcome } from "./stdin-report.js";
|
|
3
4
|
export interface ApproveUnderstandingOptions extends LoaderOptions {
|
|
4
5
|
/** Explicit session id (overrides $CLAUDE_CODE_SESSION_ID / $CLAUDE_SESSION_ID / $CODEX_SESSION_ID). */
|
|
5
6
|
session?: string;
|
|
@@ -44,6 +45,16 @@ export interface ApproveUnderstandingOptions extends LoaderOptions {
|
|
|
44
45
|
* entries are dropped and duplicates de-duplicated.
|
|
45
46
|
*/
|
|
46
47
|
tasks?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Understanding Report markdown captured from the command's stdin
|
|
50
|
+
* (the report-heredoc shape, task 61fd36db). When set and non-blank,
|
|
51
|
+
* it is parsed and persisted as a pending, session-bound report BEFORE
|
|
52
|
+
* the report lookup below, so this very approve run validates and
|
|
53
|
+
* flips it. A parse failure degrades loudly (parse-error log + reason
|
|
54
|
+
* on the result) but does not abort the approval — the operator just
|
|
55
|
+
* approved interactively; a formatting nit must not brick that.
|
|
56
|
+
*/
|
|
57
|
+
reportMarkdown?: string;
|
|
47
58
|
/** Override the reports directory (test injection). */
|
|
48
59
|
reportsDir?: string;
|
|
49
60
|
/** Override the harness.generated/ directory (test injection). */
|
|
@@ -118,6 +129,15 @@ export interface ApproveUnderstandingResult {
|
|
|
118
129
|
* a wrong claim file can be spotted before it lands in the marker.
|
|
119
130
|
*/
|
|
120
131
|
taskMarkers: TaskMarkerOutcome[];
|
|
132
|
+
/**
|
|
133
|
+
* Outcome of capturing a report passed on stdin (`reportMarkdown`).
|
|
134
|
+
* Absent when no report was supplied. `ok: true` means the markdown
|
|
135
|
+
* parsed and was persisted pending + session-bound; the
|
|
136
|
+
* `persistedReport` result below then reports the flip of that same
|
|
137
|
+
* file. `ok: false` carries the parse/persist failure reason (and the
|
|
138
|
+
* parse-error log path when one was written).
|
|
139
|
+
*/
|
|
140
|
+
stdinReport?: StdinReportOutcome;
|
|
121
141
|
ledger: {
|
|
122
142
|
ok: boolean;
|
|
123
143
|
tag: string;
|
|
@@ -23,6 +23,7 @@ import { clearPendingApproval, resolveGeneratedDir, } from "../../runtime/pendin
|
|
|
23
23
|
import { resolveApprovalSessionId } from "../../runtime/session-id.js";
|
|
24
24
|
import { EX_FAIL, HarnessExitError } from "../exit-codes.js";
|
|
25
25
|
import { loadManifest, resolvePaths } from "../loader.js";
|
|
26
|
+
import { persistStdinReport } from "./stdin-report.js";
|
|
26
27
|
/**
|
|
27
28
|
* Human-scale age for operator messages: minutes up to two hours,
|
|
28
29
|
* hours up to two days, then days. A 17-day-old report should read
|
|
@@ -358,6 +359,19 @@ export async function approveUnderstanding(opts = {}) {
|
|
|
358
359
|
// operator with a bare `ledger: ok false` (no-silent-errors, M8).
|
|
359
360
|
manifestLoadError = err instanceof Error ? err.message : String(err);
|
|
360
361
|
}
|
|
362
|
+
// Report capture from stdin (task 61fd36db): persist BEFORE the
|
|
363
|
+
// lookup below so this very approve run selects, validates, and flips
|
|
364
|
+
// the report the agent just attached. Session-bound via the resolved
|
|
365
|
+
// sessionId, so the strict match wins over any stale leftovers.
|
|
366
|
+
let stdinReport;
|
|
367
|
+
if (typeof opts.reportMarkdown === "string" && opts.reportMarkdown.trim().length > 0) {
|
|
368
|
+
stdinReport = persistStdinReport({
|
|
369
|
+
markdown: opts.reportMarkdown,
|
|
370
|
+
reportsDir,
|
|
371
|
+
sessionId,
|
|
372
|
+
now: opts.now ?? new Date(),
|
|
373
|
+
});
|
|
374
|
+
}
|
|
361
375
|
// Approve-time validation. Resolve the report we would flip BEFORE
|
|
362
376
|
// writing the marker, so a validation failure can short-circuit every
|
|
363
377
|
// downstream write. The `latest` + `reports` values are reused later;
|
|
@@ -413,6 +427,7 @@ export async function approveUnderstanding(opts = {}) {
|
|
|
413
427
|
reason: `validation failed (${validation.field}): ${validation.reason}`,
|
|
414
428
|
},
|
|
415
429
|
taskMarkers: [],
|
|
430
|
+
...(stdinReport !== undefined ? { stdinReport } : {}),
|
|
416
431
|
ledger: {
|
|
417
432
|
ok: false,
|
|
418
433
|
tag: approvedLedgerTagFor(sessionId),
|
|
@@ -598,6 +613,7 @@ export async function approveUnderstanding(opts = {}) {
|
|
|
598
613
|
...(newestReportPath !== undefined ? { newestReportPath } : {}),
|
|
599
614
|
marker: markerResult,
|
|
600
615
|
taskMarkers,
|
|
616
|
+
...(stdinReport !== undefined ? { stdinReport } : {}),
|
|
601
617
|
ledger: ledgerResult.ok
|
|
602
618
|
? { ok: true, tag }
|
|
603
619
|
: { ok: false, tag, reason: ledgerResult.reason },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"understanding.js","sourceRoot":"","sources":["../../../src/cli/approve/understanding.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,4CAA4C;AAC5C,yCAAyC;AACzC,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,mDAAmD;AACnD,uEAAuE;AACvE,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,qEAAqE;AACrE,oEAAoE;AAEpE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,sEAAsE,CAAC;AAC9E,OAAO,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KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM,EAAE,YAAY,CAAC,EAAE;YACrB,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;YACnB,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE;QACnD,eAAe;QACf,UAAU;KACX,CAAC;AACJ,CAAC"}
|
package/dist/cli/diff/git.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export declare function readManifestAtRef(ctx: GitContext, ref: string): string;
|
|
|
8
8
|
* Repo-relative path for `absPath` in git's forward-slash form, or null
|
|
9
9
|
* when the file lives outside the repo work tree (e.g. an override layer
|
|
10
10
|
* under a ~/.harness home that is not the manifest's repo).
|
|
11
|
+
*
|
|
12
|
+
* Callers pass paths that exist on disk (layers are existsSync-gated at
|
|
13
|
+
* resolve time). A nonexistent path under a symlinked parent would skip
|
|
14
|
+
* realpath resolution and could misreport as outside-repo (null) — null
|
|
15
|
+
* stays the safe, non-crashing failure mode either way.
|
|
11
16
|
*/
|
|
12
17
|
export declare function repoRelativePath(ctx: GitContext, absPath: string): string | null;
|
|
13
18
|
/**
|
package/dist/cli/diff/git.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
|
+
import * as fs from "node:fs";
|
|
2
3
|
import * as path from "node:path";
|
|
3
4
|
import { EX_UNAVAILABLE, EX_USAGE, HarnessExitError } from "../exit-codes.js";
|
|
5
|
+
// `git rev-parse --show-toplevel` reports the PHYSICAL work-tree path
|
|
6
|
+
// (symlinks resolved), so every path we relativize against that root must
|
|
7
|
+
// be resolved the same way, or `path.relative` climbs out of the repo.
|
|
8
|
+
// Bites on macOS out of the box: os.tmpdir() is /var/folders/…, a symlink
|
|
9
|
+
// to /private/var/folders/…. Nonexistent paths stay merely resolved; the
|
|
10
|
+
// callers' existing not-found error paths own that case.
|
|
11
|
+
function toPhysicalPath(p) {
|
|
12
|
+
const resolved = path.resolve(p);
|
|
13
|
+
try {
|
|
14
|
+
return fs.realpathSync(resolved);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return resolved;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
4
20
|
function runGit(args, cwd) {
|
|
5
21
|
return execFileSync("git", args, {
|
|
6
22
|
cwd,
|
|
@@ -9,7 +25,8 @@ function runGit(args, cwd) {
|
|
|
9
25
|
});
|
|
10
26
|
}
|
|
11
27
|
export function locateGitContext(manifestPath) {
|
|
12
|
-
const
|
|
28
|
+
const physicalManifestPath = toPhysicalPath(manifestPath);
|
|
29
|
+
const dir = path.dirname(physicalManifestPath);
|
|
13
30
|
let root;
|
|
14
31
|
try {
|
|
15
32
|
root = runGit(["rev-parse", "--show-toplevel"], dir).trim();
|
|
@@ -17,7 +34,7 @@ export function locateGitContext(manifestPath) {
|
|
|
17
34
|
catch (err) {
|
|
18
35
|
throw new HarnessExitError(`git is not available or ${dir} is not inside a git work tree: ${err.message.trim()}`, EX_UNAVAILABLE);
|
|
19
36
|
}
|
|
20
|
-
const relPath = path.relative(root,
|
|
37
|
+
const relPath = path.relative(root, physicalManifestPath);
|
|
21
38
|
return { root, manifestRelPath: relPath };
|
|
22
39
|
}
|
|
23
40
|
export function readManifestAtRef(ctx, ref) {
|
|
@@ -33,9 +50,14 @@ export function readManifestAtRef(ctx, ref) {
|
|
|
33
50
|
* Repo-relative path for `absPath` in git's forward-slash form, or null
|
|
34
51
|
* when the file lives outside the repo work tree (e.g. an override layer
|
|
35
52
|
* under a ~/.harness home that is not the manifest's repo).
|
|
53
|
+
*
|
|
54
|
+
* Callers pass paths that exist on disk (layers are existsSync-gated at
|
|
55
|
+
* resolve time). A nonexistent path under a symlinked parent would skip
|
|
56
|
+
* realpath resolution and could misreport as outside-repo (null) — null
|
|
57
|
+
* stays the safe, non-crashing failure mode either way.
|
|
36
58
|
*/
|
|
37
59
|
export function repoRelativePath(ctx, absPath) {
|
|
38
|
-
const rel = path.relative(ctx.root,
|
|
60
|
+
const rel = path.relative(ctx.root, toPhysicalPath(absPath));
|
|
39
61
|
if (rel.startsWith("..") || path.isAbsolute(rel))
|
|
40
62
|
return null;
|
|
41
63
|
return rel.split(path.sep).join("/");
|
package/dist/cli/diff/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../../src/cli/diff/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAO9E,SAAS,MAAM,CAAC,IAAc,EAAE,GAAW;IACzC,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE;QAC/B,GAAG;QACH,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;KAClC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,YAAoB;IACnD,MAAM,
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../../src/cli/diff/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAO9E,sEAAsE;AACtE,0EAA0E;AAC1E,uEAAuE;AACvE,0EAA0E;AAC1E,yEAAyE;AACzE,yDAAyD;AACzD,SAAS,cAAc,CAAC,CAAS;IAC/B,MAAM,QAAQ,GAAG,IAAI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CAAC;IACrE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAI,GAAmC,CAAC,MAAM,EAAE,IAAI,EAAE,IAAK,GAAa,CAAC,OAAO,CAAC;QAC9F,MAAM,IAAI,gBAAgB,CACxB,eAAe,GAAG,CAAC,eAAe,gBAAgB,GAAG,MAAM,OAAO,EAAE,EACpE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAe,EAAE,OAAe;IAC/D,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7D,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9D,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,GAAe,EACf,GAAW,EACX,OAAe;IAEf,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -38,6 +38,7 @@ import { isRuntime, KNOWN_RUNTIMES } from "../policy-packs/index.js";
|
|
|
38
38
|
import { approveBranchProtection } from "./approve/branch-protection.js";
|
|
39
39
|
import { approveRisk } from "./approve/risk.js";
|
|
40
40
|
import { approveUnderstanding } from "./approve/understanding.js";
|
|
41
|
+
import { readPipedStdin } from "./approve/stdin-report.js";
|
|
41
42
|
import { describe, isPillar } from "./describe.js";
|
|
42
43
|
import { diff as diffRun } from "./diff/index.js";
|
|
43
44
|
import { diffSinceApply } from "./diff/since-apply.js";
|
|
@@ -1050,6 +1051,23 @@ export function buildProgram(opts = {}) {
|
|
|
1050
1051
|
cliOpts.approvedBy = options.approvedBy;
|
|
1051
1052
|
if (options.force)
|
|
1052
1053
|
cliOpts.force = true;
|
|
1054
|
+
// Report capture (task 61fd36db): the agent attaches the
|
|
1055
|
+
// Understanding Report as a quoted heredoc on stdin. A TTY stdin
|
|
1056
|
+
// means an interactive operator shell with nothing piped — skip
|
|
1057
|
+
// the read entirely so the CLI never sits waiting for input.
|
|
1058
|
+
// Incomplete input (timeout, error, size cap) is refused rather
|
|
1059
|
+
// than captured: a truncated-but-parseable report must never be
|
|
1060
|
+
// persisted and approved as if it were whole.
|
|
1061
|
+
let stdinIncomplete = false;
|
|
1062
|
+
if (!process.stdin.isTTY) {
|
|
1063
|
+
const piped = await readPipedStdin(process.stdin);
|
|
1064
|
+
if (piped.text.trim().length > 0) {
|
|
1065
|
+
if (piped.complete)
|
|
1066
|
+
cliOpts.reportMarkdown = piped.text;
|
|
1067
|
+
else
|
|
1068
|
+
stdinIncomplete = true;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1053
1071
|
const result = await approveUnderstanding(cliOpts);
|
|
1054
1072
|
const lines = [];
|
|
1055
1073
|
// Annotate non-explicit session sources so the operator can spot
|
|
@@ -1116,6 +1134,22 @@ export function buildProgram(opts = {}) {
|
|
|
1116
1134
|
else {
|
|
1117
1135
|
lines.push(`ledger: ⚠ skipped (${result.ledger.reason ?? "unknown"}) (audit only)`);
|
|
1118
1136
|
}
|
|
1137
|
+
if (stdinIncomplete) {
|
|
1138
|
+
lines.push("stdin: ⚠ piped input arrived incomplete (timeout, stream error, or size cap) — report NOT captured.");
|
|
1139
|
+
lines.push(" the approval itself proceeds below; re-run with the report as a quoted heredoc to persist the audit trail.");
|
|
1140
|
+
}
|
|
1141
|
+
if (result.stdinReport) {
|
|
1142
|
+
if (result.stdinReport.ok) {
|
|
1143
|
+
lines.push(`stdin: ✓ report captured from stdin → ${result.stdinReport.filePath}`);
|
|
1144
|
+
}
|
|
1145
|
+
else {
|
|
1146
|
+
lines.push(`stdin: ⚠ report on stdin NOT captured (${result.stdinReport.reason})`);
|
|
1147
|
+
if (result.stdinReport.parseErrorLogPath) {
|
|
1148
|
+
lines.push(` raw text + parser reasons kept at ${result.stdinReport.parseErrorLogPath}`);
|
|
1149
|
+
}
|
|
1150
|
+
lines.push(" the approval itself proceeds below; re-run with a schema-conform report to persist the audit trail.");
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1119
1153
|
if (result.persistedReport.ok) {
|
|
1120
1154
|
const prev = result.persistedReport.previousStatus ?? "<missing>";
|
|
1121
1155
|
const stampNote = result.persistedReport.sessionIdStamped
|