@rubytech/create-realagent 1.0.824 → 1.0.826

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 (63) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/task-secrets/dist/index.d.ts +40 -0
  3. package/payload/platform/lib/task-secrets/dist/index.d.ts.map +1 -0
  4. package/payload/platform/lib/task-secrets/dist/index.js +44 -0
  5. package/payload/platform/lib/task-secrets/dist/index.js.map +1 -0
  6. package/payload/platform/lib/task-secrets/src/__tests__/redact-secrets.test.ts +127 -0
  7. package/payload/platform/lib/task-secrets/src/index.ts +77 -0
  8. package/payload/platform/lib/task-secrets/tsconfig.json +9 -0
  9. package/payload/platform/lib/task-secrets/vitest.config.ts +9 -0
  10. package/payload/platform/neo4j/schema.cypher +11 -0
  11. package/payload/platform/package.json +2 -2
  12. package/payload/platform/plugins/admin/skills/business-profile/SKILL.md +2 -2
  13. package/payload/platform/plugins/admin/skills/onboarding/SKILL.md +12 -9
  14. package/payload/platform/plugins/admin/skills/plugin-management/SKILL.md +4 -4
  15. package/payload/platform/plugins/admin/skills/public-agent-manager/SKILL.md +2 -2
  16. package/payload/platform/plugins/admin/skills/stream-log-review/SKILL.md +6 -6
  17. package/payload/platform/plugins/admin/skills/unzip-attachment/references/safety.md +1 -1
  18. package/payload/platform/plugins/cloudflare/references/manual-setup.md +3 -3
  19. package/payload/platform/plugins/cloudflare/skills/setup-tunnel/SKILL.md +4 -4
  20. package/payload/platform/plugins/docs/references/cloudflare.md +1 -1
  21. package/payload/platform/plugins/docs/references/internals.md +2 -2
  22. package/payload/platform/plugins/docs/references/memory-guide.md +1 -1
  23. package/payload/platform/plugins/docs/references/troubleshooting.md +1 -1
  24. package/payload/platform/plugins/linkedin-import/skills/linkedin-import/SKILL.md +2 -2
  25. package/payload/platform/plugins/linkedin-import/skills/linkedin-import/references/connections.md +1 -1
  26. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-not-applicable.test.d.ts +2 -0
  27. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-not-applicable.test.d.ts.map +1 -0
  28. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-not-applicable.test.js +87 -0
  29. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-not-applicable.test.js.map +1 -0
  30. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts +2 -0
  31. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts.map +1 -1
  32. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js +100 -8
  33. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js.map +1 -1
  34. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts +19 -0
  35. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts.map +1 -1
  36. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +60 -27
  37. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -1
  38. package/payload/platform/plugins/memory/references/graph-primitives.md +5 -5
  39. package/payload/platform/plugins/memory/references/schema-base.md +1 -1
  40. package/payload/platform/plugins/memory/skills/document-ingest/SKILL.md +6 -6
  41. package/payload/platform/plugins/tasks/PLUGIN.md +1 -1
  42. package/payload/platform/plugins/tasks/mcp/dist/index.js +11 -2
  43. package/payload/platform/plugins/tasks/mcp/dist/index.js.map +1 -1
  44. package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.d.ts +19 -2
  45. package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.d.ts.map +1 -1
  46. package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.js +17 -1
  47. package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.js.map +1 -1
  48. package/payload/platform/plugins/whatsapp-import/skills/whatsapp-import/SKILL.md +9 -9
  49. package/payload/platform/plugins/whatsapp-import/skills/whatsapp-import/references/export-parse.md +2 -2
  50. package/payload/platform/plugins/whatsapp-import/skills/whatsapp-import-enrich/SKILL.md +8 -8
  51. package/payload/platform/templates/agents/admin/IDENTITY.md +1 -1
  52. package/payload/platform/templates/specialists/agents/database-operator.md +10 -10
  53. package/payload/server/chunk-AEHTLEC3.js +2302 -0
  54. package/payload/server/chunk-F5QBVHLS.js +1116 -0
  55. package/payload/server/chunk-HAXOJNAM.js +10079 -0
  56. package/payload/server/chunk-TDTQEKNP.js +593 -0
  57. package/payload/server/chunk-ZTBTX3IO.js +642 -0
  58. package/payload/server/client-pool-FXCFSUXR.js +32 -0
  59. package/payload/server/cloudflare-task-tracker-3WV7DZKQ.js +17 -0
  60. package/payload/server/cloudflare-task-tracker-BAMJY4MH.js +17 -0
  61. package/payload/server/maxy-edge.js +3 -3
  62. package/payload/server/neo4j-migrations-5FVPIWDW.js +428 -0
  63. package/payload/server/server.js +20 -14
@@ -471,9 +471,9 @@ Each log entry includes the tool name and a truncated conversation ID for correl
471
471
 
