tamperward 2.23.1 → 2.23.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/dist/cli/index.js +41 -23
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -14818,20 +14818,28 @@ async function runOnboard(opts, io = {}) {
|
|
|
14818
14818
|
status("LIMITED", platformLabel(platform) + ": check works here; local verify and `run` are unavailable. Use the container verifier for final verification.", "warn");
|
|
14819
14819
|
}
|
|
14820
14820
|
const head = git5(cwd, ["rev-parse", "--verify", "--quiet", "HEAD^{commit}"])?.trim() ?? null;
|
|
14821
|
-
if (!head) status("ACTION", "No commit yet. Commit once before pristine verification or the safe demo.", "warn");
|
|
14822
14821
|
const treeStatus = git5(cwd, ["status", "--porcelain", "--untracked-files=all"]) ?? "";
|
|
14823
14822
|
const dirty = treeStatus.split("\n").filter(Boolean).map((line) => line.slice(3).split(" -> ").at(-1) ?? "");
|
|
14824
|
-
|
|
14825
|
-
|
|
14826
|
-
|
|
14827
|
-
|
|
14828
|
-
|
|
14829
|
-
|
|
14823
|
+
if (!head) {
|
|
14824
|
+
const count = dirty.length;
|
|
14825
|
+
status(
|
|
14826
|
+
"ACTION",
|
|
14827
|
+
count ? "No first commit yet; " + count + " path(s) are not part of a committed baseline. Create the initial commit before pristine verification or the safe demo." : "No first commit yet. Create the initial commit before pristine verification or the safe demo.",
|
|
14828
|
+
"warn"
|
|
14829
|
+
);
|
|
14830
14830
|
} else {
|
|
14831
|
-
|
|
14832
|
-
|
|
14833
|
-
|
|
14834
|
-
|
|
14831
|
+
const owned = new Set(planInit(cwd).map((a) => a.path));
|
|
14832
|
+
const foreign = dirty.filter((p) => !owned.has(p));
|
|
14833
|
+
if (dirty.length === 0) {
|
|
14834
|
+
status("OK", "Working tree is clean.", "ok");
|
|
14835
|
+
} else if (foreign.length === 0) {
|
|
14836
|
+
status("ACTION", dirty.length + " uncommitted setup file(s) from TamperWard; commit them when setup is complete.", "warn");
|
|
14837
|
+
} else {
|
|
14838
|
+
status("ACTION", dirty.length + " existing changed/untracked path(s). TamperWard will not stash or reset them.", "warn");
|
|
14839
|
+
if (!await confirm("Continue with the existing working-tree changes?", false, true)) {
|
|
14840
|
+
status("STOPPED", "Commit or stash your work, then re-run `tamperward onboard`.", "warn");
|
|
14841
|
+
return 2;
|
|
14842
|
+
}
|
|
14835
14843
|
}
|
|
14836
14844
|
}
|
|
14837
14845
|
section(2);
|
|
@@ -14950,11 +14958,11 @@ async function runOnboard(opts, io = {}) {
|
|
|
14950
14958
|
status("SKIP", "Verification skipped. Run `tamperward verify` when ready.", "dim");
|
|
14951
14959
|
}
|
|
14952
14960
|
if (!opts.skipDemo) {
|
|
14953
|
-
|
|
14954
|
-
|
|
14955
|
-
|
|
14956
|
-
|
|
14957
|
-
|
|
14961
|
+
if (!head) {
|
|
14962
|
+
status("SKIP", "Safe demo becomes available after the first commit.", "dim");
|
|
14963
|
+
} else {
|
|
14964
|
+
const wanted = scripted ? Boolean(opts.demo) : opts.demo ? true : await confirm("Run the optional safe tamper demo? (temporary worktree only)", false, false);
|
|
14965
|
+
if (wanted) runDemo(cwd, head, runners, (line) => out3(terminalText(line)));
|
|
14958
14966
|
}
|
|
14959
14967
|
}
|
|
14960
14968
|
section(4);
|
|
@@ -14982,8 +14990,10 @@ async function runOnboard(opts, io = {}) {
|
|
|
14982
14990
|
if (check2.state === "OK" || check2.id === "observer") continue;
|
|
14983
14991
|
seenFailure.add(check2.id);
|
|
14984
14992
|
if (check2.id === "platform" && platform !== "linux") {
|
|
14985
|
-
|
|
14986
|
-
|
|
14993
|
+
continue;
|
|
14994
|
+
}
|
|
14995
|
+
if (check2.id === "verifier" && !verifyCommand && check2.state === "BROKEN") {
|
|
14996
|
+
status("ACTION", "Verification is not configured; choose the trusted test command.", "warn");
|
|
14987
14997
|
} else {
|
|
14988
14998
|
renderCheck(check2, out3, colour);
|
|
14989
14999
|
}
|
|
@@ -14998,15 +15008,24 @@ async function runOnboard(opts, io = {}) {
|
|
|
14998
15008
|
else status("BLOCKED", "Fix the broken item(s) above before relying on the gate.", "bad");
|
|
14999
15009
|
if (doctorOutcome.github) {
|
|
15000
15010
|
status("OK", "GitHub authority enforced for " + doctorOutcome.github.repo + "#" + doctorOutcome.github.branch + ".", "ok");
|
|
15011
|
+
} else if (!repo) {
|
|
15012
|
+
status("ACTION", "GitHub authority is not configured for this repository.", "warn");
|
|
15013
|
+
out3(paint2(" If GitHub will provide repository authority, run: " + terminalText(doctorCommand), DIM2, colour));
|
|
15014
|
+
out3(paint2(" If this repository will use GitHub CI authority, configure:", DIM2, colour));
|
|
15015
|
+
for (const line of MANUAL_CONTROLS) out3(paint2(" " + line, DIM2, colour));
|
|
15001
15016
|
} else {
|
|
15002
15017
|
status("ACTION", "GitHub authority is not verified yet.", "warn");
|
|
15003
15018
|
out3(paint2(" " + terminalText(doctorCommand), DIM2, colour));
|
|
15004
|
-
|
|
15019
|
+
out3(paint2(" GitHub authority requires all three controls:", DIM2, colour));
|
|
15020
|
+
for (const line of MANUAL_CONTROLS) out3(paint2(" " + line, DIM2, colour));
|
|
15005
15021
|
}
|
|
15006
15022
|
const commitPaths = [...new Set(wrote)].filter((path) => committableSetupPath(cwd, path));
|
|
15007
15023
|
if (commitPaths.length) {
|
|
15008
15024
|
status("NEXT", "Commit repository setup files: " + commitPaths.join(", "), "info");
|
|
15009
15025
|
}
|
|
15026
|
+
if (!head) {
|
|
15027
|
+
status("NEXT", "Create the initial repository commit before verify or the safe demo.", "info");
|
|
15028
|
+
}
|
|
15010
15029
|
if (!verifyCommand) {
|
|
15011
15030
|
status("NEXT", "Choose the test command TamperWard should trust for verification.", "info");
|
|
15012
15031
|
}
|
|
@@ -15136,10 +15155,9 @@ var init_onboard = __esm({
|
|
|
15136
15155
|
"Summary"
|
|
15137
15156
|
];
|
|
15138
15157
|
MANUAL_CONTROLS = [
|
|
15139
|
-
"
|
|
15140
|
-
"
|
|
15141
|
-
"
|
|
15142
|
-
" dismiss stale approvals when new commits are pushed"
|
|
15158
|
+
"required check: tamperward",
|
|
15159
|
+
"Code Owner review",
|
|
15160
|
+
"dismiss stale approvals when new commits are pushed"
|
|
15143
15161
|
];
|
|
15144
15162
|
ESC2 = "\x1B";
|
|
15145
15163
|
RESET2 = `${ESC2}[0m`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamperward",
|
|
3
|
-
"version": "2.23.
|
|
3
|
+
"version": "2.23.2",
|
|
4
4
|
"description": "The deterministic agent-integrity gate. One ruleset, evaluated on the actual diff/commands as a verdict, enforced everywhere a change can be made.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "hexrift",
|