@humain/humain-code 0.3.7 → 0.4.0

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 (91) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/bundle/agent-monitor.js +1 -1
  3. package/dist/bundle/chunks/bedrock-converse-stream.js +18 -17
  4. package/dist/bundle/chunks/{chunk-I2VOYPDI.js → chunk-2KKLZK2N.js} +1 -1
  5. package/dist/bundle/chunks/{chunk-UDTXD6EF.js → chunk-2Q2O3GZ4.js} +721 -717
  6. package/dist/bundle/chunks/{chunk-IYCS4ZUX.js → chunk-3ZI2TEVB.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-ANSL5PYD.js → chunk-DUZY4PDA.js} +18 -18
  8. package/dist/bundle/chunks/{chunk-ZWHFLRTK.js → chunk-E22S6D55.js} +1 -1
  9. package/dist/bundle/chunks/{chunk-6PGWVVGK.js → chunk-E7WGCXWK.js} +1 -1
  10. package/dist/bundle/chunks/{chunk-MNB52OYZ.js → chunk-ERT2BD7V.js} +36 -36
  11. package/dist/bundle/chunks/{chunk-B44UVTZL.js → chunk-H5CZL7M5.js} +1 -1
  12. package/dist/bundle/chunks/{chunk-IPWO7ULX.js → chunk-HA5AW36V.js} +397 -356
  13. package/dist/bundle/chunks/{chunk-7VMWPYCR.js → chunk-IAI7MTU4.js} +3 -3
  14. package/dist/bundle/chunks/{chunk-6FTYU7I7.js → chunk-ICLZNV4V.js} +2 -2
  15. package/dist/bundle/chunks/{chunk-DMAZLWJY.js → chunk-JQZ7BIAI.js} +2 -13
  16. package/dist/bundle/chunks/{chunk-E6ZGTXQP.js → chunk-N23FFKJU.js} +40 -25
  17. package/dist/bundle/chunks/{chunk-RCJ2GKUP.js → chunk-OXJXKCLB.js} +1 -1
  18. package/dist/bundle/chunks/{chunk-7CYWKPFS.js → chunk-UBQSONVR.js} +9 -8
  19. package/dist/bundle/chunks/{chunk-LTQ2YA2G.js → chunk-VZV7GLZT.js} +2 -2
  20. package/dist/bundle/chunks/{chunk-FF26YENK.js → chunk-W2QRCQBX.js} +4 -3
  21. package/dist/bundle/chunks/{cli-JPMYGPAI.js → cli-5YRA5PFB.js} +2 -2
  22. package/dist/bundle/chunks/{compat-VHCHB5WQ.js → compat-TCOK5LFD.js} +1 -1
  23. package/dist/bundle/chunks/dist-33CBPO23.js +1928 -0
  24. package/dist/bundle/chunks/{easter-egg-3d-XXETTDXE.js → easter-egg-3d-ARXMB2RN.js} +1 -1
  25. package/dist/bundle/chunks/{esm-763X2IA7.js → esm-NCUV2DF7.js} +1 -1
  26. package/dist/bundle/chunks/{event-streams-4Q22QRY2.js → event-streams-CGCQQL5M.js} +1 -1
  27. package/dist/bundle/chunks/{execute-G3YZLU7S.js → execute-KEUC5IWA.js} +1 -1
  28. package/dist/bundle/chunks/{extract-SJF4DY5M.js → extract-WUAT5T4V.js} +4 -4
  29. package/dist/bundle/chunks/{google-generative-ai-ICWD4YIE.js → google-generative-ai-MDUVUFFQ.js} +1 -1
  30. package/dist/bundle/chunks/{google-vertex-XIACVW6H.js → google-vertex-UQGG6LEW.js} +1 -1
  31. package/dist/bundle/chunks/{host-M54XD7HV.js → host-SPBJ4YAA.js} +1 -1
  32. package/dist/bundle/chunks/{node-W47VUEGE.js → node-XGNY74WT.js} +1 -1
  33. package/dist/bundle/chunks/{runtime-POHTHFKR.js → runtime-HBWXEJT3.js} +1 -1
  34. package/dist/bundle/chunks/{virtual-modules-ORGE66B4.js → virtual-modules-I5YD7JGC.js} +2 -2
  35. package/dist/bundle/cli-runtime.js +2 -2
  36. package/dist/bundle/flow/agents/.gitkeep +0 -0
  37. package/dist/bundle/flow/agents/orch-architect.md +33 -0
  38. package/dist/bundle/flow/agents/orch-implementation-fast.md +13 -0
  39. package/dist/bundle/flow/agents/orch-implementation-strong.md +28 -0
  40. package/dist/bundle/flow/agents/orch-qa-agent.md +29 -0
  41. package/dist/bundle/flow/agents/orch-scout.md +35 -0
  42. package/dist/bundle/flow/agents/orch-security-review.md +28 -0
  43. package/dist/bundle/flow/agents/orch-technical-lead.md +37 -0
  44. package/dist/bundle/flow/agents/orch-technical-review.md +28 -0
  45. package/dist/bundle/flow/agents/orch-worker.md +13 -0
  46. package/dist/bundle/flow/agents/orchestrator-lead.md +55 -0
  47. package/dist/bundle/flow/assets/.gitkeep +0 -0
  48. package/dist/bundle/flow/assets/contract.json +84 -0
  49. package/dist/bundle/flow/assets/forge-protocol-schema.sha256 +1 -0
  50. package/dist/bundle/flow/assets/method.json +193 -0
  51. package/dist/bundle/flow/assets/orchestrator-profiles.json +131 -0
  52. package/dist/bundle/flow/assets/profiles/anthropic.json +189 -0
  53. package/dist/bundle/flow/assets/profiles/openai.json +177 -0
  54. package/dist/bundle/flow/assets/profiles/oss-first.json +236 -0
  55. package/dist/bundle/flow/assets/profiles/premium.json +203 -0
  56. package/dist/bundle/flow/package.json +48 -0
  57. package/dist/bundle/index.js +5 -5
  58. package/dist/bundle/rpc-entry.js +2 -2
  59. package/dist/config.d.ts +17 -5
  60. package/dist/config.d.ts.map +1 -1
  61. package/dist/config.js +25 -2
  62. package/dist/config.js.map +1 -1
  63. package/dist/core/tools/subagent.d.ts +20 -0
  64. package/dist/core/tools/subagent.d.ts.map +1 -1
  65. package/dist/core/tools/subagent.js +124 -12
  66. package/dist/core/tools/subagent.js.map +1 -1
  67. package/dist/humain/flow-loader.d.ts +62 -0
  68. package/dist/humain/flow-loader.d.ts.map +1 -0
  69. package/dist/humain/flow-loader.js +291 -0
  70. package/dist/humain/flow-loader.js.map +1 -0
  71. package/dist/humain/index.d.ts.map +1 -1
  72. package/dist/humain/index.js +2 -0
  73. package/dist/humain/index.js.map +1 -1
  74. package/dist/humain/trace-capture/child-launch.d.ts +1 -0
  75. package/dist/humain/trace-capture/child-launch.d.ts.map +1 -1
  76. package/dist/humain/trace-capture/child-launch.js +2 -1
  77. package/dist/humain/trace-capture/child-launch.js.map +1 -1
  78. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  79. package/dist/modes/rpc/rpc-mode.js +136 -1
  80. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  81. package/dist/utils/version-check.d.ts.map +1 -1
  82. package/dist/utils/version-check.js +3 -1
  83. package/dist/utils/version-check.js.map +1 -1
  84. package/docs/docs.json +8 -0
  85. package/docs/environment-variables.md +1 -0
  86. package/docs/flow-profiles.md +173 -0
  87. package/docs/flow.md +112 -0
  88. package/docs/humain-code.md +1 -1
  89. package/docs/index.md +2 -0
  90. package/npm-shrinkwrap.json +6 -6
  91. package/package.json +6 -5
