voratiq 0.1.0-beta.20 → 0.1.0-beta.21

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 (85) hide show
  1. package/dist/agents/runtime/policy.d.ts +1 -1
  2. package/dist/bin.js +50 -19
  3. package/dist/cli/contract.d.ts +35 -5
  4. package/dist/cli/contract.js +42 -5
  5. package/dist/cli/list.js +4 -1
  6. package/dist/cli/message.d.ts +28 -0
  7. package/dist/cli/message.js +147 -0
  8. package/dist/cli/operator-envelope.d.ts +22 -1
  9. package/dist/cli/operator-envelope.js +48 -3
  10. package/dist/cli/reduce.js +5 -2
  11. package/dist/cli/verify.js +6 -2
  12. package/dist/commands/list/command.d.ts +1 -0
  13. package/dist/commands/list/command.js +117 -7
  14. package/dist/commands/message/command.d.ts +23 -0
  15. package/dist/commands/message/command.js +215 -0
  16. package/dist/commands/message/errors.d.ts +9 -0
  17. package/dist/commands/message/errors.js +20 -0
  18. package/dist/commands/message/lifecycle.d.ts +14 -0
  19. package/dist/commands/message/lifecycle.js +128 -0
  20. package/dist/commands/reduce/command.d.ts +1 -0
  21. package/dist/commands/reduce/command.js +3 -1
  22. package/dist/commands/reduce/targets.d.ts +1 -0
  23. package/dist/commands/reduce/targets.js +48 -2
  24. package/dist/commands/shared/resolve-stage-competitors.js +4 -1
  25. package/dist/commands/verify/command.d.ts +1 -0
  26. package/dist/commands/verify/command.js +2 -1
  27. package/dist/commands/verify/max-parallel.d.ts +1 -1
  28. package/dist/commands/verify/max-parallel.js +3 -1
  29. package/dist/commands/verify/targets.d.ts +2 -1
  30. package/dist/commands/verify/targets.js +154 -22
  31. package/dist/configs/agents/defaults.js +25 -25
  32. package/dist/configs/orchestration/bootstrap.d.ts +6 -1
  33. package/dist/configs/orchestration/bootstrap.js +27 -6
  34. package/dist/configs/orchestration/types.d.ts +25 -10
  35. package/dist/configs/orchestration/types.js +10 -6
  36. package/dist/configs/verification/types.d.ts +5 -0
  37. package/dist/configs/verification/types.js +3 -0
  38. package/dist/contracts/list.d.ts +38 -4
  39. package/dist/contracts/list.js +30 -1
  40. package/dist/domain/message/competition/adapter.d.ts +36 -0
  41. package/dist/domain/message/competition/adapter.js +197 -0
  42. package/dist/domain/message/competition/prompt.d.ts +8 -0
  43. package/dist/domain/message/competition/prompt.js +29 -0
  44. package/dist/domain/message/model/mutators.d.ts +17 -0
  45. package/dist/domain/message/model/mutators.js +107 -0
  46. package/dist/domain/message/model/types.d.ts +100 -0
  47. package/dist/domain/message/model/types.js +87 -0
  48. package/dist/domain/message/persistence/adapter.d.ts +43 -0
  49. package/dist/domain/message/persistence/adapter.js +124 -0
  50. package/dist/domain/reduce/competition/adapter.d.ts +1 -0
  51. package/dist/domain/reduce/competition/adapter.js +57 -4
  52. package/dist/domain/reduce/competition/prompt.d.ts +1 -1
  53. package/dist/domain/reduce/model/types.d.ts +3 -0
  54. package/dist/domain/reduce/model/types.js +2 -1
  55. package/dist/domain/verify/competition/adapter.js +8 -5
  56. package/dist/domain/verify/competition/programmatic.js +3 -0
  57. package/dist/domain/verify/competition/prompt.js +6 -0
  58. package/dist/domain/verify/competition/rubric.js +7 -1
  59. package/dist/domain/verify/competition/shared-layout.d.ts +42 -2
  60. package/dist/domain/verify/competition/shared-layout.js +92 -21
  61. package/dist/domain/verify/competition/target.d.ts +17 -0
  62. package/dist/domain/verify/model/types.d.ts +20 -2
  63. package/dist/domain/verify/model/types.js +15 -2
  64. package/dist/mcp/server.d.ts +2 -2
  65. package/dist/mcp/server.js +30 -13
  66. package/dist/policy/verification.js +2 -0
  67. package/dist/preflight/index.d.ts +2 -0
  68. package/dist/preflight/index.js +3 -1
  69. package/dist/render/transcripts/list.d.ts +2 -0
  70. package/dist/render/transcripts/list.js +24 -0
  71. package/dist/render/transcripts/message.d.ts +72 -0
  72. package/dist/render/transcripts/message.js +362 -0
  73. package/dist/render/transcripts/stage-progress.d.ts +1 -1
  74. package/dist/render/transcripts/verify.d.ts +4 -0
  75. package/dist/render/transcripts/verify.js +7 -1
  76. package/dist/render/utils/transcript-shell.d.ts +1 -1
  77. package/dist/render/utils/transcript-shell.js +6 -0
  78. package/dist/status/index.d.ts +21 -0
  79. package/dist/status/index.js +30 -0
  80. package/dist/workspace/setup.js +13 -7
  81. package/dist/workspace/structure.d.ts +14 -6
  82. package/dist/workspace/structure.js +25 -9
  83. package/dist/workspace/verification-defaults.d.ts +1 -1
  84. package/dist/workspace/verification-defaults.js +255 -0
  85. package/package.json +15 -16
