This repository was archived by the owner on Aug 24, 2026. It is now read-only.
fix: quote preset.yml descriptions (YAML metadata parse) + repair router.test.mjs import - #13
Open
baobaolaodie wants to merge 3 commits into
Open
Conversation
…e) + regression test dsh reads preset.yml with a YAML loader; plain-scalar description values containing ": " (router-standard "restoration: one-sentence", router-spec "(spec): classified") fail to parse, so the preset picker falls back to showing only the preset id. Double-quote both descriptions. Also repair router.test.mjs: the v0.2.0 preset reorg moved router-core.mjs under preset/<preset>/, leaving the ./preset/router-core.mjs import dangling and the suite unrunnable; point it at preset/router-standard/router-core.mjs and add a zero-dependency regression test guarding the metadata files.
…e closure) The previous guard only inspected the description value. Generalize it to every metadata key (name, description, ...): require a name and a description line, treat an opened quote that never closes as a failure, and keep the unquoted ": " check. Still zero dependencies.
The v0.2.0 reorg moved the composition and router files under preset/router-standard/ and preset/router-spec/, but README still listed the pre-reorg root paths (preset/agent.cordis.yml, preset/router-core.mjs, preset/router-bootstrap.mjs) and an outdated test count. Point the Files and License sections at the real preset directories and note the actual 16-test suite.
Author
|
补充说明:本 PR 提交之后才注意到 #12 已先行修复同一问题,未能更早发现,给审阅带来重复内容,敬请见谅。 #12 更早、更聚焦,对 preset.yml 的修复与本 PR 完全一致。本 PR 另包含 #12 未涉及的两处内容,供作者参考:
对应 bug 报告:#11。合并哪一个、如何合并,完全由作者决定;如需将上述修复拆分或并入 #12,随时告知即可配合调整。 |
lapp33669
added a commit
to lapp33669/dsh-router-standard
that referenced
this pull request
Aug 16, 2026
…claimed before assemble; sessionMode filters source.kind; import extractText - yjh051108#11: extractText was used in the session/event guidance listener but never imported (bandOf was fixed in 0fbe572) -> ReferenceError on every real user message in v0.2.0. Both presets, both bootstrap copies. - yjh051108#13: the session/event user/message firehose fires only AFTER the first assembly (agent loop appends the message at step start), so the v0.2.0 firstUserText capture still routed the FIRST request to weak. agent/inbox/claimed fires during inbox.claim, which preStep runs BEFORE systemPrompt.assemble — the first request now carries the real classification. - sessionMode now only classifies source.kind === 'user' messages, so plugin steering (user-approval, ingest seeds) can no longer pin a session weak.
lapp33669
added a commit
to lapp33669/dsh-router-standard
that referenced
this pull request
Aug 16, 2026
…e — raw text clamped to 0 routed every task to spec The claimed-event capture (previous commit) made the first assembly see the real message, but the chain fed the RAW TEXT into bandOf(). clamp01() is Number(v)||0, so a non-numeric task string became 0 → spec band for EVERY task (measured: Mario build task got SPEC_PERSONA + read/edit/glob/grep). Now firstMode() runs classifyTask() on the captured text; measured after fix: react task → REACT_PERSONA + read/write/edit core on the first request.
This was referenced Aug 16, 2026
yjh051108
added a commit
that referenced
this pull request
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
dsh 用 YAML 加载器读取每个预设的
preset.yml显示元数据;未加引号的纯量值里出现": "(冒号+空格)会被解析为嵌套映射而报错,导致预设选择器回退为只显示 id(丢失名称/描述)。当前 main 上两个预设均存在此 bug:preset/router-standard/preset.yml—restoration: one-sentencepreset/router-spec/preset.yml—(spec): classified修复内容
preset.yml:description值加双引号,YAML 合法化。router.test.mjsimport 修复:v0.2.0 重构把router-core.mjs移入preset/<preset>/子目录后,测试仍引用已不存在的./preset/router-core.mjs—— 在此之前npm test根本无法运行(无 CI 所以未被发现)。现指向./preset/router-standard/router-core.mjs。preset.yml元数据——name/description行必须存在、引号必须闭合、未加引号的值不得包含": "。11 → 16(原计数早已与实际不符)preset/agent.cordis.yml等根路径)改为实际目录preset/router-standard/、preset/router-spec/验证
node router.test.mjs→ 16/16 全部通过(15 原有 + 1 新增)": "—— 5 组变异下回归测试均正确失败,证明其有效性preset.yml经 js-yaml 解析正常(与 dshreadPresetMetadata使用同款加载器)agent.cordis.yml)经 dsh 官方entryListSchema解析通过,无其他同类隐患