@@ -0,0 +1,84 @@
1
+ {
2
+ "schema_version": 1,
3
+ "description": "Values shared verbatim between the Python engine (orchestrator/contract.py) and the HT bridge (bridge/extensions/orchestrator/*.ts, via the symlinked copy of this file). This is the on-disk layout and CLI wire contract: stream file names, protected file names, the durable-write CLI's exit codes and body statuses, batch/id limits, the path-redaction regexes and the state-root environment variables/default. It does NOT hold orchestration method vocabulary (capabilities, tiers, effort, roles) — that lives in method.json. Editing this file edits the on-disk contract for both runtimes at once; keep both sides' behaviour identical except where a field is explicitly documented as intentionally different (see redaction_regex).",
4
+
5
+ "telemetry_events": {
6
+ "dispatch_finished": {
7
+ "fields": ["outcome", "timeout_reason", "failure_class", "provider", "provider_model", "error_code"],
8
+ "outcome_values": ["completed", "completed_after_process_error", "failed", "timed_out", "cancelled"],
9
+ "failure_class_values": ["provider_stall", "wait_stall", "transient", "quota", "task", "cancelled"],
10
+ "_note": "Existing model remains the full dispatch model id; provider_model is its short normalized component. Optional failure_class only applies to non-successful dispositions."
11
+ },
12
+ "provider_error": {
13
+ "fields": ["run_id", "task_id", "dispatch_attempt", "provider", "model", "error_code", "endpoint_host", "nested", "count", "first_ts", "last_ts", "timestamp_precision"],
14
+ "error_code_values": ["ENOTFOUND", "ECONNRESET", "ETIMEDOUT", "fetch_failed", "stream_canceled", "stream_no_stop_reason", "http_5xx", "quota"],
15
+ "_note": "Only normalized evidence; endpoint_host is an optional hostname without scheme, path, or credentials. No raw stderr or error message. timestamp_precision=unknown marks legacy lines without an evidence timestamp (accepted for rows already written; the backfill no longer emits it and reads exact timestamps from runs/*/*.events.jsonl); ingestion ts is not evidence of outage timing. Repeated evidence is aggregated within a dispatch attempt and origin (nested=true for worker errors, false for the dispatch's own stderr)."
16
+ }
17
+ },
18
+
19
+ "streams": {
20
+ "event": "events.jsonl",
21
+ "metric": "metrics.jsonl",
22
+ "outcome": "outcomes.jsonl"
23
+ },
24
+
25
+ "ingest_status_file": "ingest_status.json",
26
+
27
+ "max_leads": 4,
28
+ "max_leads_note": "B4.7: the single source for the orchestration lead-count ceiling, consumed by orchestrator/scheduler.py's topology_for (which never requests more leads than this for any complexity/parallelizable input) and by the TS bridge's config.ts (the default for maxLeads, overridable per-run via HUMAIN_ORCHESTRATOR_MAX_LEADS). 4 was chosen to preserve the pre-B4.7 effective behaviour: the Python plan topology already capped itself at 4 leads, so the TS side's old default of 8 was never the binding constraint (config.ts's maxLeads is `min`'d against the plan's own leads, and the plan never exceeded 4) — no behaviour change for a normal /orchestrate run.",
29
+
30
+ "ingest_status": {
31
+ "fields": ["version", "last_attempt_at", "last_success_at", "status", "files_scanned", "emitted", "failure_count", "error", "sweep_interval_seconds"],
32
+ "status_values": { "ok": "ok", "partial": "partial", "error": "error" },
33
+ "default_sweep_interval_seconds": 900,
34
+ "_note": "B4.7: single source for the ingest_status.json shape, built independently by two different writers on different failure paths — Python's orchestrator/ingest/service.py:make_ingest_status (a completed ingest sweep, which may be ok/partial/error) and the TS bridge's hook-level failure writer (a failure before/around a Python spawn, always 'error'). Both read field names and status-string literals from here instead of re-typing them, so the written JSON's keys and status vocabulary can never drift even though the two writers cover different scenarios and are not expected to share write logic."
35
+ },
36
+
37
+ "never_archive_files": [
38
+ "events.jsonl",
39
+ "metrics.jsonl",
40
+ "outcomes.jsonl",
41
+ "discoveries.jsonl",
42
+ "ledger.json",
43
+ "ledger.lock",
44
+ "records.checkpoint.json",
45
+ "records.index.sqlite3",
46
+ "ingest_status.json",
47
+ "archive.manifest.json",
48
+ "archive.lock"
49
+ ],
50
+
51
+ "batch": {
52
+ "max_records": 500,
53
+ "max_record_id_length": 200,
54
+ "exit_codes": {
55
+ "ok": 0,
56
+ "invalid": 1,
57
+ "append_failed": 2,
58
+ "refresh_failed": 3
59
+ },
60
+ "statuses": {
61
+ "ok": "ok",
62
+ "invalid": "invalid",
63
+ "append_failed": "append_failed",
64
+ "refresh_failed": "refresh_failed",
65
+ "checkpoint_failed": "checkpoint_failed"
66
+ },
67
+ "retry_same_ids": "same_ids"
68
+ },
69
+
70
+ "redaction_regex": {
71
+ "python": "(/Users/[^ \\t\\n|]+|/home/[^ \\t\\n|]+|~/[^ \\t\\n|]+)",
72
+ "ts": "(/Users/[^\\s|]+|/home/[^\\s|]+|~/[^\\s|]+)",
73
+ "_todo": "these already differ in behaviour (python's character class excludes only space/tab/newline/pipe; ts's excludes any whitespace plus pipe) and are stored separately on purpose. DO NOT harmonize them here — that is a deliberate follow-up decision, not part of this refactor. Each side must keep importing exactly its own key."
74
+ },
75
+
76
+ "state_root": {
77
+ "env_vars": {
78
+ "canonical": "CODING_AGENT_ORCHESTRATOR_HOME",
79
+ "aliases": ["HUMAIN_ORCHESTRATOR_STATE_ROOT"],
80
+ "_note": "2.3: both runtimes resolve the canonical name first, then each alias in order, then default. HUMAIN_ORCHESTRATOR_STATE_ROOT is a deprecated fallback alias, kept for existing callers; do not add new readers of it."
81
+ },
82
+ "default": "~/.humain-terminal/flow"
83
+ }
84
+ }
@@ -0,0 +1 @@
1
+ 5b129e2af829ac4ab10bc2eec89b4dda1094978e49e4269cfb8b1d66fd02ee08 protocol-schema.ts
@@ -0,0 +1,193 @@
1
+ {
2
+ "schema_version": 1,
3
+ "description": "Canonical orchestration method: capability vocabulary, cost tiers, effort levels, role aliases, capability-to-persona overrides, HT-thinking-level-to-effort aliases, and the three routing rules. Read by both the Python engine (orchestrator/method.py) and the HT bridge (bridge/extensions/orchestrator/models.ts and index.ts via a symlink). Editing this file edits the method; SKILL.md summarises it for humans and must not contradict it. Runtime config (pricing, features, persistence) stays in config.json; per-dispatch spend caps are method policy (rules.dispatch_spend_cap); runtime state (history, measured ROI) stays in ~/.local/state/coding-agent-orchestrator/.",
4
+
5
+ "tiers": ["cheap", "mid", "premium", "frontier"],
6
+
7
+ "capabilities": {
8
+ "scout": { "tier": "cheap", "default_effort": "low" },
9
+ "scope_scout": { "tier": "mid", "default_effort": "low" },
10
+ "worker": { "tier": "cheap", "default_effort": "low" },
11
+ "implementation_fast": { "tier": "cheap", "default_effort": "low" },
12
+ "analysis_mid": { "tier": "mid", "default_effort": "standard" },
13
+ "technical_lead": { "tier": "mid", "default_effort": "standard" },
14
+ "lead_small": { "tier": "mid", "default_effort": "standard" },
15
+ "lead": { "tier": "premium", "default_effort": "standard" },
16
+ "lead_large": { "tier": "frontier", "default_effort": "standard" },
17
+ "implementation_strong": { "tier": "mid", "default_effort": "standard" },
18
+ "technical_review": { "tier": "mid", "default_effort": "standard" },
19
+ "integration_review": { "tier": "mid", "default_effort": "high" },
20
+ "migration_review": { "tier": "mid", "default_effort": "high" },
21
+ "performance_review": { "tier": "mid", "default_effort": "standard" },
22
+ "api_contract_review": { "tier": "mid", "default_effort": "standard" },
23
+ "qa_agent": { "tier": "mid", "default_effort": "standard" },
24
+ "analysis_strong": { "tier": "premium", "default_effort": "standard" },
25
+ "architect": { "tier": "premium", "default_effort": "standard" },
26
+ "security_review": { "tier": "premium", "default_effort": "high" }
27
+ },
28
+
29
+ "effort_levels": ["minimal", "low", "standard", "high", "maximum"],
30
+
31
+ "capability_personas": {
32
+ "scope_scout": "orch-scout",
33
+ "analysis_mid": "orch-technical-lead",
34
+ "analysis_strong": "orch-architect",
35
+ "integration_review": "orch-technical-review",
36
+ "migration_review": "orch-technical-review",
37
+ "performance_review": "orch-technical-review",
38
+ "api_contract_review": "orch-technical-review"
39
+ },
40
+
41
+ "effort_aliases": {
42
+ "off": "minimal",
43
+ "minimal": "minimal",
44
+ "low": "low",
45
+ "medium": "standard",
46
+ "high": "high",
47
+ "xhigh": "maximum",
48
+ "max": "maximum"
49
+ },
50
+
51
+ "roles": {
52
+ "architect": "architect",
53
+ "technical_lead": "technical_lead",
54
+ "implementer": "implementation_fast",
55
+ "complex_implementer": "implementation_strong",
56
+ "verifier": "technical_review",
57
+ "integration_verifier": "integration_review",
58
+ "security_verifier": "security_review",
59
+ "performance_verifier": "performance_review",
60
+ "migration_verifier": "migration_review",
61
+ "api_contract_verifier": "api_contract_review"
62
+ },
63
+
64
+ "rules": {
65
+ "review_after_fix": {
66
+ "summary": "Re-review after a fix uses at least the original reviewer's tier; never the cheap tier.",
67
+ "min_capability": "implementation_strong",
68
+ "min_effort": "standard",
69
+ "min_verification_depth": "targeted",
70
+ "prohibit_tiers": ["cheap"],
71
+ "escalation_by_risk": {
72
+ "low": { "capability": "implementation_strong", "tier_min": "mid", "verification_depth": "targeted" },
73
+ "medium": { "capability": "technical_review", "tier_min": "mid", "verification_depth": "targeted" },
74
+ "high": { "capability": "security_review", "tier_min": "premium", "verification_depth": "full" },
75
+ "critical": { "capability": "security_review", "tier_min": "frontier","verification_depth": "full", "independent_review": true }
76
+ },
77
+ "rationale": "After a fix, the code under review has changed. The cheap tier confirmed 4/4 re-reviews in early data, but downstream tasks proceeded without issue only because the fixes were small. A single regression missed by a cheap re-reviewer costs more in rework and escaped defects than the entire cheap re-review savings to date ($0.31)."
78
+ },
79
+
80
+ "pre_implementation_recon": {
81
+ "summary": "Tasks at complexity >= 5 get a parallel fan-out of cheap, read-only recon workers before any implementer touches code. The orchestrator extension owns this fan-out directly (it is a billed, observable dispatch); leads must not re-run their own recon.",
82
+ "min_complexity": 5,
83
+ "workers_by_complexity": [
84
+ { "min": 5, "max": 6, "workers": 3 },
85
+ { "min": 7, "max": 8, "workers": 4 },
86
+ { "min": 9, "max": 10, "workers": 5 }
87
+ ],
88
+ "worker_capability": "scout",
89
+ "worker_effort": "low",
90
+ "worker_verification_depth": "targeted",
91
+ "lead_synthesis_capability": "technical_lead",
92
+ "evidence_packet_max_tokens": 2000,
93
+ "evidence_packet_max_tokens_scope": "aggregate",
94
+ "skip_for_task_classes": ["investigation", "qa_verification"],
95
+ "rationale": "implementation_strong-class tasks with 150K-400K input tokens cost $0.55-$2.38 because the implementer reads raw repository context. Cheap scouts pre-digesting that context into one bounded evidence packet save $1+ on the most expensive implementer calls and improve focus.",
96
+ "evidence_packet_rationale": "evidence_packet_max_tokens is the AGGREGATE budget for the single combined packet handed to each lead, not a per-scout allowance: the cost being bounded is the lead's input prompt, which carries every scout's output at once. Each of the N workers therefore gets an equal share (budget / N), and the combined packet is capped at the total again after assembly. Failed workers are allocated their header plus a fair share of diagnostic space before any successful output, so a failure can never be hidden by a verbose success."
97
+ },
98
+
99
+ "exploration_topology": {
100
+ "summary": "Investigation, recon and digest work uses the cheapest sufficient capability: one capable lead plus 3-5 parallel cheap workers.",
101
+ "default_shape": "lead_plus_parallel_recon",
102
+ "recon_workers": 4,
103
+ "recon_workers_min": 3,
104
+ "recon_workers_max": 5,
105
+ "recon_capability": "analysis_mid",
106
+ "recon_effort": "standard",
107
+ "recon_verification_depth": "targeted",
108
+ "synthesis_capability": "technical_lead",
109
+ "synthesis_effort": "standard",
110
+ "max_recon_cost_usd": 0.5,
111
+ "by_task_class": {
112
+ "issue_triage": { "worker": "analysis_mid", "lead": "technical_lead" },
113
+ "plan_audit": { "worker": "analysis_mid", "lead": "technical_lead" },
114
+ "codebase_recon": { "worker": "implementation_fast", "lead": "technical_lead" },
115
+ "security_audit": { "worker": "security_review", "lead": null },
116
+ "spec_synthesis": { "worker": "analysis_strong", "lead": "architect" }
117
+ },
118
+ "rationale": "The ht-codex-modularization-status run proved this topology: 4 parallel mid-tier scouts produced complete evidence packets at near-zero cost, and a single premium synthesis produced the status report. Sending the premium model to do the investigation itself would have cost 5-10x more."
119
+ },
120
+
121
+ "lead_sizing": {
122
+ "summary": "Triage picks a lead size; profiles bind sizes to models through tiers.",
123
+ "sizes": { "small": "lead_small", "standard": "lead", "large": "lead_large" },
124
+ "by_complexity": [
125
+ { "min": 1, "max": 3, "size": "small" },
126
+ { "min": 4, "max": 6, "size": "standard" },
127
+ { "min": 7, "max": 10, "size": "large" }
128
+ ],
129
+ "risk_floor": { "low": "small", "medium": "standard", "high": "large", "critical": "large" },
130
+ "escalate_on_verification_failure": true,
131
+ "rationale": "2026-09-24: fable-5-1 leads cost $90.71 over 17 runs (11 verified pass); sonnet-5 leads cost $1.04 over 21 runs (19 verified pass). Size the lead to the task and escalate on failure instead of pinning the frontier model."
132
+ },
133
+
134
+ "dispatch_spend_cap": {
135
+ "summary": "Per-dispatch USD ceiling on live reported cost. warn notifies once; enforce also cancels the dispatch; off disables.",
136
+ "mode": "warn",
137
+ "usd_by_capability": { "lead_small": 1.5, "lead": 4.0, "lead_large": 10.0, "architect": 2.0 },
138
+ "default_usd": 1.0
139
+ },
140
+ "progress_repair": { "non_progress_rounds": 2, "post_escalation_rounds": 2 },
141
+ "workflow_policy": {
142
+ "summary": "Observable repository evidence picks the lightest workflow level; hard floors cannot be lowered; failures escalate upward with work carried forward.",
143
+ "mode": "observe",
144
+ "levels": ["direct", "checked", "led", "full"],
145
+ "thresholds": { "led_min_files": 4, "led_min_packages": 3 },
146
+ "fix_rounds_per_level": 1,
147
+ "signal_timeout_ms": 5000,
148
+ "check_timeout_ms": 1200000,
149
+ "scope_scout": { "enabled": true, "max_candidates": 25, "timeout_ms": 120000 },
150
+ "excluded_task_classes": ["investigation", "qa_verification"],
151
+ "risk_path_globs": ["**/auth/**", "**/*auth*.*", "**/*secret*", "**/*credential*", "**/payments/**", "**/billing/**",
152
+ ".github/workflows/**", ".gitlab-ci.yml", "**/package.json", "**/bun.lock", "**/bun.lockb", "**/package-lock.json",
153
+ "**/pnpm-lock.yaml", "**/yarn.lock", "**/pyproject.toml", "**/requirements*.txt", "**/migrations/**", "**/*migration*.*"],
154
+ "interface_globs": ["**/*.d.ts", "**/schema*.json", "**/openapi*.json", "**/openapi*.yaml", "**/contract.json", "**/method.json", "**/index.ts", "**/__init__.py"],
155
+ "rationale": "Spec 2026-09-29 §3: coordination overhead should scale with evidence of scope and risk, not with an LLM complexity score."
156
+ },
157
+ "model_requirements": {
158
+ "default": { "min_context": 128000, "min_output": 16000, "effort_control": false },
159
+ "groups": {
160
+ "planning": { "capabilities": ["architect", "lead_small", "lead", "lead_large"], "min_context": 256000, "min_output": 64000 },
161
+ "review": { "capabilities": ["technical_review", "integration_review", "migration_review", "performance_review", "api_contract_review", "security_review", "qa_agent"], "min_context": 200000, "min_output": 32000 },
162
+ "worker": { "capabilities": ["scout", "scope_scout", "worker", "implementation_fast", "implementation_strong", "analysis_mid", "analysis_strong", "technical_lead"], "min_context": 128000, "min_output": 32000 }
163
+ }
164
+ },
165
+ "model_failover": {
166
+ "unhealthy_ms": 600000,
167
+ "same_model_retry_delay_ms": 60000,
168
+ "wait_schedule_ms": [60000, 120000, 240000],
169
+ "max_wait_ms": 900000,
170
+ "max_switches": 4,
171
+ "real_work_min_tool_calls": 3
172
+ },
173
+ "efficiency_controls": {
174
+ "summary": "Phase-2 opt-in efficiency switches. Every switch defaults OFF; each is independent. Off = byte-identical baseline behaviour.",
175
+ "config_version": "2026-09-25.1",
176
+ "delegation_guidance": { "enabled": false, "own_tool_budget": { "architect": 12, "lead": 25 }, "targeted_reads_allowed": 8 },
177
+ "event_waiting_guidance": { "enabled": false },
178
+ "file_ownership": { "mode": "off" }
179
+ },
180
+ "model_canaries": {
181
+ "summary": "Comparison candidates only; never primary replacements or automatic promotions. 0% exposure until explicitly enabled AND qualification is available.",
182
+ "config_version": "2026-09-25.1",
183
+ "enabled": false,
184
+ "activation_available": false,
185
+ "activation_unavailable_reason": "catalog model qualification (tool/context/reasoning requirement checks) is not on main; it exists only on the unmerged feat/model-failover branch",
186
+ "exclude_capabilities": ["security_review"],
187
+ "candidates": [
188
+ { "id": "premium-gpt-5.6-sol", "tier": "premium", "model": "gpt-5.6-sol", "percentage": 0 },
189
+ { "id": "impl-gpt-6-sol", "capabilities": ["implementation_fast", "implementation_strong"], "model": "gpt-6-sol", "percentage": 0 }
190
+ ]
191
+ }
192
+ }
193
+ }
@@ -0,0 +1,131 @@
1
+ {
2
+ "version": 1,
3
+ "active_profile": "premium",
4
+ "provider_preference": ["openai-codex", "anthropic", "amazon-bedrock"],
5
+ "profiles": {
6
+ "premium": {
7
+ "description": "Mixed vendor (default): gpt-6-luna scouts/workers, gpt-6.1-sol standard lead and reviews, Anthropic opus-5-5 large lead and architect, astra security review, Anthropic sonnet-5-5 QA, Anthropic fable-5-1 frontier.",
8
+ "tiers": {
9
+ "cheap": "gpt-6-luna",
10
+ "mid": "gpt-6.1-sol",
11
+ "premium": "opus-5-5",
12
+ "frontier": "fable-5-1"
13
+ },
14
+ "capabilities": {
15
+ "lead": "gpt-6.1-sol",
16
+ "lead_large": "opus-5-5",
17
+ "architect": "opus-5-5",
18
+ "technical_review": "gpt-6.1-sol",
19
+ "integration_review": "gpt-6.1-sol",
20
+ "migration_review": "gpt-6.1-sol",
21
+ "performance_review": "gpt-6.1-sol",
22
+ "api_contract_review": "gpt-6.1-sol",
23
+ "security_review": "astra",
24
+ "qa_agent": "sonnet-5-5"
25
+ },
26
+ "backups": {
27
+ "lead": ["fable-5-1", "opus-5-5"],
28
+ "technical_review": ["sonnet-5", "opus-5-5"],
29
+ "security_review": ["fable-5-1"],
30
+ "qa_agent": ["gpt-6.1-sol"],
31
+ "cheap": ["humain-node/qwen3.8-27b", "gpt-6.1-sol"],
32
+ "mid": ["opus-5-5"],
33
+ "premium": ["fable-5-1", "gpt-6.1-sol"],
34
+ "frontier": ["fable-5-1"]
35
+ }
36
+ },
37
+ "anthropic": {
38
+ "description": "Anthropic only. The cheap tier is sonnet-5 at low effort.",
39
+ "tiers": {
40
+ "cheap": "sonnet-5",
41
+ "mid": "sonnet-5",
42
+ "premium": "opus-5-5",
43
+ "frontier": "fable-5-1"
44
+ },
45
+ "effort": {
46
+ "scout": "low",
47
+ "worker": "low",
48
+ "implementation_fast": "low"
49
+ },
50
+ "backups": {
51
+ "cheap": ["opus-5-5", "fable-5-1"],
52
+ "mid": ["opus-5-5", "fable-5-1"],
53
+ "premium": ["fable-5-1"]
54
+ }
55
+ },
56
+ "openai": {
57
+ "description": "OpenAI only: gpt-6-luna cheap, gpt-6.1-sol mid and premium (premium capabilities at high effort), astra frontier. Codex first, Bedrock fallback.",
58
+ "tiers": {
59
+ "cheap": "gpt-6-luna",
60
+ "mid": "gpt-6.1-sol",
61
+ "premium": "gpt-6.1-sol",
62
+ "frontier": "astra"
63
+ },
64
+ "effort": {
65
+ "lead": "high",
66
+ "architect": "high",
67
+ "analysis_strong": "high",
68
+ "security_review": "high"
69
+ },
70
+ "backups": {
71
+ "cheap": ["gpt-6.1-sol", "astra"],
72
+ "mid": ["astra"],
73
+ "premium": ["astra"]
74
+ }
75
+ },
76
+ "oss": {
77
+ "description": "GLM 5.2 primaries; Kimi K3 backups, with GLM 5.3 Flash, Qwen 3.8 Flash Next and proprietary Grok 4.7 alternatives subject to verified runtime limits.",
78
+ "tiers": {
79
+ "cheap": "humain-node/glm-5.2",
80
+ "mid": "humain-node/glm-5.2",
81
+ "premium": "humain-node/glm-5.2",
82
+ "frontier": "humain-node/glm-5.2"
83
+ },
84
+ "capabilities": {
85
+ "lead": "humain-node/glm-5.2",
86
+ "technical_review": "humain-node/glm-5.2",
87
+ "qa_agent": "humain-node/glm-5.2"
88
+ },
89
+ "backups": {
90
+ "cheap": ["humain-node/kimi-k3", "humain-node/glm-5.3-flash", "humain-node/qwen3.8-flash-next", "humain-node/grok-4.7"],
91
+ "mid": ["humain-node/kimi-k3", "humain-node/glm-5.3-flash", "humain-node/grok-4.7"],
92
+ "premium": ["humain-node/kimi-k3", "humain-node/grok-4.7"]
93
+ }
94
+ },
95
+ "oss-first": {
96
+ "description": "GLM 5.2 first, Kimi K3 and qualified Flash/Grok alternatives below frontier; retains guarded escalation and independent review. Grok is proprietary.",
97
+ "tiers": {
98
+ "cheap": "humain-node/glm-5.2",
99
+ "mid": "humain-node/glm-5.2",
100
+ "premium": "humain-node/glm-5.2",
101
+ "frontier": "humain-node/glm-5.2"
102
+ },
103
+ "capabilities": {
104
+ "lead_small": "humain-node/glm-5.2",
105
+ "lead": "humain-node/glm-5.2",
106
+ "lead_large": "humain-node/glm-5.2",
107
+ "technical_review": "humain-node/glm-5.2",
108
+ "integration_review": "humain-node/glm-5.2",
109
+ "migration_review": "humain-node/glm-5.2",
110
+ "performance_review": "humain-node/glm-5.2",
111
+ "api_contract_review": "humain-node/glm-5.2",
112
+ "security_review": "humain-node/glm-5.2",
113
+ "qa_agent": "humain-node/glm-5.2",
114
+ "analysis_strong": "humain-node/glm-5.2",
115
+ "architect": "humain-node/glm-5.2"
116
+ },
117
+ "backups": {
118
+ "cheap": ["humain-node/kimi-k3", "humain-node/glm-5.3-flash", "humain-node/qwen3.8-flash-next", "humain-node/grok-4.7"],
119
+ "mid": ["humain-node/kimi-k3", "humain-node/glm-5.3-flash", "humain-node/grok-4.7"],
120
+ "premium": ["humain-node/kimi-k3", "humain-node/grok-4.7"]
121
+ },
122
+ "policy": {
123
+ "escalation_target": "gpt-6.1-sol",
124
+ "repair_attempts": 1,
125
+ "strict_qualification": true,
126
+ "mandatory_review": { "risks": ["high", "critical"], "reviewer": "openai-codex/gpt-6-astra" },
127
+ "paid_fallback": { "require_compatible": true }
128
+ }
129
+ }
130
+ }
131
+ }
@@ -0,0 +1,189 @@
1
+ {
2
+ "schema": "humain-flow-profile",
3
+ "schemaVersion": 1,
4
+ "id": "anthropic",
5
+ "version": 1,
6
+ "digest": "213dda748aa7288d2ba939288b49936024525fcec1341457a598e6f8be9e8e53",
7
+ "kind": "flow",
8
+ "label": "Anthropic",
9
+ "description": "Anthropic only. The cheap tier is sonnet-5 at low effort.",
10
+ "roles": {
11
+ "scout": {
12
+ "primary": {
13
+ "provider": "anthropic",
14
+ "model": "claude-sonnet-5"
15
+ },
16
+ "backups": [
17
+ {
18
+ "provider": "anthropic",
19
+ "model": "claude-opus-5-5"
20
+ },
21
+ {
22
+ "provider": "anthropic",
23
+ "model": "claude-fable-5-1"
24
+ }
25
+ ],
26
+ "effort": "low"
27
+ },
28
+ "worker": {
29
+ "primary": {
30
+ "provider": "anthropic",
31
+ "model": "claude-sonnet-5"
32
+ },
33
+ "backups": [
34
+ {
35
+ "provider": "anthropic",
36
+ "model": "claude-opus-5-5"
37
+ },
38
+ {
39
+ "provider": "anthropic",
40
+ "model": "claude-fable-5-1"
41
+ }
42
+ ],
43
+ "effort": "low"
44
+ },
45
+ "triage": {
46
+ "primary": {
47
+ "provider": "anthropic",
48
+ "model": "claude-sonnet-5"
49
+ },
50
+ "backups": [
51
+ {
52
+ "provider": "anthropic",
53
+ "model": "claude-opus-5-5"
54
+ },
55
+ {
56
+ "provider": "anthropic",
57
+ "model": "claude-fable-5-1"
58
+ }
59
+ ],
60
+ "effort": "medium"
61
+ },
62
+ "implementer": {
63
+ "primary": {
64
+ "provider": "anthropic",
65
+ "model": "claude-sonnet-5"
66
+ },
67
+ "backups": [
68
+ {
69
+ "provider": "anthropic",
70
+ "model": "claude-opus-5-5"
71
+ },
72
+ {
73
+ "provider": "anthropic",
74
+ "model": "claude-fable-5-1"
75
+ }
76
+ ],
77
+ "effort": "medium"
78
+ },
79
+ "lead": {
80
+ "primary": {
81
+ "provider": "anthropic",
82
+ "model": "claude-opus-5-5"
83
+ },
84
+ "backups": [
85
+ {
86
+ "provider": "anthropic",
87
+ "model": "claude-fable-5-1"
88
+ }
89
+ ],
90
+ "effort": "medium"
91
+ },
92
+ "lead_large": {
93
+ "primary": {
94
+ "provider": "anthropic",
95
+ "model": "claude-fable-5-1"
96
+ },
97
+ "backups": [],
98
+ "effort": "medium"
99
+ },
100
+ "architect": {
101
+ "primary": {
102
+ "provider": "anthropic",
103
+ "model": "claude-opus-5-5"
104
+ },
105
+ "backups": [
106
+ {
107
+ "provider": "anthropic",
108
+ "model": "claude-fable-5-1"
109
+ }
110
+ ],
111
+ "effort": "medium"
112
+ },
113
+ "reviewer": {
114
+ "primary": {
115
+ "provider": "anthropic",
116
+ "model": "claude-sonnet-5"
117
+ },
118
+ "backups": [
119
+ {
120
+ "provider": "anthropic",
121
+ "model": "claude-opus-5-5"
122
+ },
123
+ {
124
+ "provider": "anthropic",
125
+ "model": "claude-fable-5-1"
126
+ }
127
+ ],
128
+ "effort": "medium"
129
+ },
130
+ "security_reviewer": {
131
+ "primary": {
132
+ "provider": "anthropic",
133
+ "model": "claude-opus-5-5"
134
+ },
135
+ "backups": [
136
+ {
137
+ "provider": "anthropic",
138
+ "model": "claude-fable-5-1"
139
+ }
140
+ ],
141
+ "effort": "medium"
142
+ },
143
+ "qa": {
144
+ "primary": {
145
+ "provider": "anthropic",
146
+ "model": "claude-sonnet-5"
147
+ },
148
+ "backups": [
149
+ {
150
+ "provider": "anthropic",
151
+ "model": "claude-opus-5-5"
152
+ },
153
+ {
154
+ "provider": "anthropic",
155
+ "model": "claude-fable-5-1"
156
+ }
157
+ ],
158
+ "effort": "medium"
159
+ }
160
+ },
161
+ "sizing": {
162
+ "classifierPolicyId": "unified-regex-v4",
163
+ "thresholds": {
164
+ "mediumAt": 3,
165
+ "largeAt": 8
166
+ },
167
+ "triageRole": "triage",
168
+ "maxEscalations": 1
169
+ },
170
+ "limits": {
171
+ "maxAgents": 12,
172
+ "maxConcurrent": 4,
173
+ "maxDepth": 3,
174
+ "maxRetries": 2,
175
+ "inactivityMs": 600000,
176
+ "ciWaitMs": 1800000
177
+ },
178
+ "spend": {
179
+ "runCapMicrousd": 50000000,
180
+ "warnAtPct": 80
181
+ },
182
+ "providers": {
183
+ "preference": [
184
+ "anthropic",
185
+ "amazon-bedrock"
186
+ ]
187
+ },
188
+ "builtIn": true
189
+ }