@dzhechkov/harness-core 0.8.2 → 0.8.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.
Files changed (81) hide show
  1. package/.dz-manifest.json +146 -58
  2. package/README.md +72 -2
  3. package/dist/cmd-usage.d.ts +148 -0
  4. package/dist/cmd-usage.d.ts.map +1 -0
  5. package/dist/cmd-usage.js +548 -0
  6. package/dist/cmd-usage.js.map +1 -0
  7. package/dist/compounding.d.ts +4 -0
  8. package/dist/compounding.d.ts.map +1 -1
  9. package/dist/compounding.js +6 -0
  10. package/dist/compounding.js.map +1 -1
  11. package/dist/contract-checklist.d.ts +123 -0
  12. package/dist/contract-checklist.d.ts.map +1 -0
  13. package/dist/contract-checklist.js +700 -0
  14. package/dist/contract-checklist.js.map +1 -0
  15. package/dist/feature-adr-checkpoints.d.ts +11 -2
  16. package/dist/feature-adr-checkpoints.d.ts.map +1 -1
  17. package/dist/feature-adr-checkpoints.js +37 -2
  18. package/dist/feature-adr-checkpoints.js.map +1 -1
  19. package/dist/feature-adr-routing.d.ts +58 -23
  20. package/dist/feature-adr-routing.d.ts.map +1 -1
  21. package/dist/feature-adr-routing.js +208 -59
  22. package/dist/feature-adr-routing.js.map +1 -1
  23. package/dist/guard.d.ts +25 -0
  24. package/dist/guard.d.ts.map +1 -1
  25. package/dist/guard.js +59 -1
  26. package/dist/guard.js.map +1 -1
  27. package/dist/index.d.ts +9 -2
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +8 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/loop-blobs.generated.js +8 -8
  32. package/dist/loop-blobs.generated.js.map +1 -1
  33. package/dist/loop-plan.d.ts +13 -1
  34. package/dist/loop-plan.d.ts.map +1 -1
  35. package/dist/loop-plan.js +15 -1
  36. package/dist/loop-plan.js.map +1 -1
  37. package/dist/loop-render.d.ts.map +1 -1
  38. package/dist/loop-render.js +51 -6
  39. package/dist/loop-render.js.map +1 -1
  40. package/dist/loop-trace.d.ts +20 -1
  41. package/dist/loop-trace.d.ts.map +1 -1
  42. package/dist/loop-trace.js +83 -1
  43. package/dist/loop-trace.js.map +1 -1
  44. package/dist/model-recommender.d.ts +8 -0
  45. package/dist/model-recommender.d.ts.map +1 -1
  46. package/dist/model-recommender.js +31 -4
  47. package/dist/model-recommender.js.map +1 -1
  48. package/dist/qe-bridge.d.ts.map +1 -1
  49. package/dist/qe-bridge.js +9 -0
  50. package/dist/qe-bridge.js.map +1 -1
  51. package/dist/restart-advisor.d.ts +103 -0
  52. package/dist/restart-advisor.d.ts.map +1 -0
  53. package/dist/restart-advisor.js +445 -0
  54. package/dist/restart-advisor.js.map +1 -0
  55. package/dist/slop-lint.d.ts +128 -0
  56. package/dist/slop-lint.d.ts.map +1 -0
  57. package/dist/slop-lint.js +607 -0
  58. package/dist/slop-lint.js.map +1 -0
  59. package/dist/workflow-run.d.ts.map +1 -1
  60. package/dist/workflow-run.js +18 -12
  61. package/dist/workflow-run.js.map +1 -1
  62. package/package.json +19 -15
  63. package/sbom.json +277 -57
  64. package/src/cmd-usage.ts +720 -0
  65. package/src/compounding.ts +13 -0
  66. package/src/contract-checklist.ts +973 -0
  67. package/src/deadwood-allowlist.json +80 -0
  68. package/src/feature-adr-checkpoints.ts +38 -2
  69. package/src/feature-adr-routing.ts +238 -55
  70. package/src/guard.ts +79 -1
  71. package/src/index.ts +81 -1
  72. package/src/loop-blobs.generated.ts +8 -8
  73. package/src/loop-plan.ts +36 -3
  74. package/src/loop-render.ts +50 -6
  75. package/src/loop-trace.ts +91 -2
  76. package/src/model-recommender.ts +35 -4
  77. package/src/qe-bridge.ts +9 -0
  78. package/src/restart-advisor.ts +579 -0
  79. package/src/slop-lint.ts +762 -0
  80. package/src/slop-markers.json +71 -0
  81. package/src/workflow-run.ts +18 -11
@@ -173,6 +173,8 @@ export interface CompoundingFacts {
173
173
  readonly nowTs: string;
174
174
  /** The evidence logs themselves — verified as hash chains (feature event-chain, ADR-001). */
175
175
  readonly evidenceLogs?: readonly EvidenceLogFact[];
176
+ /** Depth of the command-invocation corpus. `null` means no readable log, never zero-by-default. */
177
+ readonly cmdUsageDepthDays?: number | null;
176
178
  }
177
179
 
178
180
  // ── The report ──────────────────────────────────────────────────────
@@ -233,6 +235,8 @@ export interface InstrumentationHealth {
233
235
  /** True when every provided log verifies. Vacuously true when none were provided — that is why
234
236
  * {@link EvidenceChainHealth} carries the counts: "no logs" must not read like "all clean". */
235
237
  readonly chainsOk: boolean;
238
+ /** Independent observer for deadwood's fail-open write leg; null means no readable evidence. */
239
+ readonly cmdUsageDepthDays: number | null;
236
240
  }
237
241
 
238
242
  export interface CompoundingReport {
@@ -357,6 +361,10 @@ export function assembleCompoundingReport(facts: CompoundingFacts): CompoundingR
357
361
  applyLegLive: gapValid && gapMs <= APPLY_LEG_STALE_DAYS * 86_400_000,
358
362
  chains,
359
363
  chainsOk: chains.every((c) => c.ok),
364
+ cmdUsageDepthDays:
365
+ typeof facts.cmdUsageDepthDays === 'number' && Number.isFinite(facts.cmdUsageDepthDays)
366
+ ? Math.max(0, facts.cmdUsageDepthDays)
367
+ : null,
360
368
  };
361
369
 
362
370
  const improvedRules = trajectory.filter((t) => t.improved).length;
@@ -405,6 +413,11 @@ export function renderCompoundingReport(r: CompoundingReport): string {
405
413
  ` · ${c.chained} chained · ${c.preChainPrefix} pre-chain (uncovered)`,
406
414
  );
407
415
  }
416
+ out.push(
417
+ ` COMMAND USAGE: ${r.instrumentation.cmdUsageDepthDays === null
418
+ ? 'INSUFFICIENT_DATA (no readable .dz/cmd-usage.jsonl)'
419
+ : `${Math.floor(r.instrumentation.cmdUsageDepthDays)}d history`}`,
420
+ );
408
421
  if (r.instrumentation.chains.length > 0) out.push(` scope: ${EVENT_CHAIN_SCOPE}`);
409
422
  out.push('');
410
423
  out.push(` VERDICT: ${r.verdict}`);