@forwardimpact/libwiki 0.2.4 → 0.2.6

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/README.md CHANGED
@@ -94,8 +94,7 @@ on any failure. Text output: `WARN ...` and `FAIL ...` lines plus a
94
94
  `RESULT: ...` trailer. JSON output:
95
95
 
96
96
  ```json
97
- { "result": "pass|fail", "failures": [...], "warnings": [...],
98
- "grace_active": false, "grace_until": null }
97
+ { "result": "pass|fail", "failures": [...], "warnings": [...] }
99
98
  ```
100
99
 
101
100
  Each finding carries a stable `id` for filtering. The catalogue lives in
package/bin/fit-wiki.js CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import "@forwardimpact/libpreflight/node22";
4
+
3
5
  import { readFileSync } from "node:fs";
4
6
  import { createCli } from "@forwardimpact/libcli";
5
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forwardimpact/libwiki",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Wiki lifecycle primitives — stable memory for agent teams so coordination persists across sessions.",
5
5
  "keywords": [
6
6
  "wiki",
@@ -47,6 +47,7 @@
47
47
  "dependencies": {
48
48
  "@forwardimpact/libcli": "^0.1.0",
49
49
  "@forwardimpact/libconfig": "^0.1.77",
50
+ "@forwardimpact/libpreflight": "^0.1.0",
50
51
  "@forwardimpact/libutil": "^0.1.0",
51
52
  "@forwardimpact/libxmr": "^1.1.0"
52
53
  },
@@ -55,7 +56,7 @@
55
56
  },
56
57
  "engines": {
57
58
  "bun": ">=1.2.0",
58
- "node": ">=18.0.0"
59
+ "node": ">=22.0.0"
59
60
  },
60
61
  "publishConfig": {
61
62
  "access": "public"
@@ -13,11 +13,10 @@ function applyRule(rule, subject, ctx) {
13
13
  if (rule.when && !rule.when(subject, ctx)) return [];
14
14
  const result = rule.check(subject, ctx);
15
15
  if (result == null) return [];
16
- const level = rule.graceDowngrade && ctx.grace ? "warn" : rule.severity;
17
16
  const items = Array.isArray(result) ? result : [result];
18
17
  return items.map((item) => ({
19
18
  id: rule.id,
20
- level,
19
+ level: rule.severity,
21
20
  path: subject.path ?? null,
22
21
  message: rule.message(subject, item, ctx),
23
22
  }));
@@ -22,8 +22,8 @@ export function emitText(findings) {
22
22
  return lines.join("\n") + "\n";
23
23
  }
24
24
 
25
- /** Render findings as a JSON document with grace-window metadata from ctx. */
26
- export function emitJson(findings, ctx) {
25
+ /** Render findings as a JSON document. */
26
+ export function emitJson(findings) {
27
27
  const { failures, warnings } = partition(findings);
28
28
  return (
29
29
  JSON.stringify(
@@ -31,8 +31,6 @@ export function emitJson(findings, ctx) {
31
31
  result: failures.length === 0 ? "pass" : "fail",
32
32
  failures,
33
33
  warnings,
34
- grace_active: ctx.grace,
35
- grace_until: ctx.graceUntil,
36
34
  },
37
35
  null,
38
36
  2,
@@ -212,7 +212,6 @@ export const RULES = [
212
212
  id: "summary.line-budget",
213
213
  scope: "summary",
214
214
  severity: "fail",
215
- graceDowngrade: true,
216
215
  check: lineBudget(SUMMARY_LINE_BUDGET),
217
216
  message: (s, r) =>
218
217
  `budget: ${s.path} has ${r.value} lines (limit ${SUMMARY_LINE_BUDGET})`,
@@ -221,7 +220,6 @@ export const RULES = [
221
220
  id: "summary.word-budget",
222
221
  scope: "summary",
223
222
  severity: "fail",
224
- graceDowngrade: true,
225
223
  check: wordBudget(SUMMARY_WORD_BUDGET),
226
224
  message: (s, r) =>
227
225
  `budget: ${s.path} has ${r.value} words (limit ${SUMMARY_WORD_BUDGET})`,
@@ -272,7 +270,6 @@ export const RULES = [
272
270
  id: "decision-block.heading-within-5",
273
271
  scope: "weekly-log-main",
274
272
  severity: "fail",
275
- graceDowngrade: true,
276
273
  check: decisionWithin5({
277
274
  entryRe: /^## \d{4}-\d{2}-\d{2}(?:[\s(].*)?$/,
278
275
  requiredLine: DECISION_HEADING,
@@ -173,7 +173,7 @@ export function resolveScope(scopeKey, ctx) {
173
173
  }
174
174
 
175
175
  /** Build the audit context: classifies and loads every wiki file once. */
176
- export function buildContext({ wikiRoot, today, graceUntil }) {
176
+ export function buildContext({ wikiRoot, today }) {
177
177
  const subjects = {
178
178
  summary: [],
179
179
  "weekly-log-main": [],
@@ -187,8 +187,6 @@ export function buildContext({ wikiRoot, today, graceUntil }) {
187
187
  return {
188
188
  wikiRoot,
189
189
  today,
190
- grace: Boolean(graceUntil && graceUntil >= today),
191
- graceUntil: graceUntil ?? null,
192
190
  subjects,
193
191
  memory: loadMemory(wikiRoot),
194
192
  storyboard: loadStoryboard(wikiRoot, today),
@@ -12,13 +12,12 @@ export function runAuditCommand(values, _args, _cli) {
12
12
  const projectRoot = finder.findProjectRoot(process.cwd());
13
13
  const wikiRoot = values["wiki-root"] || path.join(projectRoot, "wiki");
14
14
  const today = values.today || new Date().toISOString().slice(0, 10);
15
- const graceUntil = process.env.FIT_WIKI_AUDIT_GRACE_UNTIL || null;
16
15
 
17
- const ctx = buildContext({ wikiRoot, today, graceUntil });
16
+ const ctx = buildContext({ wikiRoot, today });
18
17
  const findings = runAudit(RULES, ctx);
19
18
 
20
19
  process.stdout.write(
21
- values.format === "json" ? emitJson(findings, ctx) : emitText(findings),
20
+ values.format === "json" ? emitJson(findings) : emitText(findings),
22
21
  );
23
22
 
24
23
  if (findings.some((f) => f.level === "fail")) process.exit(1);