@@ -1,19 +1,22 @@
1
1
  import { agentIdSchema } from "../configs/agents/types.js";
2
2
  import { assertRepoRelativePath, resolvePathWithinRoot, } from "../utils/path.js";
3
3
  export const VORATIQ_DIR = ".voratiq";
4
+ export const VORATIQ_SPEC_DIR = "spec";
5
+ export const VORATIQ_SPEC_FILE = "spec/index.json";
6
+ export const VORATIQ_SPEC_SESSIONS_DIR = "spec/sessions";
4
7
  export const VORATIQ_RUN_DIR = "run";
5
8
  export const VORATIQ_RUN_FILE = "run/index.json";
6
9
  export const VORATIQ_RUN_SESSIONS_DIR = "run/sessions";
7
10
  export const VORATIQ_REDUCTION_DIR = "reduce";
8
11
  export const VORATIQ_REDUCTION_FILE = "reduce/index.json";
9
12
  export const VORATIQ_REDUCTION_SESSIONS_DIR = "reduce/sessions";
10
- export const VORATIQ_SPEC_DIR = "spec";
11
- export const VORATIQ_SPEC_FILE = "spec/index.json";
12
- export const VORATIQ_SPEC_SESSIONS_DIR = "spec/sessions";
13
13
  export const VORATIQ_VERIFICATION_DIR = "verify";
14
14
  export const VORATIQ_VERIFICATION_FILE = "verify/index.json";
15
15
  export const VORATIQ_VERIFICATION_SESSIONS_DIR = "verify/sessions";
16
16
  export const VORATIQ_VERIFICATION_TEMPLATES_DIR = "verify/templates";
17
+ export const VORATIQ_MESSAGE_DIR = "message";
18
+ export const VORATIQ_MESSAGE_FILE = "message/index.json";
19
+ export const VORATIQ_MESSAGE_SESSIONS_DIR = "message/sessions";
17
20
  export const VORATIQ_INTERACTIVE_DIR = "interactive";
18
21
  export const VORATIQ_INTERACTIVE_FILE = "interactive/index.json";
19
22
  export const VORATIQ_INTERACTIVE_SESSIONS_DIR = "interactive/sessions";
@@ -35,6 +38,7 @@ export const CHAT_JSON_FILENAME = "chat.json";
35
38
  export const CHAT_JSONL_FILENAME = "chat.jsonl";
36
39
  export const REDUCTION_FILENAME = "reduction.md";
37
40
  export const REDUCTION_DATA_FILENAME = "reduction.json";
41
+ export const MESSAGE_RESPONSE_FILENAME = "response.md";
38
42
  export const RUNTIME_DIRNAME = "runtime";
39
43
  export const ARTIFACTS_DIRNAME = "artifacts";
40
44
  export const MANIFEST_FILENAME = "manifest.json";