472
472
  Every durable action — onboarding, cloudflare tunnel-login, brand publish, future deterministic flows — emits a `:Task {kind:"<flow>"}` node carrying the action's lifecycle and a `:PRODUCED` edge to every entity the action created. This makes the graph traversable from the originating Conversation to every entity created during it via `(c)<-[:RAISED_DURING]-(t:Task)-[:PRODUCED]->(e)` — answering "what did this turn produce" in one Cypher hop.
473
473
 
474
- The doctrine is enforced at the storage primitive: writes to `:Person`, `:UserProfile`, `:AdminUser`, `:Organization`, `:LocalBusiness`, `:CloudflareTunnel`, or `:CloudflareHostname` MUST include exactly one inbound `:PRODUCED` edge whose source is a `:Task`. Bootstrap writes (PIN-setup, schema migrations, lazy `loadUserProfile`) are exempt via `createdBy.agent === 'system'`.
474
+ The doctrine is enforced at the storage primitive: writes to `:Person`, `:UserProfile`, `:AdminUser`, `:Organization`, `:LocalBusiness`, `:CloudflareTunnel`, or `:CloudflareHostname` MUST include exactly one inbound `:PRODUCED` edge whose source is a `:Task`. Bootstrap writes (PIN-setup, schema migrations, lazy first-session UserProfile creation) are exempt via `createdBy.agent === 'system'`.
475
475
 
476
- Two surfaces emit the lifecycle: agent-driven actions call `task-create`/`task-update`/`task-complete` over MCP (`task-create` accepts `kind`, `inputsProvided` names only, never values and `raisedDuringConversationKey` to resolve the `RAISED_DURING` edge). Shell-driven actions wrap their script invocation in [platform/ui/app/lib/cloudflare-task-tracker.ts](../../../ui/app/lib/cloudflare-task-tracker.ts) (cloudflare is the first; installer / brand-publish / OAuth-login deferred). Both surfaces emit the same `[task] action-start|step|done` log lines so operators can grep one channel uniformly.
476
+ Two surfaces emit the lifecycle: agent-driven actions call `task-create`/`task-update`/`task-complete` over MCP (`task-create` accepts `kind`, the canonical `inputsProvided` call-shape record, `inputs` + `inputSchema` for the operator-meaningful form payload, and `raisedDuringConversationKey` to resolve the `RAISED_DURING` edge). Shell-driven actions wrap their script invocation in [platform/ui/app/lib/cloudflare-task-tracker.ts](../../../ui/app/lib/cloudflare-task-tracker.ts) (cloudflare is the first; installer / brand-publish / OAuth-login deferred). Both surfaces emit the same `[task] action-start|step|done` log lines so operators can grep one channel uniformly. Both also call the central `redactSecrets` primitive ([platform/lib/task-secrets/](../../../lib/task-secrets/)) to strip schema-tagged secret keys before persisting `inputs.<field>` props on the Task — see `.docs/neo4j.md § Audit Task input contract` for the contract that replaces per-kind allow-lists.
477
477
 
478
478
  `memory-write` accepts an optional `producedByTaskId` parameter. When set, an inbound `:PRODUCED` edge from that Task is composed into the write's relationships before the gate runs — the typical agent-side pattern is to call `task-create` at the start of a flow, capture `taskId`, and pass it as `producedByTaskId` on every subsequent `memory-write` for an action-provenance-gated label. The gate verifies Task and write share the same `accountId`; mismatch is rejected loud.
479
479
 
@@ -31,7 +31,7 @@ Just say it naturally:
31
31
 
32
32
  ## How {{productName}} learns how you work
33
33
 
34
- {{productName}} also learns how you work without you having to teach it deliberately. Six broad areas cover the way most operators run a business — communication, scheduling, decisions, workflow, content, and interaction. {{productName}} tracks which of these you have spoken into and which are still empty. While any are empty, it folds one organic question per turn into the conversation aimed at the next gap — never a list, never a form, never the same question twice. Once every area carries at least one preference above the confidence threshold, the proactive questions stop and {{productName}} answers what you ask without volunteering more. This is why session 300 should feel sharper than session 3: the longer you work together, the less {{productName}} needs to ask.
34
+ {{productName}} also learns how you work without you having to teach it deliberately. Six broad areas cover the way most operators run a business — communication, scheduling, decisions, workflow, content, and interaction. Inside each area sits a small set of concrete fields ({{productName}} tracks around 28 in total) such as your preferred channel, quiet hours, workday start time, risk tolerance, content tonality, or address form. {{productName}} tracks which of these specific fields you have spoken into and which are still empty. While any are empty, it folds one organic question per turn into the conversation aimed at the next gap — never a list, never a form, never the same question twice. If you tell {{productName}} a field doesn't apply to you ("I work weekends, weekend availability isn't a thing for me"), it marks that field as covered and never re-asks. Once every field is either set or marked not-applicable, the proactive questions stop and {{productName}} answers what you ask without volunteering more. This is why session 300 should feel sharper than session 3: the longer you work together, the less {{productName}} needs to ask.
35
35
 
