@axiom-lattice/core 3.0.5 → 3.0.7
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/dist/index.d.mts +34 -3
- package/dist/index.d.ts +34 -3
- package/dist/index.js +372 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +371 -74
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10789,6 +10789,24 @@ cases, you MUST ask the user via ask_user_to_clarify \u2014 never proceed
|
|
|
10789
10789
|
with an assumed expectation. A test case written against a guessed
|
|
10790
10790
|
expectation validates the wrong thing. When in doubt, ask.
|
|
10791
10791
|
|
|
10792
|
+
## Knowledge in Skills (apply to EVERY sub-skill workflow)
|
|
10793
|
+
|
|
10794
|
+
**Domain knowledge lives in SKILL.md files, not in prompts.** The
|
|
10795
|
+
deliverable's knowledge (rules, formats, decision logic, procedures) is
|
|
10796
|
+
authored as skills; the executable (agent prompt, workflow step) stays
|
|
10797
|
+
THIN \u2014 role/process only, loading knowledge via "Load [[skill-name]]
|
|
10798
|
+
and follow it". Never write domain knowledge directly into a system
|
|
10799
|
+
prompt or a workflow step's prompt.
|
|
10800
|
+
|
|
10801
|
+
Why: knowledge in prompts cannot be reused, individually verified, or
|
|
10802
|
+
evolved. Knowledge in skills is shared (subSkills), regression-tested
|
|
10803
|
+
([[eval-verify]]), and improved without touching the executable.
|
|
10804
|
+
|
|
10805
|
+
Applies to every construction path: [[learn-capability]] (skills are
|
|
10806
|
+
the primary output), [[agent-build]] (agent prompt thin, loads skill),
|
|
10807
|
+
[[design-workflow]] (steps reference [[skill-name]] or ref to
|
|
10808
|
+
skill-loading agents). All three follow this single principle.
|
|
10809
|
+
|
|
10792
10810
|
## Goal-Driven Validation (apply to EVERY sub-skill workflow)
|
|
10793
10811
|
|
|
10794
10812
|
The agent evaluates goal achievement ITSELF via multi-dimensional test
|
|
@@ -10808,6 +10826,29 @@ green = goal achieved (per [[completion-gate]] and [[eval-verify]]).
|
|
|
10808
10826
|
The goal model is the acceptance standard \u2014 contentAssertion must
|
|
10809
10827
|
encode the usable state, not just technical correctness.
|
|
10810
10828
|
|
|
10829
|
+
## Undefined Tasks (outside the skill map)
|
|
10830
|
+
|
|
10831
|
+
If the request does not match any sub-skill workflow: do NOT guess, do
|
|
10832
|
+
NOT refuse, do NOT force-fit an existing flow. Follow the
|
|
10833
|
+
EXPLORE \u2192 PROPOSE \u2192 CONFIRM protocol:
|
|
10834
|
+
|
|
10835
|
+
1. **Explore** \u2014 inventory before proposing anything:
|
|
10836
|
+
\`list_agents\` / \`load_skills\` (existing assets), \`list_tools\` /
|
|
10837
|
+
\`list_middleware_types\` (capabilities), \`list_connections\`
|
|
10838
|
+
(data sources), eval projects (verification), docs at hand.
|
|
10839
|
+
Goal: know what is reusable and what is missing.
|
|
10840
|
+
2. **Propose** \u2014 present 2-3 concrete options, each with: what it
|
|
10841
|
+
does, cost, risk, and what it needs (new tools / new skills /
|
|
10842
|
+
approvals).
|
|
10843
|
+
3. **Confirm** \u2014 the user picks an option or adjusts it. Never
|
|
10844
|
+
execute without a chosen option.
|
|
10845
|
+
4. **New capability needed?** (new tool type, new skill, new
|
|
10846
|
+
connection) \u2014 include creating it ([[create-skill]] / connection
|
|
10847
|
+
setup) IN the proposed option; never silently proceed without it.
|
|
10848
|
+
5. **Boundary honesty** \u2014 state clearly what the architect cannot do
|
|
10849
|
+
(e.g. deploy to production, monitor runtime, change frontend),
|
|
10850
|
+
and give the alternative \u2014 never overpromise or silently refuse.
|
|
10851
|
+
|
|
10811
10852
|
## Skill Map
|
|
10812
10853
|
- [[learn-capability]] \u2014 Learn from any source material (user
|
|
10813
10854
|
description, documents, API specs, conversations, spreadsheets) and
|
|
@@ -10916,6 +10957,9 @@ Do NOT create tasks for:
|
|
|
10916
10957
|
**A task is a living record of the GOAL + ACCEPTANCE CRITERIA** \u2014 not a
|
|
10917
10958
|
todo label. Every task's description must carry:
|
|
10918
10959
|
|
|
10960
|
+
- **Goal Model** \u2014 the full goal model ([[agent-architecture|Goal
|
|
10961
|
+
Model]]): real goal, consumer (who uses the result), usable state
|
|
10962
|
+
(what "done and usable" means concretely)
|
|
10919
10963
|
- **Objective** \u2014 one measurable sentence: what result to achieve
|
|
10920
10964
|
- **Acceptance Criteria** \u2014 checkboxes that define "done": when ALL
|
|
10921
10965
|
are checked, the task is verifiably complete
|
|
@@ -11066,8 +11110,13 @@ When unsure, use \`show_widget\` for visual comparison.
|
|
|
11066
11110
|
- **Follow [[agent-architecture|Goal Model]]** \u2014 establish the goal
|
|
11067
11111
|
model (real goal / consumer / usable state) and design the agent to
|
|
11068
11112
|
achieve it; verification is goal-driven ([[agent-architecture|Goal-Driven Validation]]).
|
|
11069
|
-
- **
|
|
11070
|
-
|
|
11113
|
+
- **Follow [[agent-architecture|Knowledge in Skills]]** \u2014 the prompt is
|
|
11114
|
+
thin (role/behavior); domain knowledge lives in SKILL.md which the
|
|
11115
|
+
agent loads ("Load [[skill-name]] and follow it"). Never write
|
|
11116
|
+
domain knowledge directly into a system prompt.
|
|
11117
|
+
- **NEVER build before confirming.** Design \u2192 confirm via
|
|
11118
|
+
\`ask_user_to_clarify\` \u2192 wait for approval \u2192 only then build.
|
|
11119
|
+
No exceptions.
|
|
11071
11120
|
- **Track with tasks once scope is clear.** After requirements are
|
|
11072
11121
|
clarified, create the parent task ([[task-tracking]]) before starting
|
|
11073
11122
|
design. Don't create tasks during clarification.
|
|
@@ -11080,18 +11129,23 @@ When unsure, use \`show_widget\` for visual comparison.
|
|
|
11080
11129
|
|
|
11081
11130
|
## REACT design steps
|
|
11082
11131
|
|
|
11083
|
-
1.
|
|
11132
|
+
1. **Establish the goal model FIRST** \u2014 real goal / user expectation /
|
|
11133
|
+
consumer / usable state ([[agent-architecture|Goal Model]]); record
|
|
11134
|
+
it in the parent task. Design, build, and verification all derive
|
|
11135
|
+
from it. Only then:
|
|
11084
11136
|
2. Choose middleware \u2014 call \`list_tools\` and \`list_middleware_types\`
|
|
11085
11137
|
first. MUST include \`ask_user_to_clarify\` if the agent needs
|
|
11086
11138
|
confirmation or clarifying questions.
|
|
11087
11139
|
3. Write the system prompt: role \u2192 workflow \u2192 constraints
|
|
11088
11140
|
4. Present the design with \`show_widget\`
|
|
11089
|
-
5.
|
|
11141
|
+
5. Confirm via \`ask_user_to_clarify\` \u2014 do NOT build until approved
|
|
11090
11142
|
6. Build with \`create_agent\`
|
|
11091
11143
|
|
|
11092
11144
|
## DEEP_AGENT design steps
|
|
11093
11145
|
|
|
11094
|
-
1.
|
|
11146
|
+
1. **Establish the goal model FIRST** \u2014 real goal / consumer / usable
|
|
11147
|
+
state, recorded in the parent task ([[agent-architecture|Goal
|
|
11148
|
+
Model]]); then explain why DEEP_AGENT is the right choice
|
|
11095
11149
|
2. Capability mapping with \`show_widget\`
|
|
11096
11150
|
3. System prompt emphasizes dynamic todo workflow (analyze \u2192 break
|
|
11097
11151
|
into todos \u2192 work one at a time \u2192 refine). Middleware: code_eval,
|
|
@@ -11278,22 +11332,70 @@ subSkills:
|
|
|
11278
11332
|
(hold-out, never run during fix loop)
|
|
11279
11333
|
- 0.2 \u2460 \u2192 {skill}-api-verified \u2014 queryability assertion, single step
|
|
11280
11334
|
|
|
11281
|
-
## Layered verification (orchestrator +
|
|
11282
|
-
|
|
11283
|
-
When the design
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11335
|
+
## Layered verification (orchestrator + components)
|
|
11336
|
+
|
|
11337
|
+
When the design delegates to other agents, verification is layered.
|
|
11338
|
+
"Orchestrator" = a parent deep_agent with subAgents (learn-capability
|
|
11339
|
+
Phase 2) OR a workflow with \`ref\` steps ([[design-workflow]]).
|
|
11340
|
+
"Components" = the subAgents / ref'd agents it calls. Order is MANDATORY:
|
|
11341
|
+
**component evals first, integration second** \u2014 never run the
|
|
11342
|
+
integration eval before every component eval passes.
|
|
11343
|
+
|
|
11344
|
+
- **Each component**: its OWN eval project (eval-{sub-agent-id} /
|
|
11345
|
+
eval-{ref-agent-id}) \u2014 the sub capability is verified independently,
|
|
11346
|
+
with its own fix loop.
|
|
11347
|
+
- **The orchestrator**: an integration eval project (eval-{parent-id} /
|
|
11348
|
+
eval-{workflow-id}). Integration cases: full end-to-end task input \u2192
|
|
11349
|
+
orchestrator invokes components \u2192 final aggregated output \u2192
|
|
11350
|
+
contentAssertion on the final result. This verifies ORCHESTRATION
|
|
11351
|
+
(does the orchestrator call the right components in the right order
|
|
11352
|
+
and aggregate correctly).
|
|
11353
|
+
- **Workflow integration cases** also include branch paths and \`ask\`
|
|
11354
|
+
handling (see Workflow testing below) \u2014 but only AFTER the ref'd
|
|
11355
|
+
agents are independently verified.
|
|
11356
|
+
- **Orchestrator trust upgrade** requires BOTH: all component evals pass
|
|
11357
|
+
AND the orchestrator's integration eval passes. The orchestrator's
|
|
11358
|
+
metadata (verified/source) records this dependency.
|
|
11359
|
+
- Independent agents (no parent, no ref) keep single-level eval \u2014 no
|
|
11360
|
+
integration layer needed.
|
|
11361
|
+
|
|
11362
|
+
## Workflow testing (WORKFLOW-type agents)
|
|
11363
|
+
|
|
11364
|
+
Workflows compile to the same agent registry and run through the same
|
|
11365
|
+
eval path \u2014 same project naming (eval-{agent-id}), same case structure
|
|
11366
|
+
(inputMessage + steps + contentAssertion). Design differs because the
|
|
11367
|
+
pipeline is DETERMINISTIC:
|
|
11368
|
+
|
|
11369
|
+
- **One case per branch path** \u2014 each if/map/parallel route gets a case
|
|
11370
|
+
whose inputMessage drives it down that path; contentAssertion = the
|
|
11371
|
+
exact output that path must produce (from the expected output spec,
|
|
11372
|
+
Phase 1.5 in [[design-workflow]]).
|
|
11373
|
+
- **Goal-driven dimensions** \u2014 cases cover all four dimensions
|
|
11374
|
+
([[agent-architecture|Goal-Driven Validation]]), not just happy paths:
|
|
11375
|
+
- Functional correctness \u2014 each branch path produces the right result
|
|
11376
|
+
- Edge robustness \u2014 empty input, if-condition not met, map source
|
|
11377
|
+
empty, malformed data: the pipeline must fail gracefully or take
|
|
11378
|
+
the designed fallback, not crash
|
|
11379
|
+
- Business usability \u2014 output reaches the usable state (usable-state
|
|
11380
|
+
cases come from the confirmed spec, never invented)
|
|
11381
|
+
- Consumer fit \u2014 exact fields/format for system consumers, readable
|
|
11382
|
+
for human consumers
|
|
11383
|
+
- **Data contract cases** \u2014 intermediate \`{{refs}}\` handoffs and
|
|
11384
|
+
\`map\` source shapes are contracts; a contract broken mid-pipeline
|
|
11385
|
+
only surfaces at the end. One case per non-trivial handoff asserting
|
|
11386
|
+
the intermediate output shape (source data + step output).
|
|
11387
|
+
- **\`ask\` steps** \u2014 case interruptPolicy controls them
|
|
11388
|
+
(mode: stop | auto-approve | auto-reject | canned-response):
|
|
11389
|
+
- \`stop\` \u2192 the run pauses at the ask; assert the partial output
|
|
11390
|
+
BEFORE the interaction point
|
|
11391
|
+
- auto-approve / auto-reject / canned-response \u2192 supply the response
|
|
11392
|
+
and continue; assert the flow AFTER the interaction point
|
|
11393
|
+
- \`value\` holds the response text (defaults "\u540C\u610F"/"\u62D2\u7EDD" for
|
|
11394
|
+
approve/reject)
|
|
11395
|
+
- **Exact assertions** \u2014 deterministic pipeline means expected outputs
|
|
11396
|
+
are precise; judge still scores semantics on top.
|
|
11397
|
+
- **Trust upgrade is the same gate** \u2014 [[completion-gate]] applies to
|
|
11398
|
+
workflows: no eval \u2192 stays configured, never verified.
|
|
11297
11399
|
|
|
11298
11400
|
## Run
|
|
11299
11401
|
|
|
@@ -11359,11 +11461,39 @@ verified: unverified
|
|
|
11359
11461
|
# Design Workflow \u2014 WORKFLOW Agent Design
|
|
11360
11462
|
|
|
11361
11463
|
Use the WORKFLOW type when the process is fully known \u2014 a deterministic
|
|
11362
|
-
state machine with pre-defined paths.
|
|
11464
|
+
state machine with pre-defined paths. If the process is NOT fully known
|
|
11465
|
+
(open-ended, needs dynamic decomposition) \u2192 use [[learn-capability]] /
|
|
11466
|
+
[[agent-build]] (REACT / DEEP_AGENT) instead.
|
|
11363
11467
|
Follow [[agent-architecture|User Interaction Rules]] and
|
|
11364
11468
|
[[agent-architecture|Goal Model]] \u2014 establish the goal model (real
|
|
11365
11469
|
goal / consumer / usable state) before designing, and design steps
|
|
11366
11470
|
that achieve it. Acceptance = workflow outcome meets the usable state.
|
|
11471
|
+
Follow [[agent-architecture|Knowledge in Skills]]: workflow steps
|
|
11472
|
+
orchestrate; domain knowledge lives in SKILL.md. Never write domain
|
|
11473
|
+
knowledge directly into a step's prompt \u2014 load it via [[skill-name]]
|
|
11474
|
+
or delegate to an agent that loads the skill.
|
|
11475
|
+
|
|
11476
|
+
## CRITICAL RULES
|
|
11477
|
+
- **NEVER build before confirming.** Design \u2192 present the flow as a
|
|
11478
|
+
widget \u2192 discuss step-by-step with the user \u2192 confirm via
|
|
11479
|
+
\`ask_user_to_clarify\` (blocking approval) \u2192 only then call
|
|
11480
|
+
\`create_workflow\`. No exceptions.
|
|
11481
|
+
- **Always visualize the design** \u2014 present with \`show_widget\` as a
|
|
11482
|
+
Flowchart (every step, branch, \`ask\` interaction point) \u2014 never a
|
|
11483
|
+
bare text list (see Visual communication below).
|
|
11484
|
+
- **One decision at a time.** Each message asks exactly one question.
|
|
11485
|
+
- **Track with tasks once scope is clear.** Create the parent task
|
|
11486
|
+
([[task-tracking]]) before designing; record the expected output spec
|
|
11487
|
+
(Phase 1.5) in it.
|
|
11488
|
+
|
|
11489
|
+
## Visual communication
|
|
11490
|
+
|
|
11491
|
+
Use \`show_widget\` for all structure explanations \u2014 never ASCII art.
|
|
11492
|
+
| Scenario | What |
|
|
11493
|
+
|----------|------|
|
|
11494
|
+
| Workflow flow | Flowchart (steps, branches, ask points) |
|
|
11495
|
+
| Step-level comparison | Comparison cards |
|
|
11496
|
+
| Data flow / {{refs}} | Flowchart |
|
|
11367
11497
|
|
|
11368
11498
|
## Phase 0: Load Skills
|
|
11369
11499
|
|
|
@@ -11373,20 +11503,122 @@ that achieve it. Acceptance = workflow outcome meets the usable state.
|
|
|
11373
11503
|
|
|
11374
11504
|
## Phase 1: Design
|
|
11375
11505
|
|
|
11376
|
-
1.
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
4.
|
|
11380
|
-
|
|
11381
|
-
|
|
11506
|
+
1. **Establish the goal model FIRST** \u2014 real goal / user expectation /
|
|
11507
|
+
consumer / usable state ([[agent-architecture|Goal Model]]); record
|
|
11508
|
+
it in the parent task. It drives the expected output spec (Phase
|
|
11509
|
+
1.5) and verification (Phase 4). Then analyze the process: map
|
|
11510
|
+
every step, branch, data dependency.
|
|
11511
|
+
2. **Choose implementation mode per step \u2014 ASK the user** (present as
|
|
11512
|
+
comparison cards). Each step's logic is either inline or \`ref\`:
|
|
11513
|
+
- **inline prompt** \u2014 logic lives in the step's prompt. Fast, no
|
|
11514
|
+
extra agents. Cost: not reusable, no own tools, verified ONLY via
|
|
11515
|
+
the integration eval. OK for trivial one-off glue steps.
|
|
11516
|
+
- **ref sub-agent** \u2014 the step delegates to a registered agent with
|
|
11517
|
+
its own tools/model/skills (built via [[agent-build]], prompt =
|
|
11518
|
+
"Load [[skill-name]] and follow it"). Reusable, independently
|
|
11519
|
+
verified (Phase 2.6). Use when the step needs tools, non-trivial
|
|
11520
|
+
or reusable logic, or independent verification.
|
|
11521
|
+
Present the per-step choice with trade-offs and let the user
|
|
11522
|
+
decide \u2014 NEVER silently pick inline or ref. When in doubt, ask.
|
|
11523
|
+
3. **Identify knowledge per step** \u2014 for each step, determine the domain
|
|
11524
|
+
knowledge it needs:
|
|
11525
|
+
- Existing skill covers it \u2192 reference [[skill-name]] in the step
|
|
11526
|
+
- No skill yet, but the knowledge is reusable or non-trivial \u2192
|
|
11527
|
+
plan to create it (Phase 1.5)
|
|
11528
|
+
- Trivial one-off logic \u2192 may stay inline in the prompt (accept the
|
|
11529
|
+
trade-off: it is not reusable or individually verifiable)
|
|
11530
|
+
4. Design using the YAML linear DSL (steps, parallel, map, if, ask).
|
|
11531
|
+
5. **Present the design as a Flowchart widget** (\`show_widget\`) \u2014 every
|
|
11532
|
+
step, branch, and \`ask\` interaction point. Walk through it with the
|
|
11533
|
+
user step-by-step (each step's responsibility, branch logic, ask
|
|
11534
|
+
points). CONFIRM via \`ask_user_to_clarify\` \u2014 never build without
|
|
11535
|
+
explicit user approval.
|
|
11536
|
+
|
|
11537
|
+
## Phase 1.5: Expected Output Specification (mandatory \u2014 goal-driven)
|
|
11538
|
+
|
|
11539
|
+
Define the workflow's EXPECTED OUTPUT SPEC from the goal model BEFORE
|
|
11540
|
+
writing skills or building: what the final outcome looks like, per
|
|
11541
|
+
consumer (0.1.5). This is the acceptance standard \u2014 [[eval-verify]]
|
|
11542
|
+
contentAssertion derives from it. HARD RULE: if the target/expected
|
|
11543
|
+
output is unclear, ask the user \u2014 never guess.
|
|
11544
|
+
Present the spec, confirm with the user, record in the parent task.
|
|
11545
|
+
|
|
11546
|
+
## Phase 2: Create Skills (for missing knowledge)
|
|
11547
|
+
|
|
11548
|
+
For each planned skill (Phase 1.2): write SKILL.md (frontmatter +
|
|
11549
|
+
body encoding the domain rules). Present each for user approval.
|
|
11550
|
+
When 3+ skills share a domain \u2192 create a MOC ([[domain-moc]]).
|
|
11551
|
+
If a ref step needs an agent \u2192 build it via [[agent-build]] (agent
|
|
11552
|
+
prompt = "Load [[skill-name]] and follow it" \u2014 thin, knowledge in
|
|
11553
|
+
skill). Order: sub-agents/skills first, then the workflow that
|
|
11554
|
+
references them.
|
|
11555
|
+
|
|
11556
|
+
## Phase 2.6: Verify components FIRST (mandatory)
|
|
11557
|
+
|
|
11558
|
+
Every agent referenced by a \`ref\` step is a component with its OWN
|
|
11559
|
+
independent eval (eval-{ref-agent-id}) \u2014 run it and pass it BEFORE
|
|
11560
|
+
building the integration eval. The workflow cannot be considered tested
|
|
11561
|
+
until: \u2460 each ref'd agent's eval passes independently, \u2461 then the
|
|
11562
|
+
workflow's integration eval (branch paths + ask handling) passes. See
|
|
11563
|
+
[[eval-verify|Layered verification]].
|
|
11564
|
+
|
|
11565
|
+
## Phase 3: Build
|
|
11566
|
+
|
|
11567
|
+
1. **Configure middleware & tools for the workflow itself** \u2014 inline
|
|
11568
|
+
steps run on the workflow's own model/tools: call
|
|
11569
|
+
\`list_middleware_types\` first; add what the workflow needs \u2014 skill
|
|
11570
|
+
(if steps load [[skill-name]]), widget, ask_user_to_clarify, etc.
|
|
11571
|
+
Tool filtering via \`allowedTools\`. \`ref\` steps use the ref'd
|
|
11572
|
+
agent's own tools/model \u2014 nothing to configure here. Choose
|
|
11573
|
+
\`modelKey\` only when a specific model is required (default
|
|
11574
|
+
otherwise).
|
|
11575
|
+
2. Call \`create_workflow\` with \`skillLoaded: true\` \u2014 steps reference
|
|
11576
|
+
[[skill-name]] or \`ref\` to skill-loading agents.
|
|
11577
|
+
3. Then \`validate_workflow(id)\`.
|
|
11578
|
+
|
|
11579
|
+
## Phase 4: Test (mandatory \u2014 no eval, no trust tier)
|
|
11580
|
+
|
|
11581
|
+
The authoritative verification is [[eval-verify]] \u2014 cases derive from
|
|
11582
|
+
the expected output spec (Phase 1.5). A workflow without a passing eval
|
|
11583
|
+
stays at "configured" forever \u2014 trust can never upgrade
|
|
11584
|
+
([[completion-gate]], no skip option).
|
|
11585
|
+
|
|
11586
|
+
**Testing is managed through the eval project (eval-{workflow-id})
|
|
11587
|
+
and its cases \u2014 the same governance as agents.** Temporary or quick
|
|
11588
|
+
checks (ad-hoc runs, previewing behavior) may use [[review-agent]] as
|
|
11589
|
+
an interactive pre-check \u2014 but that is NOT the workflow's test suite:
|
|
11590
|
+
it never upgrades trust and never replaces the eval project. Only the
|
|
11591
|
+
eval project's cases passing determine "tested".
|
|
11592
|
+
|
|
11593
|
+
**Test order \u2014 components first, then integration:**
|
|
11594
|
+
1. Each \`ref\`'d agent: its OWN eval (eval-{ref-agent-id}) must pass
|
|
11595
|
+
independently (Phase 2.6) \u2014 fix it in isolation, not through the
|
|
11596
|
+
workflow.
|
|
11597
|
+
2. Then the workflow's integration eval (eval-{workflow-id}): one case
|
|
11598
|
+
per branch path (if/map/parallel); \`ask\` steps via case
|
|
11599
|
+
interruptPolicy (auto-approve/canned-response to test the flow AFTER
|
|
11600
|
+
the pause, stop to test up to the pause); assertions are exact \u2014
|
|
11601
|
+
the pipeline is deterministic.
|
|
11602
|
+
|
|
11603
|
+
Workflow trust upgrade requires BOTH layers passing.
|
|
11604
|
+
[[review-agent]] is an optional cheap pre-check only.
|
|
11605
|
+
|
|
11606
|
+
## Editing workflows
|
|
11607
|
+
|
|
11608
|
+
Get the current YAML \u2192 present the diff \u2192 confirm with the user \u2192
|
|
11609
|
+
\`update_workflow(id, ...)\`. Never re-create.
|
|
11610
|
+
After ANY change: verified resets to unverified and the eval is re-run
|
|
11611
|
+
([[eval-verify]]) \u2014 the change is not done until the eval passes again.
|
|
11612
|
+
Deleting: warn if any step \`ref\`s it \u2192 confirm \u2192 \`delete_agent\`.
|
|
11382
11613
|
|
|
11383
|
-
|
|
11384
|
-
\`validate_workflow(id)\`.
|
|
11385
|
-
|
|
11386
|
-
## Phase 3: Test
|
|
11614
|
+
## Metadata
|
|
11387
11615
|
|
|
11388
|
-
|
|
11389
|
-
|
|
11616
|
+
Always set metadata on workflow creation. At minimum:
|
|
11617
|
+
- verified: "unverified" (upgraded after eval passes)
|
|
11618
|
+
- version: "1.0" (bump on each update)
|
|
11619
|
+
- source: the material name or "user-description"
|
|
11620
|
+
When trust upgrades, update BOTH the skill's verified frontmatter and
|
|
11621
|
+
the workflow's metadata.verified \u2014 they must stay in sync.
|
|
11390
11622
|
|
|
11391
11623
|
## No edges, state fields, or end step
|
|
11392
11624
|
The engine auto-generates them. Steps execute top-to-bottom in written
|
|
@@ -21733,10 +21965,36 @@ TASK MANAGEMENT IS A CORE DUTY, not a per-skill option. Whenever the
|
|
|
21733
21965
|
goal is clear and you know what to do, create a task FIRST (manage_task)
|
|
21734
21966
|
before executing \u2014 for any multi-step work: learning, building,
|
|
21735
21967
|
modifying, fixing, anything with an Objective and Acceptance Criteria.
|
|
21736
|
-
|
|
21968
|
+
- **Check for duplicates BEFORE creating** \u2014 always manage_task
|
|
21969
|
+
action: "list" first (filter ownerType: "agent"). If a task with the
|
|
21970
|
+
same objective already exists (e.g. from an interrupted session),
|
|
21971
|
+
RESUME it instead of creating a new one.
|
|
21972
|
+
- **Decompose into subtasks** \u2014 after the parent task, create a
|
|
21973
|
+
subtask per work item / phase (e.g. design, build, eval), each with
|
|
21974
|
+
its own Objective + Acceptance Criteria.
|
|
21975
|
+
- **Update on completion** \u2014 every finished subtask and the parent:
|
|
21976
|
+
manage_task update(status: "completed", result: "what was done").
|
|
21977
|
+
Use interrupted/failed with summary/failureReason when blocked or
|
|
21978
|
+
unable. Status must always reflect reality \u2014 never leave a finished
|
|
21979
|
+
task dangling in an in-progress state.
|
|
21980
|
+
See [[task-tracking]].
|
|
21737
21981
|
The sub-skills below only ADD their own task details on top of this
|
|
21738
21982
|
universal duty.
|
|
21739
21983
|
|
|
21984
|
+
BUILD GATES \u2014 hard behavioral requirements, no exceptions, no skipping:
|
|
21985
|
+
- Creating a WORKFLOW ([[design-workflow]]): \u2460 show the design as a
|
|
21986
|
+
Flowchart widget (every step, branch, ask point) \u2461 walk through it
|
|
21987
|
+
step-by-step with the user \u2462 ask inline-vs-ref per step \u2463 CONFIRM via
|
|
21988
|
+
ask_user_to_clarify \u2014 only then call create_workflow.
|
|
21989
|
+
- Creating an AGENT ([[agent-build]]): \u2460 present the design with
|
|
21990
|
+
show_widget \u2461 confirm via ask_user_to_clarify \u2014 only then call
|
|
21991
|
+
create_agent.
|
|
21992
|
+
- Both: if the goal model (real goal / consumer / usable state) is
|
|
21993
|
+
unclear, ask BEFORE designing \u2014 never guess.
|
|
21994
|
+
The skills document WHY and HOW; these gates are the unskippable
|
|
21995
|
+
minimum. If you cannot satisfy a gate (e.g. user says skip), record it
|
|
21996
|
+
and proceed only on the user's explicit instruction.
|
|
21997
|
+
|
|
21740
21998
|
Your sub-skills (accessible via the MOC or direct loading):
|
|
21741
21999
|
- [[learn-capability]] \u2014 Learn from any source material \u2192 skills + agents
|
|
21742
22000
|
- [[agent-build]] \u2014 Design and build single agents (REACT/DEEP_AGENT)
|
|
@@ -25851,7 +26109,7 @@ File content: ${files[key4]}`
|
|
|
25851
26109
|
{
|
|
25852
26110
|
dimension: "correctness",
|
|
25853
26111
|
weight: 100,
|
|
25854
|
-
description: "\
|
|
26112
|
+
description: "Overall correctness \u2014 whether the result matches the expected output description."
|
|
25855
26113
|
}
|
|
25856
26114
|
];
|
|
25857
26115
|
const evalRubrics = evalCase.eval.eval_rubrics && evalCase.eval.eval_rubrics.length > 0 ? evalCase.eval.eval_rubrics : defaultRubrics;
|
|
@@ -25865,53 +26123,53 @@ File content: ${files[key4]}`
|
|
|
25865
26123
|
${evalRubrics.map(
|
|
25866
26124
|
(r) => `- **${r.dimension}**\uFF08\u6743\u91CD\uFF1A${r.weight}\uFF09\uFF1A${r.description}`
|
|
25867
26125
|
).join("\n")}`;
|
|
25868
|
-
const testPrompt = `#
|
|
25869
|
-
|
|
26126
|
+
const testPrompt = `# Role
|
|
26127
|
+
You are a senior AI Agent evaluation expert. Your job is to perform a "black-box test" judgment of the agent's execution process and results against the preset evaluation rubrics.
|
|
25870
26128
|
|
|
25871
|
-
#
|
|
25872
|
-
|
|
26129
|
+
# Input Information
|
|
26130
|
+
The test framework provides you with the following five core contexts:
|
|
25873
26131
|
|
|
25874
|
-
1.
|
|
26132
|
+
1. **User Intent**: ${evalCase.input.message}
|
|
25875
26133
|
|
|
25876
|
-
2.
|
|
26134
|
+
2. **Input Files**: ${testCaseFilesContent || "None"}
|
|
25877
26135
|
|
|
25878
|
-
3.
|
|
26136
|
+
3. **Execution Trajectory** (the agent's full message/tool-call record):
|
|
25879
26137
|
${trajectory}
|
|
25880
26138
|
|
|
25881
|
-
4.
|
|
26139
|
+
4. **Final Output** (the agent's last reply):
|
|
25882
26140
|
${finalOutput}
|
|
25883
26141
|
|
|
25884
|
-
5.
|
|
26142
|
+
5. **Expected Output Description**: ${evalCase.eval.content_assertion}
|
|
25885
26143
|
${rubricsSection}
|
|
25886
26144
|
|
|
25887
|
-
#
|
|
25888
|
-
|
|
26145
|
+
# Task
|
|
26146
|
+
You must strictly evaluate the agent against every rubric in the "Evaluation Rubrics" section, using both the "Execution Trajectory" and the "Final Output". Evaluate the final result AND whether the process correctly performed the required intermediate steps (tool calls, information retrieval, etc.).
|
|
25889
26147
|
|
|
25890
|
-
#
|
|
25891
|
-
1.
|
|
25892
|
-
2.
|
|
25893
|
-
3.
|
|
25894
|
-
4.
|
|
25895
|
-
5.
|
|
25896
|
-
6. **HITL
|
|
25897
|
-
7. **HITL
|
|
26148
|
+
# Rules
|
|
26149
|
+
1. **Objectivity**: Judge solely from the provided context. If the standard requires "contains a number" but the output has only text, points must be deducted even if the tone is good.
|
|
26150
|
+
2. **Result verification**: If the "Final Output" is missing expected content, or does not meet the criteria in the "Evaluation Rubrics", the corresponding rubric must be marked as failed.
|
|
26151
|
+
3. **Process verification**: If the "Execution Trajectory" shows the agent did not perform a necessary intermediate step (e.g., should have called a tool but did not), deduct points on the corresponding rubric even if the final output looks plausible.
|
|
26152
|
+
4. **Evidence-based**: When giving a reason, you must quote specific content from the execution trajectory or final output.
|
|
26153
|
+
5. **Weighted scoring**: The final score is the weighted sum of the rubric scores (on a 0-100 scale).
|
|
26154
|
+
6. **HITL interrupt judgment**: If the trajectory contains a "HITL pause: agent requested human input" entry, the agent is waiting for human confirmation. Treat this as the business behavior under test: if the expected output requires autonomous completion (e.g., "execute automatically without confirmation"), requesting human input should be judged a failure; if the expected output requires confirmation or approval first (e.g., "must request approval before executing"), requesting human input is correct behavior \u2014 judge its timing and content, passing or scoring according to the rubrics.
|
|
26155
|
+
7. **HITL auto-response judgment**: If a "HITL pause" entry is followed by an "auto-responded (test policy auto-approve/auto-reject/canned-response)" entry, the test framework injected a human reply and the flow continued \u2014 evaluate the behavior AFTER the pause as the complete flow (e.g., whether the operation was correctly executed after approval), and check whether the auto-response content matches a reasonable human reply.
|
|
25898
26156
|
|
|
25899
|
-
#
|
|
25900
|
-
|
|
26157
|
+
# Output Format (JSON only)
|
|
26158
|
+
You MUST reply with JSON only, using this structure:
|
|
25901
26159
|
{
|
|
25902
26160
|
"pass": true | false,
|
|
25903
26161
|
"final_score": number,
|
|
25904
26162
|
"dimension_results": [
|
|
25905
26163
|
{
|
|
25906
|
-
"name": "
|
|
26164
|
+
"name": "rubric name",
|
|
25907
26165
|
"score": number,
|
|
25908
|
-
"reason": "
|
|
26166
|
+
"reason": "specific reason for deduction or credit, citing evidence"
|
|
25909
26167
|
}
|
|
25910
26168
|
],
|
|
25911
|
-
"summary": "
|
|
26169
|
+
"summary": "overall evaluation of the agent's performance"
|
|
25912
26170
|
}
|
|
25913
26171
|
|
|
25914
|
-
|
|
26172
|
+
Note: if final_score >= 80 and there are no fatal errors, pass should be true; otherwise false.`;
|
|
25915
26173
|
this.lastTestPrompt = testPrompt;
|
|
25916
26174
|
const judgeThreadId = v44();
|
|
25917
26175
|
this.lastJudgeThreadId = judgeThreadId;
|
|
@@ -26294,6 +26552,32 @@ var LatticeEvalSuite = class {
|
|
|
26294
26552
|
import { AgentType as AgentType6 } from "@axiom-lattice/protocols";
|
|
26295
26553
|
import { HumanMessage as HumanMessage5 } from "@langchain/core/messages";
|
|
26296
26554
|
import { v4 as uuidv46 } from "uuid";
|
|
26555
|
+
var DEFAULT_CALIBRATION_PROBES = [
|
|
26556
|
+
{
|
|
26557
|
+
id: "catch-up-correct",
|
|
26558
|
+
task: "A train leaves Station A at 10:00 AM traveling at 60 mph. A second train leaves Station A at 10:30 AM traveling at 90 mph on the same route. The final answer must be the time (HH:MM) at which the second train catches up to the first.",
|
|
26559
|
+
finalOutput: "11:30",
|
|
26560
|
+
expectedPass: true
|
|
26561
|
+
},
|
|
26562
|
+
{
|
|
26563
|
+
id: "catch-up-wrong",
|
|
26564
|
+
task: "A train leaves Station A at 10:00 AM traveling at 60 mph. A second train leaves Station A at 10:30 AM traveling at 90 mph on the same route. The final answer must be the time (HH:MM) at which the second train catches up to the first.",
|
|
26565
|
+
finalOutput: "12:30",
|
|
26566
|
+
expectedPass: false
|
|
26567
|
+
},
|
|
26568
|
+
{
|
|
26569
|
+
id: "discount-tax-correct",
|
|
26570
|
+
task: "A store offers a 20% discount on an item priced at $150, then adds 8% sales tax to the discounted price. The final answer must be the total price in dollars.",
|
|
26571
|
+
finalOutput: "129.6",
|
|
26572
|
+
expectedPass: true
|
|
26573
|
+
},
|
|
26574
|
+
{
|
|
26575
|
+
id: "discount-tax-wrong",
|
|
26576
|
+
task: "A store offers a 20% discount on an item priced at $150, then adds 8% sales tax to the discounted price. The final answer must be the total price in dollars.",
|
|
26577
|
+
finalOutput: "162",
|
|
26578
|
+
expectedPass: false
|
|
26579
|
+
}
|
|
26580
|
+
];
|
|
26297
26581
|
var LatticeEvalProject = class {
|
|
26298
26582
|
constructor(project, onCaseComplete) {
|
|
26299
26583
|
this.suites = /* @__PURE__ */ new Map();
|
|
@@ -26401,21 +26685,22 @@ var LatticeEvalProject = class {
|
|
|
26401
26685
|
}
|
|
26402
26686
|
/**
|
|
26403
26687
|
* Verify the judge agent can produce parseable, correct verdicts
|
|
26404
|
-
* before committing to a full run. Uses
|
|
26405
|
-
*
|
|
26688
|
+
* before committing to a full run. Uses known-answer probes (default
|
|
26689
|
+
* multi-step reasoning set, overridable per project via
|
|
26690
|
+
* judge_agent_config.calibration_cases) to catch broken judges.
|
|
26691
|
+
* Checks both the pass verdict and the final_score direction.
|
|
26406
26692
|
*/
|
|
26407
26693
|
async calibrateJudge() {
|
|
26408
26694
|
const tenantId2 = this.project.lattice_server_config.tenant_id || "default";
|
|
26409
26695
|
const judgeAgent = await getAgentClient(tenantId2, this.judgeAgentKey);
|
|
26410
|
-
const
|
|
26411
|
-
|
|
26412
|
-
|
|
26413
|
-
|
|
26414
|
-
|
|
26415
|
-
|
|
26416
|
-
|
|
26417
|
-
|
|
26418
|
-
\u4EC5\u8F93\u51FA JSON\uFF1A{"pass": true|false, "final_score": 0-100, "summary": "\u7406\u7531"}`;
|
|
26696
|
+
const probes = this.project.judge_agent_config.calibration_cases && this.project.judge_agent_config.calibration_cases.length > 0 ? this.project.judge_agent_config.calibration_cases : DEFAULT_CALIBRATION_PROBES;
|
|
26697
|
+
for (const probe of probes) {
|
|
26698
|
+
const trajectorySection = probe.trajectory ? `
|
|
26699
|
+
Trajectory: ${probe.trajectory}` : "";
|
|
26700
|
+
const prompt = `You are an evaluation expert. Judge whether the final output meets the expected output description.
|
|
26701
|
+
Expected output description: ${probe.task}
|
|
26702
|
+
Final output: ${probe.finalOutput}${trajectorySection}
|
|
26703
|
+
Respond with JSON only: {"pass": true|false, "final_score": 0-100, "summary": "reason"}`;
|
|
26419
26704
|
let raw = "";
|
|
26420
26705
|
let invokeError = null;
|
|
26421
26706
|
for (let attempt = 0; attempt < 2; attempt++) {
|
|
@@ -26440,13 +26725,24 @@ var LatticeEvalProject = class {
|
|
|
26440
26725
|
return { ok: false, reason: `Calibration output unparseable: ${parsed.error}`, bypassed: true };
|
|
26441
26726
|
}
|
|
26442
26727
|
const actualPass = parsed.pass !== void 0 ? parsed.pass : (parsed.final_score ?? 0) >= 80;
|
|
26443
|
-
if (actualPass !==
|
|
26728
|
+
if (actualPass !== probe.expectedPass) {
|
|
26444
26729
|
return {
|
|
26445
26730
|
ok: false,
|
|
26446
|
-
reason: `Calibration mismatch
|
|
26731
|
+
reason: `Calibration mismatch (probe=${probe.id}): expected ${probe.expectedPass ? "PASS" : "FAIL"}, judge said ${actualPass ? "PASS" : "FAIL"}`,
|
|
26447
26732
|
bypassed: true
|
|
26448
26733
|
};
|
|
26449
26734
|
}
|
|
26735
|
+
if (parsed.final_score !== void 0) {
|
|
26736
|
+
const minScore = probe.expectedScoreMin ?? 80;
|
|
26737
|
+
const scoreOk = probe.expectedPass ? parsed.final_score >= minScore : parsed.final_score < minScore;
|
|
26738
|
+
if (!scoreOk) {
|
|
26739
|
+
return {
|
|
26740
|
+
ok: false,
|
|
26741
|
+
reason: `Calibration score mismatch (probe=${probe.id}): expected ${probe.expectedPass ? "final_score >= " + minScore : "final_score < " + minScore}, judge gave ${parsed.final_score}`,
|
|
26742
|
+
bypassed: true
|
|
26743
|
+
};
|
|
26744
|
+
}
|
|
26745
|
+
}
|
|
26450
26746
|
}
|
|
26451
26747
|
return { ok: true };
|
|
26452
26748
|
}
|
|
@@ -30838,6 +31134,7 @@ export {
|
|
|
30838
31134
|
ConsoleLoggerClient,
|
|
30839
31135
|
CustomMetricsClient,
|
|
30840
31136
|
CustomMiddlewareRegistry,
|
|
31137
|
+
DEFAULT_CALIBRATION_PROBES,
|
|
30841
31138
|
DaytonaInstance,
|
|
30842
31139
|
DaytonaProvider,
|
|
30843
31140
|
DefaultScheduleClient,
|