create-byan-agent 2.27.0 → 2.28.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 (53) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/install/package.json +1 -1
  3. package/install/templates/.claude/rules/native-workflows.md +25 -0
  4. package/install/templates/.claude/skills/byan-byan/SKILL.md +1 -0
  5. package/install/templates/_byan/mcp/byan-mcp-server/bin/byan-lint-workflows.js +30 -4
  6. package/install/templates/_byan/mcp/byan-mcp-server/lib/workflows-lint.js +66 -0
  7. package/install/templates/_byan/mcp/byan-mcp-server/skill-bundles-manifest.json +1 -1
  8. package/install/templates/dist/skill-bundles/byan-benchmark.zip +0 -0
  9. package/install/templates/dist/skill-bundles/byan-bmad-agent-tao.zip +0 -0
  10. package/install/templates/dist/skill-bundles/byan-bmad-master.zip +0 -0
  11. package/install/templates/dist/skill-bundles/byan-bmb-agent-builder.zip +0 -0
  12. package/install/templates/dist/skill-bundles/byan-bmb-module-builder.zip +0 -0
  13. package/install/templates/dist/skill-bundles/byan-bmb-workflow-builder.zip +0 -0
  14. package/install/templates/dist/skill-bundles/byan-bmm-analyst.zip +0 -0
  15. package/install/templates/dist/skill-bundles/byan-bmm-architect.zip +0 -0
  16. package/install/templates/dist/skill-bundles/byan-bmm-dev.zip +0 -0
  17. package/install/templates/dist/skill-bundles/byan-bmm-pm.zip +0 -0
  18. package/install/templates/dist/skill-bundles/byan-bmm-quick-flow-solo-dev.zip +0 -0
  19. package/install/templates/dist/skill-bundles/byan-bmm-quinn.zip +0 -0
  20. package/install/templates/dist/skill-bundles/byan-bmm-sm.zip +0 -0
  21. package/install/templates/dist/skill-bundles/byan-bmm-tech-writer.zip +0 -0
  22. package/install/templates/dist/skill-bundles/byan-bmm-ux-designer.zip +0 -0
  23. package/install/templates/dist/skill-bundles/byan-byan-v2.zip +0 -0
  24. package/install/templates/dist/skill-bundles/byan-byan.zip +0 -0
  25. package/install/templates/dist/skill-bundles/byan-carmack.zip +0 -0
  26. package/install/templates/dist/skill-bundles/byan-cis-brainstorming-coach.zip +0 -0
  27. package/install/templates/dist/skill-bundles/byan-cis-creative-problem-solver.zip +0 -0
  28. package/install/templates/dist/skill-bundles/byan-cis-design-thinking-coach.zip +0 -0
  29. package/install/templates/dist/skill-bundles/byan-cis-innovation-strategist.zip +0 -0
  30. package/install/templates/dist/skill-bundles/byan-cis-presentation-master.zip +0 -0
  31. package/install/templates/dist/skill-bundles/byan-cis-storyteller.zip +0 -0
  32. package/install/templates/dist/skill-bundles/byan-claude.zip +0 -0
  33. package/install/templates/dist/skill-bundles/byan-codex.zip +0 -0
  34. package/install/templates/dist/skill-bundles/byan-drawio.zip +0 -0
  35. package/install/templates/dist/skill-bundles/byan-elo-trust.zip +0 -0
  36. package/install/templates/dist/skill-bundles/byan-fact-check.zip +0 -0
  37. package/install/templates/dist/skill-bundles/byan-forge.zip +0 -0
  38. package/install/templates/dist/skill-bundles/byan-hermes-dispatch.zip +0 -0
  39. package/install/templates/dist/skill-bundles/byan-insight.zip +0 -0
  40. package/install/templates/dist/skill-bundles/byan-mantra-audit.zip +0 -0
  41. package/install/templates/dist/skill-bundles/byan-merise-agile.zip +0 -0
  42. package/install/templates/dist/skill-bundles/byan-native-dev-story.zip +0 -0
  43. package/install/templates/dist/skill-bundles/byan-orchestrate.zip +0 -0
  44. package/install/templates/dist/skill-bundles/byan-patnote.zip +0 -0
  45. package/install/templates/dist/skill-bundles/byan-project.zip +0 -0
  46. package/install/templates/dist/skill-bundles/byan-rachid.zip +0 -0
  47. package/install/templates/dist/skill-bundles/byan-skeptic.zip +0 -0
  48. package/install/templates/dist/skill-bundles/byan-strict.zip +0 -0
  49. package/install/templates/dist/skill-bundles/byan-suitability.zip +0 -0
  50. package/install/templates/dist/skill-bundles/byan-tea-tea.zip +0 -0
  51. package/install/templates/dist/skill-bundles/byan-yanstaller.zip +0 -0
  52. package/install/templates/docs/native-workflows-contract.md +8 -0
  53. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -9,6 +9,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [2.28.0] - 2026-06-23