36
36
  ## Telling {{productName}} to Forget Something
37
37
 
@@ -192,7 +192,7 @@ The transient unit was auto-collected by systemd before the client subscribed. R
192
192
 
193
193
  **Cloudflare-setup auto-relays "completed" but the next chat turn 502s.**
194
194
 
195
- Earlier platform fixes (relay queue + boot-drain) replaced an even earlier `awaitAdminReachable` holdback that polled the non-restarting edge surface. The current contract is a single client-driven resume: the form dispatches the `admin-chat:post-restart-resume` window CustomEvent on `exit{code:0}`, the chat hook waits for `/api/health` to fail then succeed (down-then-up cycle, `waitForRestartCycle`), calls `POST /api/admin/sessions/<cid>/resume?session_key=<sk>` (cookie-bridge-rehydrates the wiped sessionStore via the surviving `__remote_session` cookie and binds the conversation), then sends the marker as a normal hidden chat POST that re-invokes the agent under the operator's real session. No relay queue, no boot-drain, no banner, no rebind endpoint.
195
+ The current contract is a single client-driven resume: when the setup script exits cleanly, the form fires a resume event, the chat hook waits for `/api/health` to fail then succeed (the brand-service down-then-up cycle), re-binds the conversation to the new server process, and sends the "completed" marker as a normal hidden chat POST that re-invokes the agent in the operator's real session. No relay queue, no boot-drain, no banner.
196
196
 
197
197
  Diagnostic recipe:
198
198
 
@@ -51,7 +51,7 @@ When the owner is an external Person (non-operator archive), the anchor is the c
51
51
  - LinkedIn skills → `:DefinedTerm` with `category: 'linkedin-skill'`.
52
52
  - LinkedIn articles → `:CreativeWork` with `category: 'linkedin-article'`.
53
53
  - LinkedIn recommendations → `:Review`.
54
- - LinkedIn DMs → `:Message:LinkedInMessage` + `:Conversation:LinkedInConversation` (sublabels on the existing labels, per Task 633 pattern).
54
+ - LinkedIn DMs → `:Message:LinkedInMessage` + `:Conversation:LinkedInConversation` (sublabels on the existing labels).
55
55
  - Certifications → `:Credential` (genuinely new — no existing {{productName}} label fits `schema:EducationalOccupationalCredential`).
56
56
  5. **Schema-base property names.** `givenName` / `familyName` / `telephone` / `dateSent` — not `firstName` / `phone` / `sentAt`. See [`platform/plugins/memory/references/schema-base.md`](../../../../plugins/memory/references/schema-base.md).
57
57
  6. **Schema-base edge names.** `(:Person)-[:WORKS_FOR]->(:Organization)` for positions. Custom LinkedIn edges (`CONNECTED_ON_LINKEDIN`, `ENDORSED`) only where schema-base has no canonical name.
@@ -68,7 +68,7 @@ When the owner is an external Person (non-operator archive), the anchor is the c
68
68
 
