@event4u/agent-config 15.0.0 → 16.0.0

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 (78) hide show
  1. package/.augment-plugin/marketplace.json +3 -3
  2. package/.augment-plugin/plugin.json +1 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CHANGELOG.md +142 -348
  5. package/dist/agent-src/commands/roadmap/create.md +3 -2
  6. package/dist/agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +50 -0
  7. package/dist/agent-src/rules/user-interaction.md +31 -30
  8. package/dist/agent-src/skills/error-handling-patterns/SKILL.md +9 -0
  9. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  10. package/dist/cli-delegate/{chunk-HZ52BRGG.js → chunk-H32DGUJH.js} +14 -89
  11. package/dist/cli-delegate/chunk-NUHLI2RX.js +80 -0
  12. package/dist/cli-delegate/{chunk-TYSY33MD.js → chunk-QJWAUMJW.js} +12 -2
  13. package/dist/cli-delegate/{chunk-2KKXJW25.js → chunk-S3VFXMTM.js} +1 -1
  14. package/dist/cli-delegate/cmd_conformance.js +831 -272
  15. package/dist/cli-delegate/cmd_explain.js +4 -2
  16. package/dist/cli-delegate/cmd_handoff.js +2 -2
  17. package/dist/cli-delegate/cmd_packs_active.js +2 -1
  18. package/dist/cli-delegate/cmd_session_recycle.js +2 -2
  19. package/dist/cli-delegate/cmd_settings_set.js +13 -0
  20. package/dist/discovery/deprecation-report.md +1 -1
  21. package/dist/discovery/discovery-manifest.json +5 -5
  22. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  23. package/dist/discovery/discovery-manifest.summary.md +1 -1
  24. package/dist/discovery/dormancy-report.md +1 -1
  25. package/dist/discovery/orphan-report.md +1 -1
  26. package/dist/discovery/packs.json +2 -2
  27. package/dist/discovery/trust-report.md +1 -1
  28. package/dist/discovery/workspaces.json +2 -2
  29. package/dist/hooks/dispatch.js +1274 -571
  30. package/dist/install/install.mjs +1 -0
  31. package/dist/mcp/registry-manifest.json +2 -2
  32. package/dist/mcp/server.json +2 -2
  33. package/dist/mcp/server.mjs +1218 -632
  34. package/dist/scripts/_lib/installed_lock.js +1 -1
  35. package/dist/server/io/yamlIO.js +50 -0
  36. package/package.json +1 -1
  37. package/src/config/continuity-surface.json +7 -0
  38. package/src/config/gate-violation-baselines.json +3 -3
  39. package/src/config/host-injection-effect.json +1 -1
  40. package/src/config/preamble-payload-budget.json +12 -7
  41. package/src/config/preamble-payload-exceptions.json +28 -0
  42. package/src/scripts/_dispatch.bash +3 -1
  43. package/src/scripts/_lib/base_ref_payload.ts +315 -0
  44. package/src/scripts/_lib/dropped_decision.ts +142 -0
  45. package/src/scripts/_lib/installed_lock.ts +1 -1
  46. package/src/scripts/_lib/measured_payload_ceiling.ts +424 -0
  47. package/src/scripts/_lib/payload_catalogue_completeness.ts +211 -0
  48. package/src/scripts/_lib/release_findings_ingest.ts +324 -0
  49. package/src/scripts/_lib/release_tag_dispatch.ts +63 -0
  50. package/src/scripts/_lib/review_baseline.ts +254 -0
  51. package/src/scripts/_lib/review_skipped_record.ts +61 -1
  52. package/src/scripts/_lib/standing_bound_ratchet.ts +216 -103
  53. package/src/scripts/_lib/turn_end_refusals.ts +51 -4
  54. package/src/scripts/check_beta_review_markers.ts +35 -4
  55. package/src/scripts/check_finding_dispositions.ts +167 -16
  56. package/src/scripts/check_held_object_arrivals.ts +381 -0
  57. package/src/scripts/check_preamble_payload_budget.ts +399 -122
  58. package/src/scripts/check_release_published.ts +1 -1
  59. package/src/scripts/check_reply_consistency.ts +86 -17
  60. package/src/scripts/hook_manifest.json +1 -1
  61. package/src/scripts/hook_manifest.yaml +39 -3
  62. package/src/scripts/hooks/block_kernel_rule_writes.ts +12 -2
  63. package/src/scripts/hooks/concern_registry.ts +2 -0
  64. package/src/scripts/hooks/end_review_nudge_hook.ts +101 -21
  65. package/src/scripts/hooks/review_baseline_hook.ts +130 -0
  66. package/src/scripts/hooks/turn_end_gate_hook.ts +232 -14
  67. package/src/scripts/hooks_doctor.ts +4 -1
  68. package/src/scripts/install.ts +1 -1
  69. package/src/scripts/interruption_report.ts +8 -2
  70. package/src/scripts/janitor.ts +8 -1
  71. package/src/scripts/measure_turn_end_gate.ts +302 -5
  72. package/src/scripts/release.ts +52 -64
  73. package/src/scripts/release_drill.ts +193 -14
  74. package/src/scripts/release_env.ts +1 -1
  75. package/src/scripts/release_publication.ts +1 -1
  76. package/src/scripts/report_held_object_arrivals.ts +456 -0
  77. package/src/scripts/sync_agent_settings.ts +140 -18
  78. package/src/server/io/yamlIO.ts +48 -0
