nerdsystem 0.0.26 → 0.0.27

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.
@@ -192,4 +192,4 @@ export async function init(dir, args) {
192
192
  log.ok(`Ready. Next:\n cd ${dir}\n pnpm install\n nerd dev\n\nThen open the folder in your coding agent and ask it to build the first feature; the nerdsystem skill walks it through.\nDeploys go to ${project.url}`);
193
193
  }
194
194
  // Kept in sync with packages/sdk/package.json by the release script.
195
- const SDK_VERSION = "0.0.26";
195
+ const SDK_VERSION = "0.0.27";
@@ -16,6 +16,8 @@ export type ReviewOutcome = {
16
16
  platformRead: boolean;
17
17
  /** Whose review the findings on file come from. */
18
18
  kind: "platform" | "session";
19
+ /** Findings recorded as real and deliberately left as they are. Counted, not listed: there is nothing to do about them. */
20
+ leftAsIs: number;
19
21
  } | {
20
22
  status: "skipped";
21
23
  reason: string;
@@ -33,16 +33,22 @@ export async function platformReview(api, sourcePath, dashboard) {
33
33
  }
34
34
  const kind = review.kind === "session" ? "session" : "platform";
35
35
  if (review.status !== "done")
36
- return { status: "declined", findings: [], dashboard, platformRead, kind };
36
+ return { status: "declined", findings: [], dashboard, platformRead, kind, leftAsIs: 0 };
37
37
  const findings = [];
38
+ let leftAsIs = 0;
38
39
  for (const f of review.findings ?? []) {
39
40
  const rule = typeof f.rule_id === "string" && f.rule_id.startsWith("review/") ? RULES[f.rule_id] : undefined;
40
41
  // A type this version of nerd does not know is left out rather than shown with words from elsewhere.
41
42
  if (!rule || typeof f.file !== "string" || !/^[\w./@-]{1,200}$/.test(f.file) || !Number.isInteger(f.line))
42
43
  continue;
44
+ // Recorded as deliberately left: not open, and not something to act on after a deploy.
45
+ if (f.leftAsIs === true) {
46
+ leftAsIs++;
47
+ continue;
48
+ }
43
49
  findings.push({ rule_id: f.rule_id, severity: rule.severity, audience: rule.audience, file: f.file, line: f.line, risk: rule.risk, fix: rule.fix });
44
50
  }
45
- return { status: "done", findings, dashboard, platformRead, kind };
51
+ return { status: "done", findings, dashboard, platformRead, kind, leftAsIs };
46
52
  }