69
69
  **Doctrine:** raw Cypher and `cypher-shell` invocations are forbidden in this skill and its references. Writes route through `mcp__memory__memory-archive-write` (bulk archives) or `mcp__memory__memory-write` / `mcp__memory__memory-update` (single-node enrichments like `profile.md`). If a CSV needs a write shape no current MCP tool supports, file a task to extend `memory-archive-write` with a new `archiveType` handler — never improvise via Bash. See [database-operator's LOUD-FAIL prerogative](../../../../templates/specialists/agents/database-operator.md#prerogatives).
70
70
 
71
- **LOUD-FAIL on parse errors (structurally enforced, Task 846).** When LinkedIn parser tools land that follow the `mcp__*__*-import-parse` naming convention, the harness-level `platform/plugins/admin/hooks/archive-ingest-gate.sh` will record an `isError: true` response and block every subsequent tool call this turn until the operator submits the next prompt. The hook also denies edits to `platform/plugins/*/lib/*` and JavaScript test runners (`vitest`, `bun test`, `npm test`, `npx jest`) unconditionally. The skill's "no Bash improvisation" doctrine above is the contract; the hook is the enforcement. See [.docs/hooks.md](../../../../../.docs/hooks.md) for the full gate surface.
71
+ **LOUD-FAIL on parse errors (structurally enforced).** When LinkedIn parser tools land that follow the `mcp__*__*-import-parse` naming convention, the harness-level `platform/plugins/admin/hooks/archive-ingest-gate.sh` will record an `isError: true` response and block every subsequent tool call this turn until the operator submits the next prompt. The hook also denies edits to `platform/plugins/*/lib/*` and JavaScript test runners (`vitest`, `bun test`, `npm test`, `npx jest`) unconditionally. The skill's "no Bash improvisation" doctrine above is the contract; the hook is the enforcement. See [.docs/hooks.md](../../../../../.docs/hooks.md) for the full gate surface.
72
72
 
73
73
  ## Selective-ingest threshold (bulk archives)
74
74
 
@@ -28,7 +28,7 @@ The real column header is **line 4**. Either skip the first three lines before p
28
28
  | URL | `Person.linkedinUrl` (natural key) |
29
29
  | Email Address | `Person.email` (only when non-empty) |
30
30
  | Company | `Organization.name` |
31
- | Position | `[:WORKS_FOR].title` AND `Person.currentTitle` (denormalised — Task 753) |
31
+ | Position | `[:WORKS_FOR].title` AND `Person.currentTitle` (denormalised) |
32
32
  | Connected On | `[:CONNECTED_ON_LINKEDIN].connectedOn` (ISO 8601) |
33
33
 
34
34
  The `Position` column is written **twice**: once on the `[:WORKS_FOR]` edge as the source of truth (preserves the per-employer history when a connection later moves), and again as `Person.currentTitle` so Neo4j's `entity_search` BM25 index reaches it. Edge properties are invisible to a node-only fulltext index, so without the denormalisation an operator searching "director" against 5K connections returns near-zero hits regardless of how many directors are in the graph. The SET is unconditional — re-importing a row with an empty Position clears `currentTitle`, matching the LinkedIn export's "current snapshot" semantics. To filter your import to a specific role before writing, use the [Selective-ingest threshold](#selective-ingest-threshold) gate.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=profile-update-not-applicable.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-update-not-applicable.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/profile-update-not-applicable.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Task 888 — `profile-update` accepts `notApplicable: boolean` as a
3
+ * first-class declination signal.
4
+ *
5
+ * Validation contract (these tests):
6
+ * - `notApplicable: true` is mutually exclusive with non-empty `value` —
7
+ * a declination has no value to record. Both-set is loud-fail.
8
+ * - `notApplicable: true` rejects `mode: "merge"` and `mode: "contradict"`
9
+ * — declination is immutable; reversal goes through `profile-delete`.
10
+ * - `notApplicable` defaults to `false`; existing callers that omit it
11
+ * keep the pre-Task-888 behaviour exactly.
12
+ *
13
+ * Write contract (covered by load-user-profile-sparse.test.ts via
14
+ * loadUserProfile + formatProfileSummary integration):
15
+ * - notApplicable rows count as covered for Coverage purposes.
16
+ * - notApplicable rows are filtered from the user-facing body.
17
+ *
18
+ * Validation throws BEFORE any session.run / embed call, so these tests
19
+ * don't need to mock neo4j-driver or the embeddings module — the throw
20
+ * fires in the synchronous validation block at the top of profileUpdate.
21
+ */
22
+ import { describe, it, expect } from "vitest";
23
+ import { profileUpdate } from "../profile-update.js";
24
+ const ACCT = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee";
25
+ const USER = "user-888-validation";
26
+ describe("profile-update — notApplicable validation (Task 888)", () => {
27
+ it("rejects (notApplicable: true, value: non-empty) — mutually exclusive", async () => {
28
+ await expect(profileUpdate({
29
+ accountId: ACCT,
30
+ userId: USER,
31
+ category: "communication",
32
+ key: "preferredChannel",
33
+ value: "whatsapp DM",
34
+ notApplicable: true,
35
+ })).rejects.toThrow(/mutually exclusive/);
36
+ });
37
+ it("rejects notApplicable: true with mode: 'merge'", async () => {
38
+ await expect(profileUpdate({
39
+ accountId: ACCT,
40
+ userId: USER,
41
+ category: "communication",
42
+ key: "preferredChannel",
43
+ value: "",
44
+ mode: "merge",
45
+ notApplicable: true,
46
+ })).rejects.toThrow(/rejects mode "merge"/);
47
+ });
48
+ it("rejects notApplicable: true with mode: 'contradict'", async () => {
49
+ await expect(profileUpdate({
50
+ accountId: ACCT,
51
+ userId: USER,
52
+ category: "communication",
53
+ key: "preferredChannel",
54
+ value: "",
55
+ mode: "contradict",
56
+ notApplicable: true,
57
+ })).rejects.toThrow(/rejects mode "contradict"/);
58
+ });
59
+ it("still rejects empty value when notApplicable is omitted/false (back-compat)", async () => {
60
+ await expect(profileUpdate({
61
+ accountId: ACCT,
62
+ userId: USER,
63
+ category: "communication",
64
+ key: "preferredChannel",
65
+ value: "",
66
+ })).rejects.toThrow(/Value is required/);
67
+ await expect(profileUpdate({
68
+ accountId: ACCT,
69
+ userId: USER,
70
+ category: "communication",
71
+ key: "preferredChannel",
72
+ value: " ",
73
+ notApplicable: false,
74
+ })).rejects.toThrow(/Value is required/);
75
+ });
76
+ it("still rejects unknown category before notApplicable check", async () => {
77
+ await expect(profileUpdate({
78
+ accountId: ACCT,
79
+ userId: USER,
80
+ category: "bogus-category",
81
+ key: "preferredChannel",
82
+ value: "",
83
+ notApplicable: true,
84
+ })).rejects.toThrow(/Invalid category/);
85
+ });
86
+ });
87
+ //# sourceMappingURL=profile-update-not-applicable.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-update-not-applicable.test.js","sourceRoot":"","sources":["../../../src/tools/__tests__/profile-update-not-applicable.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,IAAI,GAAG,sCAAsC,CAAC;AACpD,MAAM,IAAI,GAAG,qBAAqB,CAAC;AAEnC,QAAQ,CAAC,sDAAsD,EAAE,GAAG,EAAE;IACpE,EAAE,CAAC,sEAAsE,EAAE,KAAK,IAAI,EAAE;QACpF,MAAM,MAAM,CACV,aAAa,CAAC;YACZ,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,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QAAQ,EAAE,eAAe;YACzB,GAAG,EAAE,kBAAkB;YACvB,KAAK,EAAE,KAAK;YACZ,aAAa,EAAE,KAAK;SACrB,CAAC,CACH,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;QACzE,MAAM,MAAM,CACV,aAAa,CAAC;YACZ,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,gBAAgB;YAC1B,GAAG,EAAE,kBAAkB;YACvB,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,IAAI;SACpB,CAAC,CACH,CAAC,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -11,6 +11,7 @@ interface PreferenceRecord {
11
11
  confidence: number;
12
12
  source: string;
13
13
  observedAt: string;
14
+ notApplicable?: boolean;
14
15
  }
15
16
  interface EvidenceRecord {
16
17
  conversationName: string | null;
@@ -37,6 +38,7 @@ interface ProfileReadDetailResult {
37
38
  };
38
39
  }
39
40
  export declare function profileRead(params: ProfileReadParams): Promise<ProfileReadResult | ProfileReadDetailResult>;
41
+ export declare const PROFILE_FIELD_TEMPLATES: Record<string, readonly string[]>;
40
42
  export declare function formatProfileSummary(profile: Record<string, unknown>, preferences: PreferenceRecord[]): string;
41
43
  export {};
42
44
  //# sourceMappingURL=profile-read.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profile-read.d.ts","sourceRoot":"","sources":["../../src/tools/profile-read.ts"],"names":[],"mappings":"AAOA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,gBAAgB;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAA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oB,CAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,WAAW,EAAE,gBAAgB,EAAE,GAC9B,MAAM,CA+DR"}
@@ -7,12 +7,15 @@ export async function profileRead(params) {
7
7
  const { accountId, userId, detail } = params;
8
8
  const session = getSession();
9
9
  try {
10
+ // Task 888 — widen WHERE so a notApplicable Preference survives even
11
+ // if a future bug ever sets confidence wrong. Spec sets confidence: 1.0
12
+ // on notApplicable writes; the OR is belt-and-braces against drift.
10
13
  const result = await session.run(`
11
14
  OPTIONAL MATCH (up:UserProfile {accountId: $accountId, userId: $userId})
12
15
  WHERE ${notTrashed("up")}
13
16
  OPTIONAL MATCH (au:AdminUser {userId: $userId})-[:OWNS]->(p:Person {accountId: $accountId})
14
17
  OPTIONAL MATCH (up)-[:HAS_PREFERENCE]->(pref:Preference)
15
- WHERE pref.confidence >= $threshold AND ${notTrashed("pref")}
18
+ WHERE (pref.confidence >= $threshold OR pref.notApplicable = true) AND ${notTrashed("pref")}
16
19
  WITH up, p, pref
17
20
  ORDER BY pref.confidence DESC
18
21
  WITH up, p, collect(pref) AS allPrefs
@@ -56,6 +59,7 @@ export async function profileRead(params) {
56
59
  confidence: p.properties.confidence,
57
60
  source: p.properties.source,
58
61
  observedAt: p.properties.observedAt,
62
+ notApplicable: p.properties.notApplicable === true,
59
63
  }));
60
64
  if (!detail) {
61
65
  const summary = formatProfileSummary(profileProps, preferences);
@@ -114,6 +118,89 @@ const PROFILE_CATEGORIES = [
114
118
  "content",
115
119
  "interaction",
116
120
  ];
121
+ // Task 888 — canonical per-category Preference.key enumeration. Drives the
122
+ // field-level Coverage signal: `### Coverage / Missing: communication.preferredChannel, …`.
123
+ // A field is "covered" when at least one Preference exists with matching
124
+ // `(category, key)` AND (`confidence >= INJECTION_THRESHOLD` OR `notApplicable = true`).
125
+ //
126
+ // Adding a field is a one-line edit — no migration. Existing organic
127
+ // Preferences whose `key` doesn't match a template field still render in
128
+ // `## How they work`; they simply don't shrink Coverage. Coverage is
129
+ // template-driven, not graph-derived.
130
+ //
131
+ // Lockstep duplicate of the same literal in
132
+ // platform/plugins/memory/mcp/src/tools/profile-read.ts. The cross-process
133
+ // MCP runs in a separate node process AND vitest's mock boundary makes
134
+ // shared-module import unsafe; the `PROFILE_FIELD_TEMPLATES — cross-process
135
+ // lockstep` test in load-user-profile-sparse.test.ts asserts byte-equality
136
+ // of the literal across both files.
137
+ //
138
+ // Read-side bias for the agent (per IDENTITY.md § Conversational Memory):
139
+ // when satisfying a Missing field, the agent uses the EXACT `category` and
140
+ // `key` strings here as the MERGE-key on `profile-update`. Otherwise the
141
+ // organic key never shrinks Coverage and the user is re-asked.
142
+ export const PROFILE_FIELD_TEMPLATES = {
143
+ communication: [
144
+ "preferredChannel",
145
+ "quietHours",
146
+ "responseLatencyExpectation",
147
+ "formalityLevel",
148
+ "escalationPath",
149
+ ],
150
+ scheduling: [
151
+ "workdayStartTime",
152
+ "workdayEndTime",
153
+ "weekendAvailability",
154
+ "meetingBlockPreference",
155
+ "focusBlockTiming",
156
+ ],
157
+ decision: [
158
+ "riskTolerance",
159
+ "autonomyBoundary",
160
+ "evidenceThreshold",
161
+ "reversibilityPreference",
162
+ "stakeholderConsultation",
163
+ ],
164
+ workflow: [
165
+ "batchingPreference",
166
+ "taskGranularity",
167
+ "deepWorkBlocks",
168
+ "statusUpdateCadence",
169
+ "toolingChoices",
170
+ ],
171
+ content: [
172
+ "outputFormat",
173
+ "lengthPreference",
174
+ "citationStyle",
175
+ "tonality",
176
+ ],
177
+ interaction: [
178
+ "addressForm",
179
+ "humourTolerance",
180
+ "directnessLevel",
181
+ "emotionalRegisterPreference",
182
+ ],
183
+ };
184
+ // Compute the absent fields list (`category.key`) given the live preferences.
185
+ // A field is covered when at least one Preference matches its (category, key)
186
+ // AND is either above the injection threshold OR has notApplicable: true.
187
+ function computeAbsentFields(preferences) {
188
+ const covered = new Set();
189
+ for (const pref of preferences) {
190
+ const isCovered = pref.notApplicable === true || pref.confidence >= INJECTION_THRESHOLD;
191
+ if (isCovered)
192
+ covered.add(`${pref.category}.${pref.key}`);
193
+ }
194
+ const absent = [];
195
+ for (const [category, fields] of Object.entries(PROFILE_FIELD_TEMPLATES)) {
196
+ for (const field of fields) {
197
+ const dotted = `${category}.${field}`;
198
+ if (!covered.has(dotted))
199
+ absent.push(dotted);
200
+ }
201
+ }
202
+ return absent;
203
+ }
117
204
  // Profile summary format — also implemented in neo4j-store.ts (loadUserProfile).
118
205
  // Changes here must be reflected there and vice versa.
119
206
  export function formatProfileSummary(profile, preferences) {
@@ -131,9 +218,13 @@ export function formatProfileSummary(profile, preferences) {
131
218
  : "";
132
219
  const lines = [`## About the Owner\n`];
133
220
  lines.push(`${name}${role}${tz}${locale}${expertise}\n`);
134
- // Group by category
221
+ // Task 888 — body grouping uses only Preferences with a real value;
222
+ // notApplicable: true rows count as covered for Coverage but have no
223
+ // value to render in the body.
135
224
  const categories = {};
136
225
  for (const pref of preferences) {
226
+ if (pref.notApplicable === true)
227
+ continue;
137
228
  if (!categories[pref.category])
138
229
  categories[pref.category] = [];
139
230
  categories[pref.category].push(pref);
@@ -158,13 +249,14 @@ export function formatProfileSummary(profile, preferences) {
158
249
  }
159
250
  lines.push("");
160
251
  }
161
- // Coverage block names absent canonical categories so the agent can bias
162
- // one elicitation per turn toward expanding sparse coverage. Silent when
163
- // every category carries ≥1 Preference above threshold.
164
- const absent = PROFILE_CATEGORIES.filter((c) => !categories[c]);
165
- if (absent.length > 0) {
252
+ // Task 888 — Coverage block names absent canonical FIELDS (was categories
253
+ // pre-Task-888). A field is covered when a Preference with matching
254
+ // (category, key) exists AND has confidence above threshold OR
255
+ // notApplicable: true. Silent when every template field is covered.
256
+ const absentFields = computeAbsentFields(preferences);
257
+ if (absentFields.length > 0) {
166
258
  lines.push(`### Coverage`);
167
- lines.push(`Missing: ${absent.join(", ")}`);
259
+ lines.push(`Missing: ${absentFields.join(", ")}`);
168
260
  lines.push("");
169
261
  }
170
262
  return lines.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,CAAC;AAChB,CAAC"}
@@ -8,6 +8,25 @@ interface ProfileUpdateParams {
8
8
  mode?: "reinforce" | "update" | "contradict" | "merge";
9
9
  conversationId?: string;
10
10
  profileFields?: Record<string, unknown>;
11
+ /**
12
+ * Task 888 — first-class "this field doesn't apply to me" signal.
13
+ *
14
+ * When `true`, writes a Preference with `notApplicable: true` and
15
+ * `confidence: 1.0`. The field is then treated as covered by the
16
+ * Coverage block in `formatProfileSummary`, the agent stops eliciting
17
+ * for it, and the row is filtered from the user-facing `## How they
18
+ * work` body (no value to render).
19
+ *
20
+ * Validation:
21
+ * - Mutually exclusive with non-empty `value` (rejects loudly — a
22
+ * declination has no value to record).
23
+ * - Rejects `mode: "merge"` and `mode: "contradict"` — declination
24
+ * is immutable once set; the agent must call `profile-delete` if
25
+ * the user reverses themselves later.
26
+ * - Forces `confidence: 1.0` regardless of caller-supplied value,
27
+ * and bypasses the reinforcement-curve update on existing rows.
28
+ */
29
+ notApplicable?: boolean;
11
30
  /**
12
31
  * Task 886 §D — operator-identity fields written to the OWNS-bound
13
32
  * Person node, NOT to UserProfile. Pre-Task-886 the agent had no tool
@@ -1 +1 @@
1
- {"version":3,"file":"profile-update.d.ts","sourceRoot":"","sources":["../../src/tools/profile-update.ts"],"names":[],"mappings":"AAqBA,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,GAAG,aAAa,CAAC;IACpC,IAAI,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC;;;;;;;;;;;;;;;OAeG;IACH,YAAY,CAAC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,CAAC;IACrB,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,cAAc,GAAG,QAAQ,CAAC;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAoT9B"}
@@ -16,14 +16,25 @@ const VALID_CATEGORIES = new Set([
16
16
  ]);
17
17
  const VALID_MODES = new Set(["reinforce", "update", "contradict", "merge"]);
18
18
  export async function profileUpdate(params) {
19
- const { accountId, userId, category, key, value, source = "behavioural", mode = "reinforce", conversationId, profileFields, personFields, mergeSourceIds, } = params;
19
+ const { accountId, userId, category, key, value, source = "behavioural", mode = "reinforce", conversationId, profileFields, personFields, mergeSourceIds, notApplicable = false, } = params;
20
20
  if (!VALID_CATEGORIES.has(category)) {
21
21
  throw new Error(`Invalid category "${category}". Must be one of: ${[...VALID_CATEGORIES].join(", ")}`);
22
22
  }
23
23
  if (!VALID_MODES.has(mode)) {
24
24
  throw new Error(`Invalid mode "${mode}". Must be one of: ${[...VALID_MODES].join(", ")}`);
25
25
  }
26
- if (!value || value.trim().length === 0) {
26
+ // Task 888 — notApplicable validation. Mutually exclusive with non-empty
27
+ // value; rejects mode merge|contradict (declination is immutable once
28
+ // set — the agent calls profile-delete if the user reverses themselves).
29
+ if (notApplicable === true) {
30
+ if (typeof value === "string" && value.trim().length > 0) {
31
+ throw new Error("profile-update: `notApplicable: true` is mutually exclusive with a non-empty `value` — a declination has no value to record.");
32
+ }
33
+ if (mode === "merge" || mode === "contradict") {
34
+ throw new Error(`profile-update: \`notApplicable: true\` rejects mode "${mode}" — declination is immutable once set. Call profile-delete to reverse.`);
35
+ }
36
+ }
37
+ else if (!value || value.trim().length === 0) {
27
38
  throw new Error("Value is required and cannot be empty.");
28
39
  }
29
40
  if (mode === "merge" && (!mergeSourceIds || mergeSourceIds.length === 0)) {
@@ -121,34 +132,46 @@ export async function profileUpdate(params) {
121
132
  const existingConfidence = existingResult.records[0].get("confidence");
122
133
  let newConfidence;
123
134
  let action;
124
- switch (mode) {
125
- case "reinforce":
126
- // Converge toward 1.0: increment scaled by distance from max
127
- newConfidence = Math.min(1.0, existingConfidence + REINFORCEMENT_INCREMENT * (1.0 - existingConfidence));
128
- action = "reinforced";
129
- break;
130
- case "update":
131
- newConfidence = existingConfidence;
132
- action = "updated";
133
- break;
134
- case "contradict":
135
- newConfidence = Math.max(0.0, existingConfidence - CONTRADICTION_DECREMENT);
136
- action = "contradicted";
137
- break;
138
- default:
139
- newConfidence = existingConfidence;
140
- action = "updated";
135
+ // Task 888 — notApplicable bypasses the reinforcement curve and forces
136
+ // confidence: 1.0. The action label "updated" matches the existing
137
+ // contract for in-place writes (the agent doesn't need a new label
138
+ // for declination the notApplicable flag carries the semantic).
139
+ if (notApplicable === true) {
140
+ newConfidence = 1.0;
141
+ action = "updated";
142
+ }
143
+ else {
144
+ switch (mode) {
145
+ case "reinforce":
146
+ // Converge toward 1.0: increment scaled by distance from max
147
+ newConfidence = Math.min(1.0, existingConfidence + REINFORCEMENT_INCREMENT * (1.0 - existingConfidence));
148
+ action = "reinforced";
149
+ break;
150
+ case "update":
151
+ newConfidence = existingConfidence;
152
+ action = "updated";
153
+ break;
154
+ case "contradict":
155
+ newConfidence = Math.max(0.0, existingConfidence - CONTRADICTION_DECREMENT);
156
+ action = "contradicted";
157
+ break;
158
+ default:
159
+ newConfidence = existingConfidence;
160
+ action = "updated";
161
+ }
141
162
  }
163
+ const writeValue = notApplicable === true ? "" : value;
142
164
  const updateProps = {
143
165
  accountId,
144
166
  preferenceId: existingId,
145
- value,
167
+ value: writeValue,
146
168
  source,
147
169
  confidence: newConfidence,
148
170
  observedAt: now,
149
171
  updatedAt: now,
172
+ notApplicable: notApplicable === true,
150
173
  };
151
- if (embedding)
174
+ if (embedding && notApplicable !== true)
152
175
  updateProps.embedding = embedding;
153
176
  await session.run(`
154
177
  MATCH (pref:Preference {preferenceId: $preferenceId, accountId: $accountId})
@@ -156,9 +179,13 @@ export async function profileUpdate(params) {
156
179
  pref.source = $source,
157
180
  pref.confidence = $confidence,
158
181
  pref.observedAt = $observedAt,
159
- pref.updatedAt = $updatedAt
160
- ${embedding ? ", pref.embedding = $embedding" : ""}
182
+ pref.updatedAt = $updatedAt,
183
+ pref.notApplicable = $notApplicable
184
+ ${embedding && notApplicable !== true ? ", pref.embedding = $embedding" : ""}
161
185
  `, updateProps);
186
+ if (notApplicable === true) {
187
+ process.stderr.write(`[profile] not-applicable accountId=${accountId.slice(0, 8)}… userId=${userId} field=${category}.${key}\n`);
188
+ }
162
189
  // Add evidence link if conversationId provided
163
190
  if (conversationId) {
164
191
  await session.run(`
@@ -170,6 +197,8 @@ export async function profileUpdate(params) {
170
197
  return { preferenceId: existingId, action, confidence: newConfidence };
171
198
  }
172
199
  // New preference — create node and link to UserProfile
200
+ // Task 888 — notApplicable forces confidence: 1.0 and stamps the flag;
201
+ // value is empty (declination has no value to record).
173
202
  const preferenceId = randomUUID();
174
203
  const createProps = {
175
204
  preferenceId,
@@ -177,21 +206,25 @@ export async function profileUpdate(params) {
177
206
  userId,
178
207
  category,
179
208
  key,
180
- value,
181
- confidence: INITIAL_CONFIDENCE,
209
+ value: notApplicable === true ? "" : value,
210
+ confidence: notApplicable === true ? 1.0 : INITIAL_CONFIDENCE,
182
211
  source,
183
212
  observedAt: now,
184
213
  createdAt: now,
185
214
  updatedAt: now,
186
215
  scope: "admin",
216
+ notApplicable: notApplicable === true,
187
217
  };
188
- if (embedding)
218
+ if (embedding && notApplicable !== true)
189
219
  createProps.embedding = embedding;
190
220
  await session.run(`
191
221
  MATCH (up:UserProfile {accountId: $accountId, userId: $userId})
192
222
  CREATE (pref:Preference $props)
193
223
  CREATE (up)-[:HAS_PREFERENCE]->(pref)
194
224
  `, { accountId, userId, props: createProps });
225
+ if (notApplicable === true) {
226
+ process.stderr.write(`[profile] not-applicable accountId=${accountId.slice(0, 8)}… userId=${userId} field=${category}.${key}\n`);
227
+ }
195
228
  // Add evidence link if conversationId provided
196
229
  if (conversationId) {
197
230
  await session.run(`
@@ -203,7 +236,7 @@ export async function profileUpdate(params) {
203
236
  return {
204
237
  preferenceId,
205
238
  action: "created",
206
- confidence: INITIAL_CONFIDENCE,
239
+ confidence: notApplicable === true ? 1.0 : INITIAL_CONFIDENCE,
207
240
  };
208
241
  }
209
242
  finally {