@@ -365,6 +365,49 @@ function replaceFlatDottedKey(
365
365
  return { found: true, body: lines.join('\n') };
366
366
  }
367
367
 
368
+ /**
369
+ * Drop every top-level `a.b.c:` line for a path whose NESTED form the caller
370
+ * has just resolved.
371
+ *
372
+ * Which reader this preserves, because the two forms can disagree and only one
373
+ * of them is ever consulted: by YAML semantics `a.b.c` is reached by walking
374
+ * the `a` mapping, so a top-level key literally named "a.b.c" is a DIFFERENT
375
+ * path that no lookup of the dotted one visits. Removing it therefore changes
376
+ * no reader's answer — strict and lenient alike already resolve through the
377
+ * nesting — while leaving it keeps the one line a human scanning the file
378
+ * reads as the value, saying something the program never agreed with. It
379
+ * cannot self-heal either: the duplicate-key pass sees a single occurrence,
380
+ * and `mergeIntoTemplate` writes the nested side, so the line is permanent.
381
+ *
382
+ * The nested twin IS the safety argument, not a convenience. A flat `a.b:`
383
+ * standing ALONE is a key somebody may have meant — `mergeIntoTemplate`'s own
384
+ * fallback branch writes exactly that shape for a path the template lacks — and
385
+ * this function is never reached for one: the caller takes the
386
+ * `replaceFlatDottedKey` branch instead, which updates that line in place.
387
+ *
388
+ * Two bounds, each of which turns the sweep into a data-loss bug if dropped:
389
+ *
390
+ * - Two segments minimum. A one-segment path joins to a name with no dot, so
391
+ * the match below would hit the very line `replaceScalar` just wrote and
392
+ * delete the key the caller asked to set — a rewrite silently becoming a
393
+ * removal. Same guard, same reason, as `replaceFlatDottedKey`.
394
+ * - Top level only, the bound `replaceFlatDottedKey` also draws: an INDENTED
395
+ * `a.b:` is somebody else's child key (`parent:` / ` a.b:` means
396
+ * `parent['a.b']`), an unrelated path this sweep has no claim on.
397
+ */
398
+ function dropFlatDottedTwins(template: string, dottedPath: string[]): string {
399
+ if (dottedPath.length < 2) return template;
400
+ const flat = dottedPath.join('.');
401
+ const lines = template.split('\n');
402
+ const kept = lines.filter((line) => {
403
+ if (line.length !== line.trimStart().length) return true;
404
+ const m = /^([A-Za-z_][A-Za-z0-9_.-]*)\s*:/.exec(line);
405
+ return m === null || m[1] !== flat;
406
+ });
407
+ if (kept.length === lines.length) return template;
408
+ return kept.join('\n');
409
+ }
410
+
368
411
  /**
369
412
  * Apply every leaf change from `newValues` to `templateBody`. Paths that
370
413
  * are not present in the template are appended at the end. Comments are
@@ -383,6 +426,11 @@ export function mergeIntoTemplate(templateBody: string, newValues: Record<string
383
426
  // see `findScalarLine`. Writing the value it already holds is a hit.
384
427
  if (findScalarLine(body.split('\n'), sections, leaf) !== -1) {
385
428
  body = replaceScalar(body, entry.path, entry.value);
429
+ // The nested form won, so any flat twin of this same path is dead
430
+ // and stays dead. The probe above is what licenses the removal:
431
+ // without a nested key to resolve through, a flat `a.b:` is the
432
+ // real entry and the branch below owns it.
433
+ body = dropFlatDottedTwins(body, entry.path);
386
434
  continue;
387
435
  }
388
436
  // Not in the template's nested form. It may still be here as a flat