Repository navigation
fix(integration): diagnose old hosts, publish ops_status on built-in presets, and teach batching guidance on tool results (#701, #753, #929, #966, #897) - #1008
Conversation
…iagnosis (#701) An older host used to load anyway and fail later: TypeError scope errors backstage, EXECUTOR_UNAVAILABLE in front. The floor is read from the package manifest (engines.dsh), never a copy, and an unknown host version loads as before because it cannot be proven below the floor. Red/green evidence: test-results/red/host-floor-revert-red.txt, test-results/green-host-floor/.
The diagnosis tool was registered only behind an external preset row, while the diagnosis itself already understood mode sessions. The built-in mode row now mounts the same read-only diagnosis for exactly its own mode's sessions; the mount settles asynchronously because a synchronously resolved fiber never hears the agent/created dispatch its injection registered. Sessions of other modes stay unadmitted by that row. Red/green evidence: test-results/red/status-builtin-revert-red.txt, test-results/green-status-builtin/.
The package publishes exactly one shell tool, ops_bash, and a misnamed bash call is answered by the host's own unknown-tool handling, which never reaches this package. The section names where the alias could exist (it does not) and where a did-you-mean correction belongs: upstream.
…#753) Measured on win32, mount on: minimal 3536/8246/4710, standard 3536/12670/9134, cordis 3536/12670/9134, ptc 7553/19200/11647 (before/after/net). With the #753 mount disabled the same run reports 3536/8045/4509, 3536/12469/8933, 3536/12469/8933 and 7553/19026/11473, so the 174-201 byte difference is the ops_status schema and guidance this accepted behaviour adds. minimal and ptc carry the added allowance (8100->8300, 19200->19300); standard and cordis keep their previous, still-unused headroom.
|
Coordination note from #998 (P7: distinguish re-taught lessons after resume from missed lessons after compaction). Scope of #998 on my side, on the card/d3-full-publication lineage (the step-tail lesson channel this PR removes on main):
Overlap with this PR: src/publication/ptc.ts only, and textually limited to the lesson provider/latch block this PR already rewrites. Your move of the lesson onto the first accepted root run_code tool result via additionalContexts (never logged as user history) structurally resolves the resume-duplicate case on main — the ephemeral channel re-delivers per agent lifetime by design, and compaction cannot remove what never entered the surface. I will not touch your channel; the decision logic (visible / taught-then-compacted / never-taught) and its tests stay reusable if the card lineage ever adopts the same channel. No merge-order dependency either way; whichever lands second rebases that one block. |
|
协调说明(#998 / P7):本单在 d3 工作线(基线 card/d3-full-publication@d0fcd6f)上实现教学去重——该线上 batching lesson 仍经 step-tail 进入 logged history,正是你 PR 里 #929 改为 additionalContexts 之前的形态。我们以 session.deriveMessages()(模型实际可见历史)为准区分:恢复后同版可见则新增 0 条、压缩 replace 遮蔽后补一条短提示、撤回批次不消耗教学机会,改动在 src/prompt-injection/index.ts(去重)与 src/publication/ptc.ts(注入点)。两个分支会同时改 ptc.ts 的教学 wiring,合并时需要以此为准做一次对账:若你的 ephemeral additionalContexts 方案落地,durable step-tail 的去重在那条线上自然失效,但框架层的可见性去重对任何 durable step-tail 贡献仍然适用。 |
The lesson rode the accepted user batch, entered logged history and was answered as fresh user input (T-Auto#929). Deliver it once through the first accepted root run_code result instead, keep the surface-aware rendering, and narrow the file-work rule and examples to the APIs the scope publishes so a read-only lesson never teaches an edit. Direction from upstream T-Auto#1008.
-T-Auto#1008 Merge release/ops-ptc-18-cards on top of the seven fix branches and reconcile the surfaces both sides rewrote: - docs/CHANGELOG.md: union of both sides' Unreleased entries (no duplicates). - src/publication/ptc.ts: keep the release's surface-aware teaching renderer and four-verdict refusal, port T-Auto#1008's T-Auto#929 ephemeral lesson channel and T-Auto#968's deferred loader pointer into it, and drop the P7 step-tail provider plus the compaction re-anchor that depended on logged history (superseded by the ephemeral channel; see T-Auto#929/T-Auto#998). - src/publication/replacements.ts: keep both the T-Auto#962 per-agent fail-open latch and the release's hidden-name system-prompt retirement. - src/publication/registrar.ts, src/consumer/mount.ts: union of the deferred advisor loop, the revoked verdict and the PTC keepOfficial handoff. - tests: adapt the tier enumerations, the cost ledger and the teaching assertions to the merged surface (the T-Auto#753 ops_status diagnostics row and the ephemeral lesson channel), keeping one assertion per unchanged behaviour. - docs: point the batching-guidance descriptions at the ephemeral inbox. Refs T-Auto#1000, T-Auto#1032.
Closes #701, #753, #929, #966
Refs #897
What was wrong
engines.dshloaded anyway and failed later with backstageTypeErrors and front-facingEXECUTOR_UNAVAILABLE.ops_status; diagnostics were published only through integration/custom preset rows.jq/linkshadowing system commands; stale generated faces survived cache upgrades).bashwhere onlyops_bashexists. The repository has nobashalias and this PR does not add one; the doc states the single-name policy (correction belongs to the host's unknown-tool handling).The change
src/adapter/dsh/host-floor.ts: reads the declared floor from the package manifest (engines.dsh) and refuses an older host at activation with one named diagnosis; unreadable/unknown versions load as before.src/integration+src/index.ts: built-in modes mount the read-only diagnostics for exactly their own sessions; the mount settles asynchronously because a synchronously resolved fiber never hears theagent/createddispatch.src/publication/ptc.ts: the one-time batching lesson now rides the first accepted rootrun_codetool result throughadditionalContexts(the same-step ephemeral inbox the host never logs as user history) under contributorbatching-guidance:lesson; the per-violation notices keep the base id. The durable-history latch is gone.src/niubash: face list aligned with winuxcmd applets; stale generated faces are detected and the version is rebuilt/retired on upgrade.test/prompt-budget.test.mjs: resident budgets re-pinned for theops_statusmount, with the measured before/after/net values recorded in the test comment (minimal 8100→8300, ptc 19200→19300; standard/cordis unchanged at 13700).Local validation:
integration-host-floor4/4,integration-status-builtin3/3,integration-diagnostics4/4,prompt-ephemeral-teaching2/2,resident-switch24/24,niubash-faces-consistency3/3,prompt-budget1/1,check:size827 files all ≤1000 lines.Validation
The gate lines above were produced on the local integration head
b21274dd(all slices merged) with the pinned local fixtures:DSH_OPS_TEST_BASH= a verified pinned MSYS bash (sha256 6cc575e9…),DSH_OPS_NIUBASH_ARCHIVE= the shipped frozen archive. Each PR branch was also built and its own suites were run before push; the counts below are from those runs.CI required run: the pull_request event for this PR triggers
ci.yml; paste the aggregateCI requiredrun URL here once it finishes.Environment
maincommit58f6e281(origin/main at submission)npm ci --ignore-scripts --offline,npm run build,npm run stage:niubash -- --offline --archive <frozen archive>)