13
+
14
+ ### Added - Advisory model-tiering lint for native workflows
15
+
16
+ - `workflows-lint.js` gains `untieredExplorationViolations`: a NON-blocking
17
+ advisory (surfaced by `byan-lint-workflows.js --advise`, plus a one-line
18
+ summary on every run) that flags an exploration-labelled `agent()` leaf in a
19
+ `.claude/workflows/*.js` script which runs on the session model instead of
20
+ downgrading to `haiku` (a possible token saving). It reuses `classifyLeaf` /
21
+ `isDowngradeModel` from `native-tiers.js` (single source of truth).
22
+ - It is DELIBERATELY out of `validateContract`: the anti-downgrade floor stays a
23
+ hard rule, but forcing `haiku` onto a judgment-bearing leaf (a gate, a
24
+ classification, an exact conversion consumed verbatim downstream) would be a
25
+ STRICT-2 regression, so the per-leaf deep-vs-cheap call stays with the author.
26
+ - There is no per-leaf "effort" knob in the native `agent()` / Agent API (it
27
+ exposes only `model`), so effort-by-complexity reduces to model-by-complexity.
28
+ Documented in `native-workflows.md`, the SKILL DISPATCH section, and
29
+ `docs/native-workflows-contract.md`.
30
+
31
+ ### Changed - `.mcp.json` tests realigned to the portable-config design
32
+
33
+ - Five test suites still asserted the pre-portable `.mcp.json` shape
34
+ (`env.BYAN_API_URL` present) and failed after 2.27.0. Realigned them to the
35
+ portable invariant: the `byan` entry is present but carries no `BYAN_API_URL`
36
+ and no token (the server self-resolves its config). Security invariants are
37
+ unchanged: the no-token assertions and `verify`'s raw-token / `/api`-suffix
38
+ drift detection remain. Full suite back to green (2326/2326).
39
+
40
+ ## [2.27.0] - 2026-06-19
41
+
12
42
  ### Fixed - Portable MCP config: the server resolves its own credentials
13
43
 
