@inerrata-corporation/errata 2.0.22-dev.4130 → 2.0.22-dev.4148

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.
@@ -14855,6 +14855,542 @@ function normalizeParam(v) {
14855
14855
  return v;
14856
14856
  }
14857
14857
 
14858
+ // ../../packages/local-shared/src/tag-grammar.ts
14859
+ var TAG_CANONICAL_ID_PREFIXES = ["pat", "sol", "drc", "dcause", "dfix", "dprob", "dvuln", "prob", "claim", "err"];
14860
+ var TAG_HANDLE_SOURCE = String.raw`\[([a-z0-9][\w-]{0,80})\]|((?:${TAG_CANONICAL_ID_PREFIXES.join("|")})_[0-9a-f]{6,})`;
14861
+ var TAG_THREAD_SOURCE = String.raw`#([a-z][\w-]{0,63})`;
14862
+ var TAG_PLACEHOLDER_HANDLES = /* @__PURE__ */ new Set([
14863
+ "handle",
14864
+ "its-handle",
14865
+ "another",
14866
+ "a-third",
14867
+ "h",
14868
+ "h1",
14869
+ "h2",
14870
+ "id",
14871
+ "its-id",
14872
+ "a",
14873
+ "b",
14874
+ "\u2026",
14875
+ "..."
14876
+ ]);
14877
+ var TAG_EXAMPLES = {
14878
+ prior: (ref) => `([${ref}])`,
14879
+ problem: () => `[!one line on what's wrong]`,
14880
+ vulnerability: () => `[!vuln: who can do what; observed basis @ path:line]`,
14881
+ suspectedVulnerability: () => `[?vuln: consequence; missing check]`,
14882
+ vulnerabilityThread: () => `[!#v vuln: finding here]`,
14883
+ fix: (ref) => `(fix:[${ref}])`,
14884
+ // CONSTRAINT — the native capture path for a DIFFUSE problem (a constraint/tension/
14885
+ // conflict that shaped a decision). Free text, attaches to the decision sentence the
14886
+ // agent is already writing. Full rationale in the constraint note below + prior-tags.ts.
14887
+ constraint: () => `(constraint: the limitation that forced it)`,
14888
+ // TRIAGE — routes the problem/symptom in scope to its cause. `(cause:[handle])`
14889
+ // links to a cited RootCause/Solution node; `(cause: free text)` mints a RootCause
14890
+ // from the text. Harvested in prior-tags.ts → engine.ts (see the triage note below).
14891
+ triage: (ref) => `(cause:[${ref}])`,
14892
+ // Unlike a bare cause citation, this handle names the Problem being explained.
14893
+ triageExplain: (ref) => `(cause:[${ref}] the mechanism)`,
14894
+ // The MINT form — free-text cause that mints a RootCause. Prime-time surfacing
14895
+ // (recallForFile) pastes this next to an open Problem that has no cause yet, so the
14896
+ // diagnostic moment is cued when the agent is looking at the problem. Kept here so
14897
+ // the grammar can't drift from parseInlineTags' `(cause: …)` acceptance.
14898
+ triageMint: () => `(cause: why it happens)`,
14899
+ // THREAD forms — the witness-declared symptom↔cause/fix binding. A `#id` on the
14900
+ // flag names the diagnosis thread; the same `#id` on a later verb binds to it
14901
+ // explicitly (across sentences AND turns), replacing proximity guessing. Adjacent
14902
+ // tags never need one — the id is for diagnoses that unfold over distance.
14903
+ problemThread: () => `[!#slug one line on what's wrong]`,
14904
+ causeThread: () => `(cause:#slug the mechanism)`,
14905
+ fixThread: (thread = "slug") => `(fix:#${thread} what you changed)`,
14906
+ // ATTEMPT arc — what's being tried and what didn't work. A failed attempt is a
14907
+ // witnessed NEGATIVE result: it saves the next agent the same dead end.
14908
+ tried: () => `(tried: the approach you're attempting)`,
14909
+ failed: () => `(failed: what didn't work and the dead end it rules out)`,
14910
+ // `(failed:[h] …)` on a shown SOLUTION — the refute-by-failure form the context render teaches.
14911
+ failedCite: (ref) => `(failed:[${ref}] what came back)`,
14912
+ // LINK verbs (AC epic) — bind the problem in scope to CANONICAL priors and
14913
+ // abstractions. Multi-target by design: single links are weak; ~3 links to 3
14914
+ // DIFFERENT relevant priors is the target shape (see linkBullet).
14915
+ instance: (ref) => `(instance:[${ref}],[another],[a-third])`,
14916
+ pattern: () => `(pattern: name the general shape)`,
14917
+ // DOMAIN — the abstract area a problem is about; the concept layer an
14918
+ // anchor-less problem clusters on. Mints/resolves a Domain by name.
14919
+ domain: () => `(domain: The Area)`,
14920
+ // PACKAGE/COMPONENT — agent-named public anchors (OM-agent-anchors): the
14921
+ // package a problem is ABOUT (even when not a dependency) and the
14922
+ // framework/product-level unit it concerns. Public spine anchors → the
14923
+ // knowledge can cross to the collective.
14924
+ package: () => `(package: the-package-name)`,
14925
+ component: () => `(component: The Component)`,
14926
+ aids: (ref) => `(aids:[${ref}])`,
14927
+ // SOLUTION-STRUCTURE (SS-structure) — taught in the link bullet; Solution→Solution.
14928
+ buildsOn: (ref) => `(builds-on:[${ref}])`,
14929
+ supersedes: (ref) => `(supersedes:[${ref}])`,
14930
+ alternative: (ref) => `(alternative:[${ref}])`,
14931
+ // VERDICT (VS-verdict-tags) — a judgment on a SHOWN prior, distinct from leaning on it.
14932
+ // `confirm` rides the corroborate channel (it held); `refute` the contradict channel
14933
+ // (it's wrong / didn't hold) and REQUIRES a reason. This is the inline producer the
14934
+ // evidence channels lacked — refute sat dead (contradictionPressure 0) until now, while
14935
+ // lean-on corroboration lived, because only corroboration had an inline path. Grammar
14936
+ // single-sourced with parseInlineTags' CONFIRM_PREFIX/REFUTE_PREFIX.
14937
+ confirm: (ref) => `(confirm:[${ref}])`,
14938
+ refute: (ref) => `(refute:[${ref}] one line why)`,
14939
+ // RETRACT — "not a real problem": the errata-resolved block with a disposition
14940
+ // (parseDesignResolutions, turn.ts). No inline form exists; the block is the grammar.
14941
+ retract: (id) => ["```errata-resolved", `id: ${id}`, "disposition: false_positive", "reason: why it was never a real problem", "```"].join("\n")
14942
+ };
14943
+ var P = "Problem";
14944
+ var S = "Solution";
14945
+ var RC = "RootCause";
14946
+ var CITE_LOWERING = [
14947
+ { target: RC, writes: [{ from: P, edge: "CAUSED_BY", to: RC }] },
14948
+ { target: S, writes: [{ from: P, edge: "SOLVED_BY", to: S }] },
14949
+ { target: "Pattern", writes: [{ from: P, edge: "INSTANCE_OF", to: "Pattern" }, { from: "Pattern", edge: "ANCHORED_AT", to: "File" }], note: "cite-anchor promotion after 2 sessions", decision: "d", knownViolation: { edge: "ANCHORED_AT", finding: "motif cite-anchor promotion writes a refused ANCHORED_AT" } },
14950
+ { target: "Package", writes: [{ from: P, edge: "DEPENDS_ON", to: "Package" }] },
14951
+ { target: "Language", writes: [{ from: P, edge: "OCCURS_IN", to: "Language" }] },
14952
+ { target: "Tool", writes: [{ from: P, edge: "CONCERNS", to: "Tool" }] },
14953
+ { target: "Component", writes: [{ from: P, edge: "CONCERNS", to: "Component" }] },
14954
+ { target: P, writes: [{ from: P, edge: "RELATES_TO", to: P }, { from: P, edge: "ANCHORED_AT", to: "File" }], note: "corroboration witness + cite-anchor promotion" },
14955
+ { target: "AntiPattern", writes: [{ from: P, edge: "RELATES_TO", to: "AntiPattern" }, { from: "AntiPattern", edge: "ANCHORED_AT", to: "File" }], decision: "e", knownViolation: { edge: "ANCHORED_AT", finding: "motif cite-anchor promotion writes a refused ANCHORED_AT" } },
14956
+ { target: "Technique", writes: [{ from: P, edge: "RELATES_TO", to: "Technique" }, { from: "Technique", edge: "ANCHORED_AT", to: "File" }], decision: "e", knownViolation: { edge: "ANCHORED_AT", finding: "motif cite-anchor promotion writes a refused ANCHORED_AT" } },
14957
+ { target: "Weakness", writes: [{ from: P, edge: "RELATES_TO", to: "Weakness" }], decision: "e" },
14958
+ { target: "Domain", writes: [{ from: P, edge: "RELATES_TO", to: "Domain" }], decision: "e" },
14959
+ { target: "Claim", writes: [{ from: P, edge: "RELATES_TO", to: "Claim" }, { from: "Claim", edge: "ANCHORED_AT", to: "File" }] }
14960
+ ];
14961
+ var INSTANCE_LOWERING = [
14962
+ { target: "Pattern", writes: [{ from: P, edge: "INSTANCE_OF", to: "Pattern" }] },
14963
+ { target: P, writes: [{ from: P, edge: "RELATES_TO", to: P }] },
14964
+ { target: S, writes: [{ from: P, edge: "SOLVED_BY", to: S }], note: "an instance cite on a Solution claims the problem is solved by it", decision: "a" },
14965
+ { target: RC, writes: [{ from: P, edge: "CAUSED_BY", to: RC }] },
14966
+ { target: "AntiPattern", writes: [{ from: P, edge: "RELATES_TO", to: "AntiPattern" }], decision: "e" },
14967
+ { target: "Technique", writes: [{ from: P, edge: "RELATES_TO", to: "Technique" }], decision: "e" },
14968
+ { target: "Weakness", writes: [{ from: P, edge: "RELATES_TO", to: "Weakness" }], decision: "e" },
14969
+ { target: "Domain", writes: [{ from: P, edge: "RELATES_TO", to: "Domain" }], decision: "e" },
14970
+ { target: "Package", writes: [{ from: P, edge: "DEPENDS_ON", to: "Package" }] },
14971
+ { target: "Component", writes: [{ from: P, edge: "CONCERNS", to: "Component" }] }
14972
+ ];
14973
+ var TRIAGE_TO_RC = [
14974
+ { from: P, edge: "TRIAGED_BY", to: "Triage" },
14975
+ { from: "Triage", edge: "INDICATES", to: RC },
14976
+ { from: P, edge: "CAUSED_BY", to: RC }
14977
+ ];
14978
+ var TAG_VERBS = [
14979
+ {
14980
+ verb: "cite",
14981
+ form: "citation",
14982
+ opener: "(",
14983
+ kinds: ["prior"],
14984
+ args: "handles",
14985
+ thread: false,
14986
+ handleRequired: true,
14987
+ lowering: CITE_LOWERING,
14988
+ examples: ["prior"],
14989
+ hint: "cite a shown prior you leaned on: ([its-handle]) \u2014 handles only, no prose inside the parens",
14990
+ taught: "taught"
14991
+ },
14992
+ {
14993
+ verb: "!",
14994
+ form: "flag",
14995
+ opener: "[!",
14996
+ kinds: ["problem", "triage", "vulnerability", "fix", "prior"],
14997
+ args: "flag-body",
14998
+ thread: true,
14999
+ minText: 8,
15000
+ qualifiers: [
15001
+ { name: "vuln", taught: true, note: "[!vuln: \u2026] \u2192 Vulnerability (asserted)" },
15002
+ { name: "fixed", taught: false, note: "[!fixed: X] \u2192 read as a self-found fix" },
15003
+ { name: "resolved", taught: false, note: "[!resolved: X] \u2192 read as a self-found fix" }
15004
+ ],
15005
+ lowering: [
15006
+ { target: P, writes: [], note: "mints a Problem; `@ path[:line]` anchors it (ANCHORED_AT to code)" },
15007
+ { target: RC, writes: [...TRIAGE_TO_RC, { from: RC, edge: "CAUSED_BY", to: RC }], note: "`<-` segments: first \u2192 triage route, later \u2192 RootCause chain" },
15008
+ { target: "Vulnerability", writes: [], note: "[!vuln: \u2026]; `<-` causes stay on the finding (vulnerabilityCauses)" }
15009
+ ],
15010
+ examples: ["problem", "problemThread", "vulnerability", "vulnerabilityThread"],
15011
+ hint: "flag a problem on one line: [!what's wrong @ path:42]; fold causes with <- ; a fix goes in (fix: \u2026), not [!fixed: \u2026]",
15012
+ taught: "taught"
15013
+ },
15014
+ {
15015
+ verb: "?",
15016
+ form: "flag",
15017
+ opener: "[?",
15018
+ kinds: ["todo", "vulnerability"],
15019
+ args: "flag-body",
15020
+ thread: true,
15021
+ minText: 8,
15022
+ qualifiers: [{ name: "vuln", taught: true, note: "[?vuln: \u2026] \u2192 Vulnerability (suspected)" }],
15023
+ lowering: [{ target: P, writes: [], note: "mints a todo Problem; a fix can close it today", decision: "g" }],
15024
+ examples: ["suspectedVulnerability"],
15025
+ hint: "[?\u2026] marks an open question / todo; [?vuln: consequence; missing check] a suspected vulnerability",
15026
+ taught: "untaught",
15027
+ taughtBy: "only the [?vuln:] form is taught; the bare [?todo] form is not",
15028
+ decisions: ["g"]
15029
+ },
15030
+ {
15031
+ verb: "fix",
15032
+ form: "verb",
15033
+ opener: "(fix:",
15034
+ kinds: ["fix"],
15035
+ args: "handles-text",
15036
+ thread: true,
15037
+ minText: 12,
15038
+ lowering: [
15039
+ { target: P, writes: [{ from: P, edge: "SOLVED_BY", to: S }], note: "closes the Problem; a note \u226512 chars mints the Solution" },
15040
+ { target: "Vulnerability", writes: [{ from: "Vulnerability", edge: "SOLVED_BY", to: S }] },
15041
+ { target: RC, writes: [], note: "dropped: 'fix tag went nowhere' (not a Problem); no tag writes FIXED_BY", decision: "f" }
15042
+ ],
15043
+ examples: ["fix", "fixThread"],
15044
+ hint: "one fix per tag: (fix:[its-handle]) or (fix:#thread what you changed) \u2014 put the cause in its own (cause: \u2026)",
15045
+ taught: "taught",
15046
+ decisions: ["f"]
15047
+ },
15048
+ {
15049
+ verb: "cause",
15050
+ form: "verb",
15051
+ opener: "(cause:",
15052
+ kinds: ["triage"],
15053
+ args: "handles-text",
15054
+ thread: true,
15055
+ minText: 8,
15056
+ lowering: [
15057
+ { target: RC, writes: TRIAGE_TO_RC },
15058
+ { target: P, writes: [{ from: P, edge: "TRIAGED_BY", to: "Triage" }, { from: "Triage", edge: "INDICATES", to: RC }, { from: P, edge: "CAUSED_BY", to: RC }], note: "(cause:[problem] mechanism) \u2014 the cited Problem is the symptom; the mechanism mints the RootCause" },
15059
+ { target: S, writes: [{ from: P, edge: "TRIAGED_BY", to: "Triage" }, { from: "Triage", edge: "INDICATES", to: S }], decision: "b", knownViolation: { edge: "INDICATES", finding: "(cause:[solution]) writes a refused INDICATES \u2192 Solution" } }
15060
+ ],
15061
+ examples: ["triage", "triageExplain", "triageMint", "causeThread"],
15062
+ hint: "(cause: the mechanism you'd change) or (cause:[root-cause-handle]); bind a distant symptom with (cause:#thread \u2026)",
15063
+ taught: "taught",
15064
+ decisions: ["b"]
15065
+ },
15066
+ {
15067
+ verb: "constraint",
15068
+ form: "verb",
15069
+ opener: "(constraint:",
15070
+ kinds: ["constraint"],
15071
+ args: "text",
15072
+ thread: false,
15073
+ minText: 8,
15074
+ textRequired: true,
15075
+ lowering: [{ target: P, writes: [], note: "mints a constraint-kind Problem" }],
15076
+ examples: ["constraint"],
15077
+ hint: "(constraint: the limitation that forced the decision)",
15078
+ taught: "taught"
15079
+ },
15080
+ {
15081
+ verb: "tried",
15082
+ form: "verb",
15083
+ opener: "(tried:",
15084
+ kinds: ["attempt"],
15085
+ args: "text",
15086
+ thread: true,
15087
+ minText: 8,
15088
+ textRequired: true,
15089
+ lowering: [{ target: P, writes: [], note: "journals an attempt on the bound problem" }],
15090
+ examples: ["tried"],
15091
+ hint: "(tried: the approach) \u2014 bind with (tried:#thread \u2026)",
15092
+ taught: "taught"
15093
+ },
15094
+ {
15095
+ verb: "failed",
15096
+ form: "verb",
15097
+ opener: "(failed:",
15098
+ kinds: ["failure"],
15099
+ args: "handles-text",
15100
+ thread: true,
15101
+ minText: 8,
15102
+ textRequired: true,
15103
+ lowering: [
15104
+ { target: P, writes: [], note: "journals a failed attempt on the bound problem" },
15105
+ { target: S, writes: [], note: "(failed:[h]) refutes the cited prior (contradictionPressure); skips the label gate today", decision: "j" }
15106
+ ],
15107
+ examples: ["failed", "failedCite"],
15108
+ hint: "(failed: what didn't work); (failed:[solution] what came back) refutes a shown fix",
15109
+ taught: "taught",
15110
+ decisions: ["j"]
15111
+ },
15112
+ {
15113
+ verb: "instance",
15114
+ form: "verb",
15115
+ opener: "(instance:",
15116
+ kinds: ["instance"],
15117
+ args: "handles",
15118
+ thread: false,
15119
+ handleRequired: true,
15120
+ lowering: INSTANCE_LOWERING,
15121
+ examples: ["instance"],
15122
+ hint: "(instance:[h1],[h2],[h3]) \u2014 ~3 DIFFERENT shown priors this problem instantiates; handles only",
15123
+ taught: "taught",
15124
+ decisions: ["a", "e"]
15125
+ },
15126
+ {
15127
+ verb: "pattern",
15128
+ form: "verb",
15129
+ opener: "(pattern:",
15130
+ kinds: ["pattern"],
15131
+ args: "handle-or-text",
15132
+ thread: false,
15133
+ minText: 3,
15134
+ lowering: [{ target: "Pattern", writes: [{ from: P, edge: "INSTANCE_OF", to: "Pattern" }], note: "a handle must be a Pattern; free text resolves-or-mints one" }],
15135
+ examples: ["pattern"],
15136
+ hint: "(pattern: name the general shape) or (pattern:[shown-pattern])",
15137
+ taught: "taught"
15138
+ },
15139
+ {
15140
+ verb: "domain",
15141
+ form: "verb",
15142
+ opener: "(domain:",
15143
+ kinds: ["domain"],
15144
+ args: "text",
15145
+ thread: false,
15146
+ minText: 2,
15147
+ textRequired: true,
15148
+ lowering: [{ target: "Domain", writes: [{ from: P, edge: "PERTAIN_TO", to: "Domain" }], note: '(domain:#t X) mints a Domain named "#t X" today', decision: "k" }],
15149
+ examples: ["domain"],
15150
+ hint: "(domain: The Area) \u2014 Title Case, no thread",
15151
+ taught: "taught",
15152
+ decisions: ["k"]
15153
+ },
15154
+ {
15155
+ verb: "package",
15156
+ form: "verb",
15157
+ opener: "(package:",
15158
+ kinds: ["package"],
15159
+ args: "text",
15160
+ thread: false,
15161
+ minText: 2,
15162
+ textRequired: true,
15163
+ lowering: [{ target: "Package", writes: [{ from: P, edge: "DEPENDS_ON", to: "Package" }], note: "means 'concerns', written as DEPENDS_ON", decision: "c" }],
15164
+ examples: ["package"],
15165
+ hint: "(package: the-package-name) \u2014 the public package it's about",
15166
+ taught: "taught",
15167
+ decisions: ["c"]
15168
+ },
15169
+ {
15170
+ verb: "component",
15171
+ form: "verb",
15172
+ opener: "(component:",
15173
+ kinds: ["component"],
15174
+ args: "text",
15175
+ thread: false,
15176
+ minText: 2,
15177
+ textRequired: true,
15178
+ lowering: [{ target: "Component", writes: [{ from: P, edge: "CONCERNS", to: "Component" }] }],
15179
+ examples: ["component"],
15180
+ hint: "(component: The Component) \u2014 the framework/product unit",
15181
+ taught: "taught"
15182
+ },
15183
+ {
15184
+ verb: "aids",
15185
+ form: "verb",
15186
+ opener: "(aids:",
15187
+ kinds: ["transfer"],
15188
+ args: "handles",
15189
+ thread: true,
15190
+ handleRequired: true,
15191
+ lowering: [{ target: P, writes: [{ from: S, edge: "MAY_RESOLVE", to: P }], note: "source = the Solution in scope; non-Problem targets are skipped" }],
15192
+ examples: ["aids"],
15193
+ hint: "(aids:[problem-handle],\u2026) \u2014 other shown problems your fix might also resolve",
15194
+ taught: "taught"
15195
+ },
15196
+ {
15197
+ verb: "builds-on",
15198
+ form: "verb",
15199
+ opener: "(builds-on:",
15200
+ kinds: ["builds-on"],
15201
+ args: "handles",
15202
+ thread: true,
15203
+ handleRequired: true,
15204
+ lowering: [{ target: S, writes: [{ from: S, edge: "BUILDS_ON", to: S }] }],
15205
+ examples: ["buildsOn"],
15206
+ hint: "(builds-on:[shown-solution]) \u2014 your fix layers on it",
15207
+ taught: "taught",
15208
+ taughtBy: "linkBullet instruction text"
15209
+ },
15210
+ {
15211
+ verb: "supersedes",
15212
+ form: "verb",
15213
+ opener: "(supersedes:",
15214
+ kinds: ["supersedes"],
15215
+ args: "handles",
15216
+ thread: true,
15217
+ handleRequired: true,
15218
+ lowering: [{ target: S, writes: [{ from: S, edge: "SUPERSEDES", to: S }] }],
15219
+ examples: ["supersedes"],
15220
+ hint: "(supersedes:[shown-solution]) \u2014 your fix replaces it",
15221
+ taught: "taught",
15222
+ taughtBy: "linkBullet instruction text"
15223
+ },
15224
+ {
15225
+ verb: "alternative",
15226
+ form: "verb",
15227
+ opener: "(alternative:",
15228
+ kinds: ["alternative"],
15229
+ args: "handles",
15230
+ thread: true,
15231
+ handleRequired: true,
15232
+ lowering: [{ target: S, writes: [{ from: S, edge: "ALTERNATIVE_TO", to: S }] }],
15233
+ examples: ["alternative"],
15234
+ hint: "(alternative:[shown-solution]) \u2014 a different valid approach",
15235
+ taught: "taught",
15236
+ taughtBy: "linkBullet instruction text"
15237
+ },
15238
+ {
15239
+ verb: "confirm",
15240
+ form: "verb",
15241
+ opener: "(confirm:",
15242
+ kinds: ["confirm"],
15243
+ args: "handles",
15244
+ thread: false,
15245
+ handleRequired: true,
15246
+ lowering: [{ target: S, writes: [], note: "corroboration witness (corroborationCount), no edge" }],
15247
+ examples: ["confirm"],
15248
+ hint: "(confirm:[shown-prior]) \u2014 it held",
15249
+ taught: "taught",
15250
+ taughtBy: "verdictBullet + context render",
15251
+ decisions: ["j"]
15252
+ },
15253
+ {
15254
+ verb: "refute",
15255
+ form: "verb",
15256
+ opener: "(refute:",
15257
+ kinds: ["refute"],
15258
+ args: "handles-text",
15259
+ thread: false,
15260
+ minText: 4,
15261
+ handleRequired: true,
15262
+ textRequired: true,
15263
+ lowering: [{ target: S, writes: [], note: "contradiction witness (contradictionPressure), no edge; reason stays local" }],
15264
+ examples: ["refute"],
15265
+ hint: "(refute:[shown-prior] one line why) \u2014 the reason is required",
15266
+ taught: "taught",
15267
+ taughtBy: "verdictBullet + context render",
15268
+ decisions: ["j"]
15269
+ }
15270
+ ];
15271
+ var TAG_FENCES = [
15272
+ {
15273
+ fence: "errata-problem",
15274
+ fields: ["problem", "cause", "fix", "anchor", "kind"],
15275
+ required: [["problem"]],
15276
+ taught: "untaught",
15277
+ parser: "apps/daemon/src/turn.ts parseDesignFlags",
15278
+ decisions: ["h"],
15279
+ hint: "use an inline [!\u2026] flag instead (errata-problem cause ids never meet inline ids)"
15280
+ },
15281
+ {
15282
+ fence: "errata-resolved",
15283
+ fields: ["id", "problem", "fix", "disposition", "reason"],
15284
+ required: [["id", "problem"]],
15285
+ taught: "taught",
15286
+ taughtBy: "retract form only (TAG_EXAMPLE.retract); the fix form is untaught",
15287
+ parser: "apps/daemon/src/turn.ts parseDesignResolutions",
15288
+ hint: "```errata-resolved with id: and disposition: false_positive | invalid, reason: \u2026"
15289
+ },
15290
+ {
15291
+ fence: "errata-triage",
15292
+ fields: ["presenting", "cause", "test", "fix", "drift", "route"],
15293
+ required: [["presenting", "route"], ["cause", "test"]],
15294
+ taught: "taught",
15295
+ taughtBy: "MCP errata_triage tool copy",
15296
+ parser: "packages/local-graph/src/triage.ts parseTriageFences",
15297
+ hint: "```errata-triage with presenting: and cause: (or route: + test: to answer one)"
15298
+ },
15299
+ {
15300
+ fence: "errata-abstraction",
15301
+ fields: ["candidate", "principle", "covers"],
15302
+ required: [["candidate"], ["principle"], ["covers"]],
15303
+ taught: "taught",
15304
+ taughtBy: "MCP errata_pending_abstractions tool copy",
15305
+ parser: "packages/local-graph/src/abstraction.ts parseAbstractionFences",
15306
+ hint: "```errata-abstraction with candidate:, principle:, covers: (all required)"
15307
+ },
15308
+ {
15309
+ fence: "errata-intent",
15310
+ fields: ["intent"],
15311
+ required: [["intent"]],
15312
+ taught: "taught",
15313
+ parser: "packages/local-graph/src/intent.ts parseIntentFences",
15314
+ hint: "```errata-intent with intent: what you're about to do"
15315
+ },
15316
+ {
15317
+ fence: "errata-share",
15318
+ fields: ["priors"],
15319
+ required: [["priors"]],
15320
+ taught: "taught",
15321
+ taughtBy: "subagent hand-off copy",
15322
+ parser: "packages/local-graph/src/intent.ts parseShareFence",
15323
+ hint: "```errata-share with priors: all | [h1], [h2]"
15324
+ }
15325
+ ];
15326
+ var TAG_VERB_BY_NAME = new Map(
15327
+ TAG_VERBS.filter((v) => v.form === "verb").map((v) => [v.verb, v])
15328
+ );
15329
+ var TAG_PAREN_VERBS = [...TAG_VERB_BY_NAME.keys()].sort((a, b) => b.length - a.length);
15330
+ var TAG_GRAMMAR_OPENERS = [
15331
+ ...new Set(TAG_VERBS.filter((v) => v.form !== "citation").map((v) => v.opener))
15332
+ ];
15333
+ var TAG_QUOTED_PAREN_SOURCE = String.raw`\(\s*(?:${TAG_PAREN_VERBS.map((v) => v.replace(/-/g, "\\-")).join("|")})\s*:|\(\[`;
15334
+ var TAG_QUOTED_RE = new RegExp(String.raw`\[[!?]|` + TAG_QUOTED_PAREN_SOURCE, "i");
15335
+ var TAG_QUOTED_PAREN_RE = new RegExp(TAG_QUOTED_PAREN_SOURCE, "i");
15336
+ function tagGrammarCopy() {
15337
+ const copy = [];
15338
+ for (const ref of ["its-handle", "its-id", "h", "id"]) {
15339
+ for (const build of Object.values(TAG_EXAMPLES)) copy.push(build(ref));
15340
+ }
15341
+ for (const v of TAG_VERBS) {
15342
+ copy.push(v.hint);
15343
+ if (v.taughtBy) copy.push(v.taughtBy);
15344
+ for (const q of v.qualifiers ?? []) copy.push(q.note);
15345
+ for (const l of v.lowering) {
15346
+ if (l.note) copy.push(l.note);
15347
+ if (l.knownViolation) copy.push(l.knownViolation.finding);
15348
+ }
15349
+ }
15350
+ for (const f of TAG_FENCES) copy.push(f.hint);
15351
+ return copy;
15352
+ }
15353
+ var TEMPLATE_VERB_GROUP = new RegExp(
15354
+ String.raw`\(\s*(${TAG_PAREN_VERBS.map((v) => v.replace(/-/g, "\\-")).join("|")})\s*:((?:[^()\n]|\([^()\n]*\))*)\)`,
15355
+ "gi"
15356
+ );
15357
+ var BRACKET_TOKEN = /\[([^\]\n]{1,80})\]/g;
15358
+ var REAL_HANDLE_SHAPE = new RegExp(
15359
+ String.raw`^(?:[a-z0-9]+(?:-[a-z0-9]+)*-(?=[0-9a-f]{0,3}\d)[0-9a-f]{4}|(?:${TAG_CANONICAL_ID_PREFIXES.join("|")})_[0-9a-f]{6,})$`,
15360
+ "i"
15361
+ );
15362
+ function normalizeTemplateBody(body) {
15363
+ return body.replace(/…|\.{3}/g, " ").replace(/\s+/g, " ").trim().replace(/^[\s,;:—–-]+|[\s,;:.—–-]+$/g, "").toLowerCase();
15364
+ }
15365
+ function deriveTagTemplates(copy) {
15366
+ const bodies = /* @__PURE__ */ new Set();
15367
+ const handles = new Set([...TAG_PLACEHOLDER_HANDLES].map((h) => h.toLowerCase()));
15368
+ for (const text of copy) {
15369
+ for (const m of text.matchAll(BRACKET_TOKEN)) {
15370
+ const token = m[1].trim().toLowerCase();
15371
+ if (!/^[!?]/.test(token) && !REAL_HANDLE_SHAPE.test(token)) handles.add(token);
15372
+ }
15373
+ }
15374
+ for (const text of copy) {
15375
+ for (const m of text.matchAll(TEMPLATE_VERB_GROUP)) {
15376
+ const body = normalizeTemplateBody(m[2]);
15377
+ bodies.add(body);
15378
+ const unthreaded = normalizeTemplateBody(body.replace(/^#[a-z][\w-]*/i, ""));
15379
+ bodies.add(unthreaded);
15380
+ const rest = normalizeTemplateBody(unthreaded.replace(BRACKET_TOKEN, (t, h) => handles.has(h.trim().toLowerCase()) ? " " : t).replace(/,/g, " "));
15381
+ bodies.add(rest);
15382
+ }
15383
+ }
15384
+ bodies.delete("");
15385
+ return { bodies, handles };
15386
+ }
15387
+ var TAG_TEMPLATES = deriveTagTemplates(tagGrammarCopy());
15388
+ var VERB_WORDS_SOURCE = TAG_PAREN_VERBS.map((v) => v.replace(/-/g, "\\-")).join("|");
15389
+ var JOINED_VERB = new RegExp(String.raw`[,;]\s*(?=(?:${VERB_WORDS_SOURCE})\s*:)`, "i");
15390
+ var LEADING_VERB = new RegExp(String.raw`^\s*(${VERB_WORDS_SOURCE})\s*:`, "i");
15391
+ var ANY_VERB_WORD = new RegExp(String.raw`\b(?:${VERB_WORDS_SOURCE})\s*:`, "gi");
15392
+ var QUOTED_TAG_OPENER = new RegExp(String.raw`\(\s*(?:(${VERB_WORDS_SOURCE})\s*:|(?=\[))`, "gi");
15393
+
14858
15394
  // ../../packages/local-graph/src/history-cache-floor.ts
14859
15395
  var HISTORY_CACHE_FLOOR_KEY = "history-cache-withdrawal-floor-3";
14860
15396
  function installHistoryCacheFloor(db) {
@@ -17247,7 +17783,14 @@ function summaryFromDoc(doc, kind) {
17247
17783
  }
17248
17784
  if (verb !== null) return null;
17249
17785
  const noun = clipped.replace(/^(?:the|a|an)\s+/i, "");
17250
- return tidy(`${lead(kind)} for ${noun.charAt(0).toLowerCase()}${noun.slice(1)}`);
17786
+ const head = noun.split(/[\s-]/, 1)[0].replace(/[.,;:!?]+$/, "");
17787
+ return tidy(`${lead(kind)} for ${isOrdinaryCapital(head) ? noun.charAt(0).toLowerCase() + noun.slice(1) : noun}`);
17788
+ }
17789
+ var CONTRACTION_BASES = /* @__PURE__ */ new Set(["it", "that", "this", "there", "here", "what", "who", "where", "when", "why", "how", "let", "he", "she"]);
17790
+ function isOrdinaryCapital(word) {
17791
+ const contraction = /^([A-Za-z]+)['’]s$/.exec(word);
17792
+ if (contraction) return CONTRACTION_BASES.has(contraction[1].toLowerCase()) && /^[A-Z][a-z]*$/.test(contraction[1]);
17793
+ return /^[A-Z][a-z]+$/.test(word);
17251
17794
  }
17252
17795
  var VERB_PHRASE_KINDS = /* @__PURE__ */ new Set(["function", "method"]);
17253
17796
  function summaryFromName(name, kind) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.22-dev.4130",
3
+ "version": "2.0.22-dev.4148",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {