runtrim 0.1.4 → 0.1.5
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/runtrim.js +25 -20
- package/package.json +1 -1
package/dist-cli/runtrim.js
CHANGED
|
@@ -32,7 +32,7 @@ import { execa as execa3 } from "execa";
|
|
|
32
32
|
// package.json
|
|
33
33
|
var package_default = {
|
|
34
34
|
name: "runtrim",
|
|
35
|
-
version: "0.1.
|
|
35
|
+
version: "0.1.4",
|
|
36
36
|
description: "CLI guard layer that scopes AI coding runs before they waste tokens.",
|
|
37
37
|
license: "MIT",
|
|
38
38
|
author: "RunTrim",
|
|
@@ -4770,24 +4770,26 @@ program.command("check").description("Check the latest run and evaluate agent ou
|
|
|
4770
4770
|
if (scope.outOfScopeFiles.length > 0) riskFlags.add("Potential outside-scope changes detected");
|
|
4771
4771
|
if (changedFiles.length > maxFiles) riskFlags.add(`File count exceeded scope limit (${maxFiles})`);
|
|
4772
4772
|
const verificationDebt = /* @__PURE__ */ new Set();
|
|
4773
|
-
if (
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4773
|
+
if (changedFiles.length > 0) {
|
|
4774
|
+
if (run.status === "guarded") verificationDebt.add("Run is still guarded and not checked.");
|
|
4775
|
+
if (!run.evaluation) verificationDebt.add("Changed files exist but no post-run check was recorded.");
|
|
4776
|
+
if (scope.sensitiveFiles.length > 0) verificationDebt.add("Sensitive files changed. Review and verify before continuing.");
|
|
4777
|
+
if (scope.forbiddenFiles.length > 0) verificationDebt.add("Forbidden files changed. Manual containment required.");
|
|
4778
|
+
if (changedFiles.length > maxFiles) verificationDebt.add("Too many files changed for one scoped run. Split the task.");
|
|
4779
|
+
if (lowerChanged.some((f) => /(^|\/)(package-lock\.json|pnpm-lock\.yaml|yarn\.lock)$/.test(f))) {
|
|
4780
|
+
verificationDebt.add("Lockfile changed. Confirm dependency intent.");
|
|
4781
|
+
}
|
|
4782
|
+
if (lowerChanged.some((f) => /(migration|migrations|schema|database)/.test(f))) {
|
|
4783
|
+
verificationDebt.add("Database or migration-related changes need explicit verification.");
|
|
4784
|
+
}
|
|
4785
|
+
if (lowerChanged.some((f) => /(middleware|auth|login|session|jwt|payment|billing|stripe|webhook)/.test(f))) {
|
|
4786
|
+
verificationDebt.add("Auth, middleware, payment, or webhook surface changed. Run focused verification.");
|
|
4787
|
+
}
|
|
4788
|
+
if (scope.outOfScopeFiles.length > 0) {
|
|
4789
|
+
verificationDebt.add("Some changed files appear outside declared relevant scope.");
|
|
4790
|
+
}
|
|
4791
|
+
for (const item of (_j = (_i = run.evaluation) == null ? void 0 : _i.missingProofItems) != null ? _j : []) verificationDebt.add(item);
|
|
4789
4792
|
}
|
|
4790
|
-
for (const item of (_j = (_i = run.evaluation) == null ? void 0 : _i.missingProofItems) != null ? _j : []) verificationDebt.add(item);
|
|
4791
4793
|
let nextSafeAction = "Run is ready to continue.";
|
|
4792
4794
|
if (scope.forbiddenFiles.length > 0) {
|
|
4793
4795
|
nextSafeAction = "Stop and inspect forbidden files before continuing.";
|
|
@@ -5103,7 +5105,7 @@ program.command("panel").description("Open local RunTrim browser panel").option(
|
|
|
5103
5105
|
});
|
|
5104
5106
|
});
|
|
5105
5107
|
program.command("memory").description("Show project memory and latest next safe prompt").option("--prompt", "Print only latest next safe prompt").option("--full", "Print full memory markdown").action(async (options) => {
|
|
5106
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
5108
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
5107
5109
|
const cwd = process.cwd();
|
|
5108
5110
|
console.log("");
|
|
5109
5111
|
console.log(BOLD("RunTrim") + DIM(" memory"));
|
|
@@ -5221,7 +5223,10 @@ program.command("memory").description("Show project memory and latest next safe
|
|
|
5221
5223
|
}
|
|
5222
5224
|
console.log("");
|
|
5223
5225
|
console.log(BOLD("Continuation"));
|
|
5224
|
-
|
|
5226
|
+
const noChangesState = status === "no_changes_detected" || ((_r = (_q = (_n = latestRun.checkSummary) == null ? void 0 : _n.changedFilesCount) != null ? _q : (_p = (_o = latestRun.evaluation) == null ? void 0 : _o.changedFiles) == null ? void 0 : _p.length) != null ? _r : 0) === 0;
|
|
5227
|
+
if (noChangesState) {
|
|
5228
|
+
console.log(chalk.white("No continuation prompt needed yet. Run `runtrim continue --reason usage_limit` when context runs out."));
|
|
5229
|
+
} else if (latestPrompt) {
|
|
5225
5230
|
const compact = latestPrompt.replace(/\s+/g, " ").trim();
|
|
5226
5231
|
const isDrift = /scope drift detected/i.test(compact);
|
|
5227
5232
|
if (isDrift) {
|