47
53
  export function printReview(r) {
48
54
  if (r.status === "skipped") {
@@ -54,11 +60,12 @@ export function printReview(r) {
54
60
  return;
55
61
  }
56
62
  const whose = r.platformRead ? "nerdsystem read the code itself after this deploy" : r.kind === "session" ? "from the review this app's agent last reported" : "from nerdsystem's last own read of the code";
63
+ const left = r.leftAsIs ? `; ${r.leftAsIs} known and left as ${r.leftAsIs === 1 ? "it is" : "they are"}` : "";
57
64
  if (!r.findings.length) {
58
- log.ok(`Review: nothing open (${whose}). A plain-language summary for the person is at ${r.dashboard}`);
65
+ log.ok(`Review: nothing open (${whose}${left}). A plain-language summary for the person is at ${r.dashboard}`);
59
66
  return;
60
67
  }
61
- log.warn(`Review: ${r.findings.length} thing(s) open (${whose}). A review is a second opinion and can be wrong, so check each one against the code before changing anything. Say what you did about them in the next \`nerd review report\`.`);
68
+ log.warn(`Review: ${r.findings.length} thing(s) open (${whose}${left}). A review is a second opinion and can be wrong, so check each one against the code before changing anything. Say what you did about them in the next \`nerd review report\`.`);
62
69
  for (const f of r.findings) {
63
70
  log.info(` ${f.severity === "info" ? "·" : "!"} ${f.rule_id} ${f.file}:${f.line}${f.audience === "human" ? " (for the person to decide)" : ""}`);
64
71
  log.info(` ${f.risk}`);
@@ -115,14 +115,14 @@ export function checklistText(c) {
115
115
  if (c.open.length) {
116
116
  lines.push("Open from earlier reviews. Check each against the code as it is now and answer it in the report:");
117
117
  for (const f of c.open)
118
- lines.push(`- ${f.rule_id} at ${f.file}:${f.line}${f.origin === "platform" ? " (from nerdsystem's own read)" : ""}${f.leftAsIs ? " (recorded as left as it is; it stays that way unless you report it differently)" : ""}`);
118
+ lines.push(`- ${f.rule_id} at ${f.file}:${f.line}${f.origin === "platform" ? " (first raised by nerdsystem's own read)" : ""}${f.leftAsIs ? " (recorded as left as it is; it stays that way unless you report it differently)" : ""}`);
119
119
  lines.push("");
120
120
  }
121
121
  lines.push("What to look for:");
122
122
  for (const r of c.rules) {
123
123
  lines.push(`- ${r.rule_id}: ${r.title}${r.audience === "human" ? " [for the person to decide]" : ""}`, ` Look for: ${r.lookFor}`, ` Fix: ${r.fix}`);
124
124
  }
125
- lines.push("", `The report, written to ${c.reportFile}:`, JSON.stringify(c.format, null, 2), "", "- findings: what is still in the code after your fixes and still needs someone to act or decide, each with the rule, the file, and the line that shows it. Leave it empty when there is nothing. A finding marked [for the person to decide] stays here until they have answered.", "- leftAsIs: what is real and deliberately left as it is, because the person decided so or because the rule's own advice is not to change working code for it. It is shown to the owner, kept on later reports, and not announced again to each new session.", "- fixed: what this review found and you then fixed, including findings from the open list above. If you fixed only part of one, list what remains under findings (or leftAsIs) at the line that still shows it, and do not list it as fixed.", "- dismissed: only for a finding from nerdsystem's own read that you checked against the code and that does not apply. The owner sees this as your judgement, so use it when you are sure.", "- A finding from nerdsystem's own read that the report does not mention stays open.", "- summary, does, missing are for the owner and are shown on their dashboard as written. Plain words only.", "", "Report what you found, not what would look good. The report is stored as this agent's own review, it never decides whether a deploy goes out, and a clean report that nerdsystem's own read later contradicts is recorded as a miss.");
125
+ lines.push("", `The report, written to ${c.reportFile}:`, JSON.stringify(c.format, null, 2), "", "- findings: what is still in the code after your fixes and still needs someone to act or decide, each with the rule, the file, and the line that shows it. Leave it empty when there is nothing. A finding marked [for the person to decide] stays here until they have answered.", "- leftAsIs: what is real and deliberately left as it is, because the person decided so or because the rule's own advice is not to change working code for it. Any finding can go here, whoever first raised it. It is shown to the owner, kept on later reports, and not announced again to each new session.", "- fixed: what this review found and you then fixed, including findings from the open list above. If you fixed only part of one, list what remains under findings (or leftAsIs) at the line that still shows it, and do not list it as fixed.", "- dismissed: only for a finding from nerdsystem's own read that you checked against the code and that does not apply. The owner sees this as your judgement, so use it when you are sure.", "- A finding from nerdsystem's own read that the report does not mention stays open.", "- summary, does, missing are for the owner and are shown on their dashboard as written. Plain words only.", "", "Report what you found, not what would look good. The report is stored as this agent's own review, it never decides whether a deploy goes out, and a clean report that nerdsystem's own read later contradicts is recorded as a miss.");
126
126
  return lines.join("\n");
127
127
  }
128
128
  /** `nerd review checklist`: what the agent reads before it reviews. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nerdsystem",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "description": "nerd: start, check, and deploy a web app on nerdsystem from the terminal or a coding agent.",
5
5
  "type": "module",
6
6
  "bin": {