Skip to content

Commit d80015d

Browse files
committed
Add wetware semantic pack for canonical intake
1 parent 533bd33 commit d80015d

5 files changed

Lines changed: 237 additions & 4 deletions

File tree

src/canonical/conceptualProbe.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,20 @@ const FRONTIER_DOMAIN_PATTERNS: Array<[FrontierDomainTag, RegExp[]]> = [
3939
[
4040
/\bwetware\b/i,
4141
/\borganoid(?:s)?\b/i,
42+
/\borganoid\s+intelligence\b/i,
43+
/\bbiohybrid\b/i,
4244
/\bbiocomput(?:er|ing|ation)?\b/i,
4345
/\bbiological\s+comput(?:ing|ation)\b/i,
46+
/\bbiological\s+learning\b/i,
47+
/\bwetware\s+as\s+a\s+service\b/i,
48+
/\bliving\s+server(?:s)?\b/i,
49+
/\bmind\s+in\s+a\s+dish\b/i,
50+
/\bpong\s*\/\s*cart[- ]?pole\b/i,
51+
/\binterface\s+bottleneck\b/i,
52+
/\bi\/o\s+layer\b/i,
53+
/\bsentience\b/i,
54+
/\bconscious(?:ness)?\b/i,
55+
/\bplasticity\b/i,
4456
],
4557
],
4658
[
@@ -123,6 +135,25 @@ const WETWARE_UTILITY_PATTERNS: RegExp[] = [
123135
/\bactual\s+use\b/i,
124136
];
125137

138+
const WETWARE_CONCEPTUAL_PATTERNS: RegExp[] = [
139+
/^\s*is\s+wetware\s+really\s+more\s+energy\s+efficient\b/i,
140+
/^\s*what\s+hidden\s+costs?\b.*\befficien(?:cy|t)\b/i,
141+
/^\s*does\s+biological\s+comput(?:ing|ation)\s+actually\s+beat\s+silicon\s+on\s+power\b/i,
142+
/^\s*what\s+does\s+pong\s*\/\s*cart[- ]?pole\s+actually\s+prove\b/i,
143+
/^\s*does\s+this\s+show\s+intelligence\s+or\s+just\s+plasticity\b/i,
144+
/^\s*what\s+can\s+organoid(?:s)?\s+actually\s+learn\b/i,
145+
/^\s*what\s+limits?\s+biological\s+learning\b/i,
146+
/^\s*can\s+organoid(?:s)?\s+replace\s+silicon\b/i,
147+
/^\s*what\s+stops?\s+wetware\s+scal(?:ing|e)\b/i,
148+
/^\s*where\s+does\s+biohybrid\s+comput(?:ing|ation)\s+fail\b/i,
149+
/^\s*what\s+bottlenecks?\s+living\s+server(?:s)?\b/i,
150+
/^\s*could\s+organoid(?:s)?\s+become\s+conscious\b/i,
151+
/^\s*is\s+this\s+sentience\s+or\s+just\s+activity\b/i,
152+
/^\s*why\s+do\s+people\s+call\s+this\s+a\s+mind\s+in\s+a\s+dish\b/i,
153+
/^\s*what(?:'s|\s+is)\s+the\s+interface\s+bottleneck\b/i,
154+
/^\s*is\s+the\s+i\/o\s+layer\s+the\s+real\s+problem\b/i,
155+
];
156+
126157
const CROSS_DOMAIN_CONVERGENCE_PATTERNS: RegExp[] = [
127158
/\bhow do\b.*\bconverge\b/i,
128159
/\bhow do\b.*\bconvergence\b/i,
@@ -235,6 +266,7 @@ export function isConceptualProbe(text: string, context?: { event?: CanonicalEve
235266
...STRUCTURAL_FIT_PATTERNS,
236267
...TRANSHUMAN_MERGE_PATTERNS,
237268
...WETWARE_UTILITY_PATTERNS,
269+
...WETWARE_CONCEPTUAL_PATTERNS,
238270
...CROSS_DOMAIN_CONVERGENCE_PATTERNS,
239271
]);
240272
if (!structured) continue;
@@ -249,6 +281,7 @@ export function isConceptualProbe(text: string, context?: { event?: CanonicalEve
249281
matchesAny(coreText, STRUCTURAL_FIT_PATTERNS) ||
250282
matchesAny(coreText, TRANSHUMAN_MERGE_PATTERNS) ||
251283
matchesAny(coreText, WETWARE_UTILITY_PATTERNS) ||
284+
matchesAny(coreText, WETWARE_CONCEPTUAL_PATTERNS) ||
252285
matchesAny(coreText, CROSS_DOMAIN_CONVERGENCE_PATTERNS)
253286
) {
254287
return true;

src/canonical/conversationContinue.ts

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,32 @@ const CONTINUATION_NEGATIVE_PATTERNS: RegExp[] = [
4343
/^\s*(?:what\s+now|now\s+what|why\??|so\??|and\??)\s*$/i,
4444
];
4545

46+
const WETWARE_CONTINUATION_FORM_PATTERNS: RegExp[] = [
47+
/^\s*and\s+where\s+does\s+it\s+fail\b/i,
48+
/^\s*what\s+about\s+scal(?:ing|e)\b/i,
49+
/^\s*so\s+what(?:'s|\s+is)\s+the\s+constraint\b/i,
50+
/^\s*then\s+what\s+is\s+actually\s+being\s+computed\b/i,
51+
/^\s*where\s+does\s+the\s+interface\s+break\b/i,
52+
/^\s*what\s+is\s+silicon\s+still\s+doing\s+here\b/i,
53+
/^\s*and\s+how\s+much\s+of\s+this\s+is\s+real\s+vs\s+marketing\b/i,
54+
];
55+
56+
const WETWARE_CONTINUATION_RELEVANCE_PATTERNS: RegExp[] = [
57+
/\bscal(?:e|ing|ability)\b/i,
58+
/\bconstraint(?:s)?\b/i,
59+
/\binterface\b/i,
60+
/\bi\/o\b/i,
61+
/\bcompute(?:d|s|ing)?\b/i,
62+
/\bsilicon\b/i,
63+
/\bmarketing\b/i,
64+
/\bbottleneck(?:s)?\b/i,
65+
/\bfail(?:s|ure|ing)?\b/i,
66+
/\bbreak(?:s|ing|down)?\b/i,
67+
/\breadout\b/i,
68+
/\bdecod(?:e|ing|er|ers)\b/i,
69+
/\bstability\b/i,
70+
];
71+
4672
function normalize(text: string): string {
4773
return (text ?? "").trim().replace(/\s+/g, " ");
4874
}
@@ -69,13 +95,19 @@ export function hasRelevantParentContext(event: CanonicalEvent): boolean {
6995
export function looksLikeContinuation(text: string): boolean {
7096
const normalized = normalize(text);
7197
if (!normalized) return false;
72-
return hasPatternMatch(normalized, CONTINUATION_FORM_PATTERNS);
98+
return (
99+
hasPatternMatch(normalized, CONTINUATION_FORM_PATTERNS) ||
100+
hasPatternMatch(normalized, WETWARE_CONTINUATION_FORM_PATTERNS)
101+
);
73102
}
74103

75104
export function hasContinuationRelevance(text: string): boolean {
76105
const normalized = normalize(text);
77106
if (!normalized) return false;
78-
return hasPatternMatch(normalized, CONTINUATION_RELEVANCE_PATTERNS);
107+
return (
108+
hasPatternMatch(normalized, CONTINUATION_RELEVANCE_PATTERNS) ||
109+
hasPatternMatch(normalized, WETWARE_CONTINUATION_RELEVANCE_PATTERNS)
110+
);
79111
}
80112

81113
function isNegativeContinuation(text: string): boolean {

src/canonical/structuredCritique.ts

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,40 @@ const STRUCTURED_CRITIQUE_NEGATIVE_PATTERNS: RegExp[] = [
4949
/^\s*(?:nice\s+weather|gm|good\s+morning|good\s+evening)\s*$/i,
5050
];
5151

52+
const WETWARE_CRITIQUE_FORM_PATTERNS: RegExp[] = [
53+
/^\s*this\s+sounds?\s+efficient\b.*\binterface\b.*\boverhead\b.*\bdominates\b/i,
54+
/^\s*the\s+substrate\s+may\s+learn\b.*\bcontrol\s+layer\b.*\breal\s+work\b/i,
55+
/^\s*code[- ]?deployable\b.*\bsoftware\s+metaphor\b/i,
56+
/^\s*people\s+are\s+confusing\s+adaptive\s+tissue\b.*\bgeneral\s+intelligence\b/i,
57+
/^\s*the\s+hype\s+outruns\s+the\s+interface\b/i,
58+
/^\s*this\s+looks?\s+promising\b.*\breproducibility\b.*\breal\s+bottleneck\b/i,
59+
/^\s*they\s+call\s+it\s+replacement\b.*\bhybrid\s+stack\b/i,
60+
/^\s*sentience\s+language\b.*\bout(?:runs|racing|running)\b.*\bdata\b/i,
61+
];
62+
63+
const WETWARE_CRITIQUE_RELEVANCE_PATTERNS: RegExp[] = [
64+
/\binterface\b/i,
65+
/\boverhead\b/i,
66+
/\bcontrol\s+layer\b/i,
67+
/\bsubstrate\b/i,
68+
/\badaptive\s+tissue\b/i,
69+
/\bgeneral\s+intelligence\b/i,
70+
/\breproducibility\b/i,
71+
/\bhybrid\s+stack\b/i,
72+
/\bcode[- ]?deployable\b/i,
73+
/\bsoftware\s+metaphor\b/i,
74+
/\bsentience\b/i,
75+
/\bdata\b/i,
76+
/\bhype\b/i,
77+
/\bbiological\s+comput(?:ing|ation)\b/i,
78+
/\borganoid(?:s)?\b/i,
79+
/\bbiohybrid\b/i,
80+
/\bwetware\b/i,
81+
/\bplasticity\b/i,
82+
/\bdecod(?:e|ing|er|ers)\b/i,
83+
/\binterface\s+bottleneck\b/i,
84+
];
85+
5286
function normalize(text: string): string {
5387
return (text ?? "").trim().replace(/\s+/g, " ");
5488
}
@@ -73,13 +107,19 @@ function isNegativeStructuredCritique(text: string): boolean {
73107
export function looksLikeStructuredCritique(text: string): boolean {
74108
const normalized = normalize(text);
75109
if (!normalized) return false;
76-
return hasPatternMatch(normalized, STRUCTURED_CRITIQUE_FORM_PATTERNS);
110+
return (
111+
hasPatternMatch(normalized, STRUCTURED_CRITIQUE_FORM_PATTERNS) ||
112+
hasPatternMatch(normalized, WETWARE_CRITIQUE_FORM_PATTERNS)
113+
);
77114
}
78115

79116
export function hasStructuredCritiqueRelevance(text: string): boolean {
80117
const normalized = normalize(text);
81118
if (!normalized) return false;
82-
return hasPatternMatch(normalized, STRUCTURED_CRITIQUE_RELEVANCE_PATTERNS);
119+
return (
120+
hasPatternMatch(normalized, STRUCTURED_CRITIQUE_RELEVANCE_PATTERNS) ||
121+
hasPatternMatch(normalized, WETWARE_CRITIQUE_RELEVANCE_PATTERNS)
122+
);
83123
}
84124

85125
export function assessStructuredCritique(

tests/canonical/pipeline.integration.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,33 @@ describe("pipeline integration", () => {
112112
}
113113
});
114114

115+
it("rescues a wetware follow-up into conversation_continue when thread context is present", async () => {
116+
const result = await handleEvent(
117+
makeEvent({
118+
trigger_type: "reply",
119+
text: "what about scaling?",
120+
parent_text: "We are comparing wetware readout, I/O, and scaling constraints.",
121+
conversation_context: ["parent: wetware readout, I/O, and scaling constraints"],
122+
}),
123+
makeDeps("Scaling usually fails at the interface and readout layer."),
124+
DEFAULT_CANONICAL_CONFIG,
125+
);
126+
127+
expect(result.action).toBe("publish");
128+
if (result.action === "publish") {
129+
expect(result.mode).toBe("neutral_clarification");
130+
expect(result.audit.path).toBe("social");
131+
expect(result.audit.classifier_output.intent).toBe("conversation_continue");
132+
expect(result.audit.classifier_output.baseIntent).toBe("question");
133+
expect(result.audit.classifierIntent).toBe("conversation_continue");
134+
expect(result.audit.baseIntent).toBe("question");
135+
expect(result.audit.sourceIntent).toBe("conversation_continue");
136+
expect(result.audit.hasParentContext).toBe(true);
137+
expect(result.audit.continuationSignal).toBe(true);
138+
expect(result.audit.finalMode).toBe("neutral_clarification");
139+
}
140+
});
141+
115142
it("rescues a structured critique statement into skeptical_breakdown", async () => {
116143
const result = await handleEvent(
117144
makeEvent({
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import { describe, expect, it } from "vitest";
2+
import { classify } from "../../src/canonical/classifier.js";
3+
import { assessConversationContinue, hasRelevantParentContext } from "../../src/canonical/conversationContinue.js";
4+
import { hasFrontierDomainSignal, isConceptualProbe } from "../../src/canonical/conceptualProbe.js";
5+
import { assessStructuredCritique } from "../../src/canonical/structuredCritique.js";
6+
import type { CanonicalEvent } from "../../src/canonical/types.js";
7+
8+
function makeEvent(overrides: Partial<CanonicalEvent> = {}): CanonicalEvent {
9+
return {
10+
event_id: "wetware_1",
11+
platform: "twitter",
12+
trigger_type: "mention",
13+
author_handle: "@tester",
14+
author_id: "u1",
15+
text: "what can organoids actually learn?",
16+
parent_text: null,
17+
quoted_text: null,
18+
conversation_context: [],
19+
cashtags: [],
20+
hashtags: [],
21+
urls: [],
22+
timestamp: new Date().toISOString(),
23+
...overrides,
24+
};
25+
}
26+
27+
describe("wetware semantic pack", () => {
28+
it.each([
29+
"what can organoids actually learn?",
30+
"could organoids become conscious?",
31+
"does biological computing actually beat silicon on power?",
32+
"what's the interface bottleneck in organoid readout?",
33+
"why do people call this a mind in a dish?",
34+
])("classifies wetware conceptual questions as conceptual_probe: %s", (text) => {
35+
const event = makeEvent({ text });
36+
expect(hasFrontierDomainSignal(text)).toBe(true);
37+
expect(isConceptualProbe(text, { event })).toBe(true);
38+
39+
const result = classify(event);
40+
expect(result.intent).toBe("conceptual_probe");
41+
expect(result.target).toBe("claim");
42+
expect(result.evidence_class).toBe("contextual_medium");
43+
});
44+
45+
it.each([
46+
"this sounds efficient but the interface overhead dominates",
47+
"the substrate may learn, but the control layer is doing the real work",
48+
"code-deployable is a software metaphor, not a biological description",
49+
"the hype outruns the interface",
50+
"they call it replacement, but it's still a hybrid stack",
51+
"sentience language is outrunning the data",
52+
])("routes wetware skepticism to structured_critique: %s", (text) => {
53+
const event = makeEvent({ text });
54+
const assessment = assessStructuredCritique(text, event);
55+
56+
expect(assessment.structuredCritiqueSignal).toBe(true);
57+
expect(assessment.formSignal).toBe(true);
58+
expect(assessment.relevanceSignal).toBe(true);
59+
60+
const result = classify(event);
61+
expect(result.intent).toBe("structured_critique");
62+
expect(result.baseIntent).toBe("irrelevant");
63+
expect(result.target).toBe("claim");
64+
});
65+
66+
it.each([
67+
"and where does it fail?",
68+
"what about scaling?",
69+
"so what's the constraint?",
70+
"then what is actually being computed?",
71+
"where does the interface break?",
72+
"what is silicon still doing here?",
73+
"and how much of this is real vs marketing?",
74+
])("routes wetware follow-ups with parent context to conversation_continue: %s", (text) => {
75+
const event = makeEvent({
76+
trigger_type: "reply",
77+
text,
78+
parent_text: "parent: wetware interface, readout, and scaling discussion",
79+
conversation_context: ["parent: wetware interface, readout, and scaling discussion"],
80+
});
81+
82+
const assessment = assessConversationContinue(text, event);
83+
expect(hasRelevantParentContext(event)).toBe(true);
84+
expect(assessment.continuationSignal).toBe(true);
85+
expect(assessment.hasParentContext).toBe(true);
86+
87+
const result = classify(event);
88+
expect(result.intent).toBe("conversation_continue");
89+
expect(result.baseIntent).toBe("question");
90+
expect(result.target).toBe("conversation");
91+
});
92+
93+
it("does not rescue a standalone wetware follow-up without parent context", () => {
94+
const event = makeEvent({ text: "what about scaling?" });
95+
const assessment = assessConversationContinue(event.text, event);
96+
97+
expect(assessment.continuationSignal).toBe(false);
98+
expect(assessment.hasParentContext).toBe(false);
99+
expect(classify(event).intent).not.toBe("conversation_continue");
100+
});
101+
});

0 commit comments

Comments
 (0)