14
44
  The byan MCP server now resolves its config (`BYAN_API_URL` / `BYAN_API_TOKEN`
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-byan-agent",
3
- "version": "2.27.0",
3
+ "version": "2.28.0",
4
4
  "description": "BYAN - Intelligent AI agent installer with multi-platform native support (Claude Code, Codex/OpenCode)",
5
5
  "bin": {
6
6
  "create-byan-agent": "bin/create-byan-agent-v2.js"
@@ -22,6 +22,31 @@ A native workflow script mutates FD/strict state only through the `byan_fd_*` /
22
22
  forbidden import/require in `.claude/workflows/*.js`.
23
23
  - `.githooks/pre-commit` runs that linter, so a violation blocks the commit.
24
24
 
25
+ ## Model tiering — floor enforced, ceiling advisory
26
+
27
+ Each `agent()` leaf runs on the session model unless the call sets `opts.model`.
28
+ The tiering decision lives in one place — `_byan/mcp/byan-mcp-server/lib/native-tiers.js`
29
+ (tier vocabulary, leaf classifier, model map). The doctrine is binary: a pure
30
+ EXPLORATION leaf (read/load/parse/detect) may downgrade to `model: 'haiku'`;
31
+ implementation / verification / analysis leaves OMIT `opts.model` and inherit the
32
+ session model (no pin-up to opus).
33
+
34
+ The linter splits the two directions:
35
+
36
+ - **Floor (HARD, blocks the commit)** — a downgrade model on a PROTECTED leaf, or
37
+ a pin-up, is a contract violation (`modelRoutingViolations`). This is the
38
+ STRICT-2 No Downgrade net.
39
+ - **Ceiling (ADVISORY, non-blocking)** — an exploration-labelled leaf that runs
40
+ deep is *reported* (`byan-lint-workflows.js --advise`), not forced. `classifyLeaf`
41
+ is permissive: many exploration-labelled leaves legitimately stay deep because
42
+ they bear a HALT/prerequisite gate, a classification, or an exact conversion
43
+ consumed verbatim downstream. The human owns that per-leaf call. Forcing haiku
44
+ on them would be the very downgrade the floor forbids.
45
+
46
+ A per-leaf "effort" knob is not available: the native `agent()` / Agent API exposes
47
+ only `model`, so model tier is the sole token lever. Effort-by-complexity reduces
48
+ to model-by-complexity.
49
+
25
50
  ## Registry + resolution
26
51
 
27
52
  - Registry: `.claude/workflows/INDEX.md`, generated by
@@ -66,6 +66,7 @@ Never call `byan_update_apply` without explicit user consent. That tool returns
66
66
  - nature `exploration` (load/read/scan/list/parse/fetch...) → `haiku`
67
67
  - nature `implementation` / `verification` / `analysis` / unknown → deep = **inherit the session model**
68
68
  - Keep protected work (verify/analysis/implement) off haiku regardless of size ; no pin-up to opus. Pass an explicit `nature` to `byan_dispatch` when you know it.
69
+ - **Inside native workflow scripts** (`.claude/workflows/*.js`) the SAME tiering applies per `agent()` leaf via `opts.model`, enforced by the workflow linter as a FLOOR not a ceiling : `modelRoutingViolations` HARD-blocks a downgrade on a protected leaf (or a pin-up) ; an exploration-labelled leaf left deep is a NON-blocking ADVISORY (`byan-lint-workflows.js --advise`), since many such leaves bear a gate/classification/exact-conversion and must stay deep — the human owns that call. No per-leaf effort knob exists (the API exposes only `model`), so effort-by-complexity reduces to model-by-complexity.
69
70
  - **Output** : a table `{ feature → specialist → model → strategy → estimated_tokens }`.
70
71
  - **If no specialist matches** : halt. Ask user whether to run INT (agent recruitment) first. Do NOT fallback silently to general-purpose.
71
72
  - **Exit gate** : user validates the mapping.
@@ -2,17 +2,23 @@
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { execFileSync } from 'node:child_process';
5
- import { validateContract } from '../lib/workflows-lint.js';
5
+ import { validateContract, untieredExplorationViolations } from '../lib/workflows-lint.js';
6
6
 
7
7
  // Validate native workflow scripts under .claude/workflows/ against the full
8
8
  // contract (state-coupling + clock/RNG + meta-literal) AND node --check syntax.
9
- // Exits non-zero on any violation (used by the pre-commit gate).
10
- // Usage: node bin/byan-lint-workflows.js [--root <dir>]
9
+ // Exits non-zero on any contract violation (used by the pre-commit gate).
10
+ //
11
+ // Tiering is reported SEPARATELY and NON-BLOCKING: exploration-labelled leaves
12
+ // that run deep are a possible token saving, but many legitimately stay deep
13
+ // (they bear a gate/classification/exact-conversion). So they are an ADVISORY,
14
+ // never a hard failure. A one-line summary always prints; --advise lists each one.
15
+ // Usage: node bin/byan-lint-workflows.js [--root <dir>] [--advise]
11
16
 
12
17
  function parseArgs(argv) {
13
18
  const args = {};
14
19
  for (let i = 2; i < argv.length; i++) {
15
20
  if (argv[i] === '--root') args.projectRoot = argv[++i];
21
+ else if (argv[i] === '--advise') args.advise = true;
16
22
  }
17
23
  return args;
18
24
  }
@@ -32,8 +38,10 @@ try {
32
38
  }
33
39
 
34
40
  let failed = 0;
41
+ const advisories = [];
35
42
  for (const file of files) {
36
- const violations = validateContract(fs.readFileSync(file, 'utf8'));
43
+ const src = fs.readFileSync(file, 'utf8');
44
+ const violations = validateContract(src);
37
45
 
38
46
  // Syntax gate: a native script must parse.
39
47
  try {
@@ -48,6 +56,24 @@ for (const file of files) {
48
56
  process.stderr.write(`[byan-lint-workflows] ${file}: ${v.id} - ${v.msg}\n`);
49
57
  }
50
58
  }
59
+
60
+ // Non-blocking tiering advisory: exploration leaves that run deep.
61
+ for (const a of untieredExplorationViolations(src)) {
62
+ advisories.push({ file, ...a });
63
+ }
64
+ }
65
+
66
+ // Tiering advisory is informational only — it never changes the exit code.
67
+ if (advisories.length) {
68
+ if (args.advise) {
69
+ for (const a of advisories) {
70
+ process.stdout.write(`[byan-lint-workflows] ADVISORY ${a.file}: ${a.id} - ${a.msg}\n`);
71
+ }
72
+ } else {
73
+ process.stdout.write(
74
+ `[byan-lint-workflows] advisory: ${advisories.length} exploration leaf(s) run deep (rerun with --advise to list; keep deep if they bear a gate/judgment, else add model: 'haiku')\n`
75
+ );
76
+ }
51
77
  }
52
78
 
53
79
  if (failed === 0) {
@@ -151,9 +151,75 @@ export function modelRoutingViolations(src) {
151
151
  return out;
152
152
  }
153
153
 
154
+ // Positive tiering ADVISORY — the symmetric half of modelRoutingViolations.
155
+ //
156
+ // modelRoutingViolations stops a downgrade from landing on a PROTECTED leaf
157
+ // (the anti-downgrade direction, a HARD contract rule). This function surfaces the
158
+ // opposite signal: an EXPLORATION-labelled leaf (read/load/parse/detect) that does
159
+ // NOT downgrade and so runs on the session model (Opus) for cheap I/O — a possible
160
+ // token saving. It is NON-BLOCKING (the bin's --advise mode, not validateContract):
161
+ // classifyLeaf is permissive, so a flagged leaf may legitimately stay deep when it
162
+ // bears judgment (a gate, a classification, an exact conversion). The human owns
163
+ // the call. Same source of truth: classifyLeaf + isDowngradeModel from
164
+ // native-tiers.js; this only reports against the contract those encode.
165
+ //
166
+ // Membership: a model: token belongs to a label when it sits in the SAME opts
167
+ // object — between the brace that closes the previous object and the one that
168
+ // closes this label's object — so the rule is order-independent (model: may sit
169
+ // before OR after label: within { ... }). Comment-stripped, like the others.
170
+ //
171
+ // Conservative by construction: only STATIC quoted/backtick labels are seen, and
172
+ // only labels classifyLeaf rules EXPLORATION fire. A computed (unquoted) label or
173
+ // a non-exploration label is never flagged, so the rule never forces a downgrade
174
+ // onto protected or unclassifiable work — it only recovers the safe savings.
175
+ function sameOptsObjectText(code, labelStart, labelEnd) {
176
+ const prevClose = code.lastIndexOf('}', labelStart);
177
+ const left = prevClose === -1 ? 0 : prevClose + 1;
178
+ const nextClose = code.indexOf('}', labelEnd);
179
+ const right = nextClose === -1 ? code.length : nextClose;
180
+ return code.slice(left, right);
181
+ }
182
+
183
+ function objectHasDowngradeModel(objText) {
184
+ let mm;
185
+ MODEL_RE.lastIndex = 0;
186
+ while ((mm = MODEL_RE.exec(objText))) {
187
+ if (isDowngradeModel(mm[2])) return true;
188
+ }
189
+ return false;
190
+ }
191
+
192
+ export function untieredExplorationViolations(src) {
193
+ const code = stripComments(src);
194
+ const out = [];
195
+ let m;
196
+ LABEL_RE.lastIndex = 0;
197
+ while ((m = LABEL_RE.exec(code))) {
198
+ const label = m[2];
199
+ if (classifyLeaf({ label }) !== LEAF_TYPES.EXPLORATION) continue;
200
+ const objText = sameOptsObjectText(code, m.index, m.index + m[0].length);
201
+ if (!objectHasDowngradeModel(objText)) {
202
+ out.push({
203
+ id: 'untiered-exploration',
204
+ msg: `exploration leaf '${label}' does not pin a downgrade model; add model: 'haiku' so cheap I/O does not run on the session model (token waste)`,
205
+ });
206
+ }
207
+ }
208
+ return out;
209
+ }
210
+
154
211
  // Full native-workflow contract: state-coupling (comment-stripped) + clock/RNG
155
212
  // (raw) + meta-literal-first + model-routing anti-downgrade. Returns the
156
213
  // combined [{ id, msg }] violations.
214
+ //
215
+ // untieredExplorationViolations is DELIBERATELY NOT in the hard contract. The
216
+ // tiering rule is a FLOOR (forbid a downgrade on a protected leaf), not a CEILING
217
+ // (force every exploration-labelled leaf to downgrade). classifyLeaf is permissive
218
+ // — many exploration-labelled leaves bear judgment (a HALT/prereq gate, a
219
+ // classification, an exact conversion consumed verbatim downstream) and MUST stay
220
+ // deep. Forcing them to haiku would be the exact STRICT-2 No Downgrade regression.
221
+ // So the positive check ships as a non-blocking ADVISORY (the bin's --advise mode);
222
+ // the human keeps the per-leaf judgment. See docs/native-workflows-contract.md.
157
223
  export function validateContract(src) {
158
224
  return [
159
225
  ...lintSource(src),
@@ -94,7 +94,7 @@
94
94
  "name": "byan-byan",
95
95
  "module": "core",
96
96
  "tier": "connector-bound",
97
- "sourceHash": "0a1f4b1333f7f42a43b1a8ad57b0d7d687aec95f149ae13ba98b78970ed3bd09"
97
+ "sourceHash": "88403d60531d9fb3e7cdb566429643f1f47baf9918593e8082ecc98eedebb878"
98
98
  },
99
99
  "byan-byan-v2": {
100
100
  "name": "byan-byan-v2",
@@ -153,6 +153,14 @@ Enforcement (because the in-session hooks do not fire inside a script):
153
153
  - `test/native-routing-integration.test.js` pins the invariant on the SHIPPED
154
154
  scripts: every script passes the contract, and every downgrade sits on an
155
155
  exploration leaf.
156
+ - `workflows-lint.js` -> `untieredExplorationViolations` is the SYMMETRIC
157
+ advisory: it surfaces an exploration-labelled leaf that runs deep (a possible
158
+ saving). It is DELIBERATELY OUT of `validateContract` — forcing those leaves to
159
+ haiku is exactly the regression the curation above rejected, so it is a
160
+ non-blocking report (`byan-lint-workflows.js --advise`), not a gate. The
161
+ per-leaf deep-vs-cheap call stays with the author. There is no per-leaf effort
162
+ knob (the native `agent()` / Agent API exposes only `model`), so model tier is
163
+ the sole token lever and effort-by-complexity reduces to model-by-complexity.
156
164
 
157
165
  If a future runtime needs full model ids instead of the `haiku`/`sonnet`
158
166
  aliases, `TIER_MODEL` in `native-tiers.js` is the only edit; the linter then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-byan-agent",
3
- "version": "2.27.0",
3
+ "version": "2.28.0",
4
4
  "description": "BYAN v2.8 - Intelligent AI agent creator with ELO trust system + scientific fact-check + Hermes universal dispatcher + native Claude Code integration (hooks, skills, MCP server). Multi-platform (Claude Code, Codex). Merise Agile + TDD + 71 Mantras. ~54% LLM cost savings.",
5
5
  "main": "src/index.js",
6
6
  "bin": {