@resolveio/server-lib 22.3.187 → 22.3.189
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.
- package/methods/ai-terminal.js +6 -6
- package/methods/ai-terminal.js.map +1 -1
- package/package.json +1 -1
- package/util/ai-run-evidence-adapters.d.ts +36 -0
- package/util/ai-run-evidence-adapters.js +231 -12
- package/util/ai-run-evidence-adapters.js.map +1 -1
- package/util/aicoder-runner-v6.d.ts +3 -0
- package/util/aicoder-runner-v6.js +27 -7
- package/util/aicoder-runner-v6.js.map +1 -1
package/methods/ai-terminal.js
CHANGED
|
@@ -523,8 +523,8 @@ var AI_ASSISTANT_REPORT_BUILDER_EXPERT_PLAYBOOK = [
|
|
|
523
523
|
'- List report: simple flat records without grouped buckets or time-series grouping.',
|
|
524
524
|
'',
|
|
525
525
|
'2) Resolve the target dataset safely.',
|
|
526
|
-
'-
|
|
527
|
-
'- Treat heuristics, aliases,
|
|
526
|
+
'- Build a structured dataset-resolution contract from routes, app heuristics, field hints, schema hints, and small verification probes.',
|
|
527
|
+
'- Treat heuristics, aliases, token matches, and natural-language similarity as candidate generators only. Do not rely on them until a verified collection, field, date, and permission contract exists.',
|
|
528
528
|
'- Prefer report-* collections when permissionView is under /report-builder.',
|
|
529
529
|
'- If a report-* collection is unavailable, keep using REPORT_BUILDER_* with the best-matched family collection; the bridge can fall back to direct collection reads safely.',
|
|
530
530
|
'- Never use *.versions unless user explicitly requests bug-history/version investigation.',
|
|
@@ -615,11 +615,11 @@ function buildAssistantSystemPromptText(platformPrompt) {
|
|
|
615
615
|
'Accuracy & tools:',
|
|
616
616
|
'- Step 1 (always): determine the target collections/models/modules/workflows using context, routes, and collection hints. Assume the user is non-technical and will not provide internal names.',
|
|
617
617
|
'- Never use *.versions collections for normal requests. Only use a .versions collection when explicitly investigating a bug by checking the last ~5 updates.',
|
|
618
|
-
'- Planning stage:
|
|
618
|
+
'- Planning stage: build a structured resolution contract from collectionName/model definitions, methods, publications, Angular routes/modules, app heuristics, and verification probes. Text/token matches are weak signals only.',
|
|
619
619
|
'- For engineering/debugging requests, inspect the relevant files first, form a concrete hypothesis, verify it with code/data, and then fix the issue when asked.',
|
|
620
620
|
'- If permissionView starts with /report-builder, prefer the report-* collection when both report and base collections exist.',
|
|
621
621
|
'- If a report-* collection is unavailable, keep using REPORT_BUILDER_READ/REPORT_BUILDER_AGG with the best-matched collection family; the bridge can safely fall back to direct collection access.',
|
|
622
|
-
'- Map user wording to internal collections/fields
|
|
622
|
+
'- Map user wording to internal collections/fields through a validated structured contract. Do not ask for property names unless required to run a query.',
|
|
623
623
|
'- Use app heuristics and context hints as weak signals only. Verify collection and field guesses before relying on them.',
|
|
624
624
|
'- Distinguish the root business object from related measured details. Example: if the user asks for jobs and chemicals sent, jobs/work orders are the root and chemicals are joined detail, not necessarily the root collection.',
|
|
625
625
|
'- Do not guess or invent collections/fields. If unsure, verify in the codebase or run a small REPORT_BUILDER_READ probe (limit 1-5) to learn the shape.',
|
|
@@ -630,9 +630,9 @@ function buildAssistantSystemPromptText(platformPrompt) {
|
|
|
630
630
|
'- Ask at most one clarifying question only when required to run a query or resolve missing details.',
|
|
631
631
|
'- If a field starts with id_ and refers to another collection, treat it as a foreign key and look up the related record when needed.',
|
|
632
632
|
'- When resolving id_* fields, prefer lookup definitions from collection schemas/report-builder lookup tables to choose the target collection and name fields.',
|
|
633
|
-
'- When the user provides a customer, well, or chemical name,
|
|
633
|
+
'- When the user provides a customer, well, or chemical name, create candidate filters and verify them with a tiny scoped probe or ID/name lookup before answering. Regex/text matching is only a candidate-generation step.',
|
|
634
634
|
'- Use the codebase context to choose correct collections/fields/workflows and use REPORT_BUILDER_READ/REPORT_BUILDER_AGG to answer with real data when needed.',
|
|
635
|
-
'- Process (fast path): Queue ->
|
|
635
|
+
'- Process (fast path): Queue -> Structured planning contract -> Verified data probe/query -> Actionability contract -> Draft response. This should be fast, but every data answer must have a verified query result class before it is presented.',
|
|
636
636
|
'- Assume a relevant collection exists; if verification reads return zero data, report no data found instead of interrogating the user.',
|
|
637
637
|
'- Never claim "no data exists" unless you resolved a collection and executed a legitimate query (with fallback date fields when needed) that returned zero rows.',
|
|
638
638
|
'- If a query returns zero rows, run a tiny probe read (limit 1-3) to validate fields and adjust filters/projection before concluding.',
|