@@ -109,6 +113,15 @@ export function getSpecHistoryLockPath() {
109
113
  export function getSpecSessionsDirectoryPath() {
110
114
  return getDomainSessionsDirectoryPath(VORATIQ_SPEC_DIR);
111
115
  }
116
+ export function getReductionDirectoryPath() {
117
+ return getDomainDirectoryPath(VORATIQ_REDUCTION_DIR);
118
+ }
119
+ export function getReductionIndexPath() {
120
+ return getDomainIndexPath(VORATIQ_REDUCTION_DIR);
121
+ }
122
+ export function getReductionSessionsDirectoryPath() {
123
+ return getDomainSessionsDirectoryPath(VORATIQ_REDUCTION_DIR);
124
+ }
112
125
  export function getVerificationDirectoryPath() {
113
126
  return getDomainDirectoryPath(VORATIQ_VERIFICATION_DIR);
114
127
  }
@@ -118,14 +131,14 @@ export function getVerificationIndexPath() {
118
131
  export function getVerificationSessionsDirectoryPath() {
119
132
  return getDomainSessionsDirectoryPath(VORATIQ_VERIFICATION_DIR);
120
133
  }
121
- export function getReductionDirectoryPath() {
122
- return getDomainDirectoryPath(VORATIQ_REDUCTION_DIR);
134
+ export function getMessageDirectoryPath() {
135
+ return getDomainDirectoryPath(VORATIQ_MESSAGE_DIR);
123
136
  }
124
- export function getReductionIndexPath() {
125
- return getDomainIndexPath(VORATIQ_REDUCTION_DIR);
137
+ export function getMessageIndexPath() {
138
+ return getDomainIndexPath(VORATIQ_MESSAGE_DIR);
126
139
  }
127
- export function getReductionSessionsDirectoryPath() {
128
- return getDomainSessionsDirectoryPath(VORATIQ_REDUCTION_DIR);
140
+ export function getMessageSessionsDirectoryPath() {
141
+ return getDomainSessionsDirectoryPath(VORATIQ_MESSAGE_DIR);
129
142
  }
130
143
  export function getInteractiveDirectoryPath() {
131
144
  return getDomainDirectoryPath(VORATIQ_INTERACTIVE_DIR);
@@ -160,6 +173,9 @@ export function getSpecSessionDirectoryPath(sessionId) {
160
173
  export function getReductionSessionDirectoryPath(sessionId) {
161
174
  return getSessionDirectoryPath(VORATIQ_REDUCTION_DIR, sessionId);
162
175
  }
176
+ export function getMessageSessionDirectoryPath(sessionId) {
177
+ return getSessionDirectoryPath(VORATIQ_MESSAGE_DIR, sessionId);
178
+ }
163
179
  export function getVerificationSessionDirectoryPath(sessionId) {
164
180
  return getSessionDirectoryPath(VORATIQ_VERIFICATION_DIR, sessionId);
165
181
  }
@@ -4,7 +4,7 @@ export declare function buildDefaultVerificationConfigYaml(params: {
4
4
  environment: EnvironmentConfig;
5
5
  }): Promise<string>;
6
6
  export interface ShippedVerificationTemplate {
7
- name: "spec-verification" | "run-verification" | "reduce-verification";
7
+ name: "spec-verification" | "run-verification" | "reduce-verification" | "message-verification";
8
8
  prompt: string;
9
9
  rubric: string;
10
10
  schema: string;
@@ -4,6 +4,7 @@ import { detectProgrammaticSuggestions } from "../configs/verification/programma
4
4
  const DEFAULT_SPEC_RUBRIC = [{ template: "spec-verification" }];
5
5
  const DEFAULT_RUN_RUBRIC = [{ template: "run-verification" }];
6
6
  const DEFAULT_REDUCE_RUBRIC = [{ template: "reduce-verification" }];
7
+ const DEFAULT_MESSAGE_RUBRIC = [{ template: "message-verification" }];
7
8
  export async function buildDefaultVerificationConfigYaml(params) {
8
9
  const suggestions = await detectProgrammaticSuggestions(params.root, params.environment);
9
10
  const runProgrammaticDefaults = listDetectedProgrammaticDefaults(suggestions).flatMap((entry) => {
@@ -16,6 +17,8 @@ export async function buildDefaultVerificationConfigYaml(params) {
16
17
  appendRunStage(lines, runProgrammaticDefaults);
17
18
  lines.push("");
18
19
  appendRubricStage(lines, "reduce", DEFAULT_REDUCE_RUBRIC);
20
+ lines.push("");
21
+ appendRubricStage(lines, "message", DEFAULT_MESSAGE_RUBRIC);
19
22
  return `${lines.join("\n")}\n`;
20
23
  }
21
24
  function appendRunStage(lines, runProgrammaticDefaults) {
@@ -757,6 +760,258 @@ properties:
757
760
  type: array
758
761
  items:
759
762
  type: string
763
+ `,
764
+ },
765
+ {
766
+ name: "message-verification",
767
+ prompt: `You are a blinded verifier agent reviewing multiple message responses to the same prompt and choosing the single best response artifact to carry forward.
768
+
769
+ Inputs:
770
+
771
+ - the original message prompt
772
+ - the full blinded response set
773
+ - any shared context needed to understand the prompt
774
+
775
+ Expected working style:
776
+
777
+ 1. Read the original message prompt first.
778
+ 2. Derive the key response requirements the prompt establishes and use stable ids such as \`R1\`, \`R2\`, \`R3\`.
779
+ 3. Inspect the blinded response set directly.
780
+ 4. Assess each response against the verification rubric.
781
+ 5. Record per-response requirement coverage, completion posture, recommendation posture, and bounded follow-up work.
782
+ 6. Derive a strict best-to-worst ranking from those assessments.
783
+ 7. Make the ranking strict, complete, and tie-free across the full eligible response set.
784
+ 8. Set \`preferred\` equal to \`ranking[0]\`.
785
+
786
+ Judgment discipline:
787
+
788
+ - make claims only when you can point to evidence from the prompt or the response artifacts
789
+ - if you cannot verify something, say so explicitly
790
+ - focus on whether the response actually answered the asked prompt, not whether it merely sounds polished
791
+ - distinguish bounded omissions from fundamental prompt misses
792
+ - focus on decision-relevant follow-up work
793
+ - include lightweight \`evidence_refs\` for each response assessment
794
+ - keep \`comparison\` focused on cross-response tradeoffs such as prompt adherence, response quality, and carry-forward usefulness
795
+ - make \`comparison\` explain why \`ranking[0]\` beat \`ranking[1]\`, not just why lower-ranked responses lost
796
+ - include \`next_actions\` only for the selected response path
797
+
798
+ Expected output shape:
799
+
800
+ - \`assessments[]\` with one entry per response candidate
801
+ - top-level \`preferred\` naming the selected candidate
802
+ - each assessment should include:
803
+ - \`candidate\`
804
+ - \`completion_status\`
805
+ - \`recommendation_level\`
806
+ - \`quality\`
807
+ - \`evaluation\`
808
+ - \`requirements_coverage\`
809
+ - \`implementation_notes\`
810
+ - \`follow_up\`
811
+ - \`evidence_refs\`
812
+ - top-level \`comparison\` should capture cross-candidate tradeoffs
813
+ - top-level \`ranking\` must be strict, complete, and tie-free
814
+ - top-level \`rationale\` should explain why \`preferred\` / \`ranking[0]\` is the best carry-forward response
815
+ - top-level \`next_actions\` should stay short and operational
816
+ `,
817
+ rubric: `# Message Review
818
+
819
+ Review the response set by assessing each candidate on:
820
+
821
+ - prompt adherence
822
+ - task fit
823
+ - response quality
824
+ - decision usefulness
825
+ - evidence
826
+
827
+ Then derive a final ranking from those assessments.
828
+
829
+ ## Prompt Adherence
830
+
831
+ Ask:
832
+
833
+ - Does the response answer the actual prompt?
834
+ - Are key prompt requirements clearly met, partially met, not met, or not verifiable?
835
+ - Are there obvious mismatches between what the prompt asked for and what the response delivered?
836
+
837
+ Prompt adherence should dominate polish or stylistic preference.
838
+
839
+ Every candidate assessment should include explicit \`requirements_coverage\` entries so the ranking is traceable back to the original prompt rather than inferred from generic quality labels.
840
+
841
+ ## Task Fit
842
+
843
+ Ask:
844
+
845
+ - Does the response take the right posture for the prompt, not just produce superficially plausible language?
846
+ - Does it stay within the asked scope instead of drifting into adjacent advice, cleanup, or speculation?
847
+ - Does it answer at the right level of abstraction for the task?
848
+
849
+ ## Response Quality
850
+
851
+ Ask:
852
+
853
+ - Is the response coherent, direct, and internally consistent?
854
+ - Does it surface uncertainty honestly instead of bluffing?
855
+ - Does it preserve the important distinctions or caveats the prompt context requires?
856
+
857
+ ## Decision Usefulness
858
+
859
+ Ask:
860
+
861
+ - Would this response be the best durable artifact to keep from the message session?
862
+ - Does it leave later operators or humans with a clear answer, recommendation, or next step?
863
+ - Are any missing follow-ups bounded and low-risk, or do they reopen major prompt questions?
864
+
865
+ ## Evidence
866
+
867
+ Ask:
868
+
869
+ - Are important claims supported by concrete prompt or response evidence?
870
+ - Does the response leave meaningful uncertainty unresolved?
871
+
872
+ Evidence here means direct artifact evidence for the prompt/response pair itself:
873
+
874
+ - the staged prompt artifact
875
+ - the blinded response artifacts
876
+ - cited prompt or response excerpts
877
+
878
+ ## Candidate posture
879
+
880
+ Each candidate assessment should also name:
881
+
882
+ - \`completion_status\`: \`complete\`, \`complete_with_gap\`, \`complete_with_gaps\`, \`incomplete\`, or \`not_verifiable\`
883
+ - \`recommendation_level\`: \`carry_forward_now\`, \`strong_foundation\`, or \`not_recommended\`
884
+ - \`quality\`: \`high\`, \`medium\`, or \`low\`
885
+
886
+ These fields preserve the practical decision posture a message selector needs:
887
+
888
+ - \`carry_forward_now\` means the response is fit to keep as the preferred durable message artifact immediately
889
+ - \`strong_foundation\` means the response is directionally strong but still needs bounded tightening or follow-up
890
+ - \`not_recommended\` means the response should not win the message verification
891
+
892
+ ## Ranking rule
893
+
894
+ The final ranking should follow from the candidate assessments above.
895
+
896
+ It should answer:
897
+
898
+ - which response should win?
899
+ - which ordering best reflects carry-forward usefulness?
900
+
901
+ It should not ignore the structured per-candidate assessments.
902
+ It must rank the full eligible response set with no ties.
903
+ Set \`preferred\` equal to \`ranking[0]\`.
904
+
905
+ The verification artifact should also include:
906
+
907
+ - \`comparison\`: cross-candidate tradeoffs, explicitly including why \`ranking[0]\` beat \`ranking[1]\`
908
+ - \`rationale\`: why \`preferred\` / \`ranking[0]\` is the best choice
909
+ - \`next_actions\`: short, operational follow-up for the selected path
910
+ `,
911
+ schema: `type: object
912
+ required:
913
+ - assessments
914
+ - preferred
915
+ - comparison
916
+ - ranking
917
+ - rationale
918
+ - next_actions
919
+ properties:
920
+ assessments:
921
+ type: array
922
+ items:
923
+ type: object
924
+ required:
925
+ - candidate
926
+ - completion_status
927
+ - recommendation_level
928
+ - quality
929
+ - evaluation
930
+ - requirements_coverage
931
+ - implementation_notes
932
+ - follow_up
933
+ - evidence_refs
934
+ properties:
935
+ candidate:
936
+ type: string
937
+ completion_status:
938
+ type: string
939
+ enum: ["complete", "complete_with_gap", "complete_with_gaps", "incomplete", "not_verifiable"]
940
+ recommendation_level:
941
+ type: string
942
+ enum: ["carry_forward_now", "strong_foundation", "not_recommended"]
943
+ quality:
944
+ type: string
945
+ enum: ["high", "medium", "low"]
946
+ evaluation:
947
+ type: object
948
+ required:
949
+ - prompt_adherence
950
+ - task_fit
951
+ - response_quality
952
+ - decision_usefulness
953
+ - evidence
954
+ properties:
955
+ prompt_adherence:
956
+ type: string
957
+ enum: ["strong", "acceptable", "weak", "not_verifiable"]
958
+ task_fit:
959
+ type: string
960
+ enum: ["strong", "acceptable", "weak", "not_verifiable"]
961
+ response_quality:
962
+ type: string
963
+ enum: ["strong", "acceptable", "weak", "not_verifiable"]
964
+ decision_usefulness:
965
+ type: string
966
+ enum: ["strong", "acceptable", "weak", "not_verifiable"]
967
+ evidence:
968
+ type: string
969
+ enum: ["strong", "acceptable", "weak", "missing"]
970
+ requirements_coverage:
971
+ type: array
972
+ items:
973
+ type: object
974
+ required:
975
+ - requirement
976
+ - status
977
+ - note
978
+ - evidence_refs
979
+ properties:
980
+ requirement:
981
+ type: string
982
+ status:
983
+ type: string
984
+ enum: ["met", "partial", "not_met", "not_verifiable"]
985
+ note:
986
+ type: string
987
+ evidence_refs:
988
+ type: array
989
+ items:
990
+ type: string
991
+ implementation_notes:
992
+ type: string
993
+ follow_up:
994
+ type: array
995
+ items:
996
+ type: string
997
+ evidence_refs:
998
+ type: array
999
+ items:
1000
+ type: string
1001
+ comparison:
1002
+ type: string
1003
+ preferred:
1004
+ type: string
1005
+ ranking:
1006
+ type: array
1007
+ items:
1008
+ type: string
1009
+ rationale:
1010
+ type: string
1011
+ next_actions:
1012
+ type: array
1013
+ items:
1014
+ type: string
760
1015
  `,
761
1016
  },
762
1017
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voratiq",
3
- "version": "0.1.0-beta.20",
3
+ "version": "0.1.0-beta.21",
4
4
  "description": "Agent ensembles to design, generate, and select the best code for every task.",
5
5
  "keywords": [
6
6
  "agent-ensembles",
@@ -57,30 +57,29 @@
57
57
  "check": "npm run lint && npm run typecheck && npm run format:check && npm run build && npm test"
58
58
  },
59
59
  "dependencies": {
60
- "@voratiq/sandbox-runtime": "0.0.29-voratiq1",
60
+ "@voratiq/sandbox-runtime": "0.0.29-voratiq2",
61
61
  "chalk": "^5.3.0",
62
62
  "commander": "^12.1.0",
63
63
  "js-yaml": "^4.1.0",
64
- "zod": "^4.0.0"
64
+ "zod": "^4.3.6"
65
65
  },
66
66
  "devDependencies": {
67
- "@eslint/js": "^9.29.0",
68
- "@jest/globals": "^30.2.0",
67
+ "@eslint/js": "^9.39.4",
68
+ "@jest/globals": "^30.3.0",
69
69
  "@types/jest": "^30.0.0",
70
70
  "@types/js-yaml": "^4.0.9",
71
- "@types/node": "^20.19.17",
72
- "@typescript-eslint/eslint-plugin": "^8.12.1",
73
- "@typescript-eslint/parser": "^8.12.1",
74
- "depcheck": "^1.4.7",
75
- "eslint": "^9.29.0",
76
- "eslint-plugin-jest": "^29.0.1",
71
+ "@types/node": "^20.19.39",
72
+ "@typescript-eslint/eslint-plugin": "^8.58.0",
73
+ "@typescript-eslint/parser": "^8.58.0",
74
+ "eslint": "^9.39.4",
75
+ "eslint-plugin-jest": "^29.15.1",
77
76
  "eslint-plugin-simple-import-sort": "^12.1.1",
78
77
  "globals": "^16.4.0",
79
- "jest": "^30.0.0",
80
- "jest-resolve": "^30.2.0",
81
- "memfs": "^4.48.1",
82
- "prettier": "^3.6.2",
83
- "ts-jest": "^29.4.2",
78
+ "jest": "^30.3.0",
79
+ "jest-resolve": "^30.3.0",
80
+ "memfs": "^4.57.1",
81
+ "prettier": "^3.8.1",
82
+ "ts-jest": "^29.4.9",
84
83
  "typescript": "^5.9.2"
85
84
  },
86
85
  "engines": {