fix(tui): align model-facing docs and tool gating - #31
Open
asto18089 wants to merge 5 commits into
Open
Conversation
The fleet-manager skill listed the real CLI evidence verbs but omitted 'codewhale fleet resume' (the orphaned-lease reconcile action) and did not say that 'stop' requires '--all'. Add both, name the concrete Runtime API evidence endpoints (worker inspection, receipt evidence, event replay) alongside the CLI commands, and list resume in the post-run receipt action set. Signed-off-by: asto <asto18089@126.com>
The verify tool description told models to 'use run_verifiers', a name retired in the v0.9.3 consolidation that cannot dispatch; point at the canonical 'Run with action=verifiers' form instead. Drop the retired 'exec_shell_wait' from the verifier background metadata poll_with list, keeping the live 'task_shell_wait'. Extend the no_advertised_tool_teaches_a_retired_name guard to scan the verify tool by adding with_verify_tool to its builder. Signed-off-by: asto <asto18089@126.com>
The timeout_ms schema implied the deadline applies to action=run generally, but the background spawn path schedules no kill: only the foreground wait is bounded (deadline kill + TimedOut). State that explicitly in timeout_ms and background, including the 1000-600000 clamp on the foreground/wait paths and how to bound or stop background work (action=wait timeout, action=cancel). Documentation aligns with current behavior; whether background tasks should become killable at the timeout is left for upstream discussion. Signed-off-by: asto <asto18089@126.com>
The notify tool description and its registration comment both promise that [notifications].method = "off" silences the tool, but the tool hardcoded Method::Auto, so only quiet/events gating applied and a configured 'off' method still emitted. Install the configured method process-wide from settings() (same bridge as the NotificationGate) and have the tool read it; 'off' now returns before any sink write while the tool result stays a success (silent no-op). Known limitation, shared with the gate: the install happens on the first settings() call, so a first-turn notify in a fresh process predates it. Signed-off-by: asto <asto18089@126.com>
The finance tool declared the Network capability but never consulted the session NetworkPolicyDecider, so a tightened session (network.default = deny) still reached query1.finance.yahoo.com. Check both configured endpoint hosts (quote and chart) before any request, matching the Web/web_search/speech family: Deny and undecided Prompt both fail closed with permission errors; no attached policy falls through permissively for back-compat. Testing both hosts up front closes the chart-fallback leak. Say so in the description. Signed-off-by: asto <asto18089@126.com>
|
Thanks @asto18089 for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Model-facing documentation/spec audit fixes, re-verified line by line against the current
pinvou3-cleanhead before changing anything. Four of the six audited findings were confirmed and fixed; two were rejected after re-verification (evidence below). No behavior is changed except where noted (notify method enforcement, finance network gating).Findings and fixes
1. fleet-manager skill guidance (adjusted, not as audited)
codewhale fleet logs/artifactsdo not exist becauseparse_verb(crates/lane/src/control.rs) has no such verbs.parse_verbgoverns the in-TUI/fleetslash surface. Thecodewhale fleetCLI (clapFleetCommand, crates/tui/src/lib.rs) really hasInspect/Logs/Artifacts { worker_id }subcommands dispatched tomanager.inspect_worker,print_logs,print_artifacts. The original skill text was valid for the CLI.codewhale fleet resume <run-id>(the orphaned-lease reconcile action,fleet.resume, idempotent), did not mention thatstoprequires--all, and named no concrete Runtime API evidence endpoints. All three are added; the CLI verb list is otherwise preserved.2. mcp-builder skill command syntax (rejected — no change)
codewhale mcp add my-server --command node --arg server.js/--url ...andcodewhale mcp toolsdo not exist, citingparse_addin crates/tui/src/commands/groups/utility/mcp.rs./mcpslash command. ThecodewhaleCLI routescodewhale mcp <args>through the codewhale-cli passthrough (trailing_var_arg) into clapMcpCommand(crates/tui/src/lib.rs), which accepts exactlyadd <name> --command ... --arg ...,add <name> --url ..., and has a realToolssubcommand — the binary's own init output teachescodewhale mcp tools(lib.rs,McpCommand::Initarm). Applying the audit's positional-form fix would have broken the documented CLI syntax. No change made; flagged back to the auditor.3. verify tool taught a retired name (fixed)
crates/tui/src/tools/verify.rsdescription said "(use run_verifiers)";run_verifiersis inRETIRED_TOOL_NAMESand cannot dispatch. Now says "(use Run with action=verifiers)".crates/tui/src/tools/verifier.rsbackground metadata advertisedpoll_with: ["exec_shell_wait", "task_shell_wait"];exec_shell_waitis retired. Now["task_shell_wait"], matching the shell.rs timeout-recovery metadata precedent.no_advertised_tool_teaches_a_retired_nameguard missed this because its builder never registered the verify tool;.with_verify_tool(None, ...)is now in the guard's builder so the whole advertised surface (including verify) is scanned.4. Bash background timeout semantics (fixed, documentation direction)
timeout_msto 1000-600000, kills at the deadline, and reportsTimedOut; the background spawn path passes no kill scheduling, andShellManager::cleanupretainsRunningtasks. Sobackground=truetasks are not killed attimeout_ms.timeout_msandbackgroundschema descriptions now state exactly that, including the clamp and how to bound/stop background work (action=waittimeout,action=cancel). No behavior change. Whether background tasks should become killable at the timeout is left as an upstream discussion item.5. notify tool ignored
method = "off"(fixed, implementation direction)Method::Auto;Offonly intercepted when passed in;Autoresolution never read config; the process gate covered onlyquiet/events. The description and the registration comment in tool_setup both promisemethod = "off"silences the tool — a user-safety promise, so this was fixed as a bug, not by editing the description.settings()now installs the configured[notifications].methodprocess-wide (same bridge and pattern as theNotificationGate), and the notify tool readsconfigured_method()instead of hardcodingAuto.offreturns before any sink write; the tool result stays a success (silent no-op, as documented). Emission was split intoemit_model_notifywith an injectable sink for tests.settings()call (turn completion / approval / input / elevation events), so a first-turnnotifyin a fresh process predates it. Disclosed rather than adding a new config-read path at the tool layer.6. finance tool bypassed network policy (fixed, implementation direction)
executeignored_context; nonetwork_policyreference despite theNetworkcapability, sonetwork.default = denysessions still reachedquery1.finance.yahoo.com.NetworkPolicyDecider::evaluate(host, "finance"), so the chart fallback cannot leak.Denyand undecidedPromptfail closed with permission errors in the exact shape used byweb_search/speech(including the/network allow <host>hint); no attached policy falls through permissively for back-compat. Description now states the tool is network-policy aware.Tests
cargo test -p codewhale-tui --lib -- tools::finance— 20 passed, including two new fail-closed policy tests (deny-list host with zero mock-server requests; default=prompt approval path).cargo test -p codewhale-tui --lib -- tools::notify tui::notifications— 41 passed, including new:method_off_makes_emission_a_silent_no_op,configured_method_off_silences_the_tool_emission,configured_method_off_still_reports_success_to_the_model,settings_installs_configured_method_from_config,configured_method_bits_round_trip_every_variant.cargo test -p codewhale-tui --lib -- no_advertised_tool_teaches_a_retired_name— 1 passed (guard now scans the verify tool).cargo test -p codewhale-tui --lib -- tools::verifier— 8 passed.cargo test -p codewhale-tui --lib -- tools::shell::tests— 96 passed (existing timeout behavior untouched).cargo test -p codewhale-tui --lib -- skills::system— catalog/generation fixtures unaffected (names unchanged; body-only edit follows the aa4eb12 precedent of no generation bump).cargo fmt --checkclean;cargo clippy -p codewhale-tui --lib --all-targets— no new warnings in changed files;cargo check -p codewhale-cliclean.Fork register
This PR adds fork-distinct behavior (notify method enforcement, finance network gating) and model-facing doc corrections. The parent repo (
pinvou-agent) will follow up with thedocs/fork-modifications.mdregister update, the gitlink advance, and any required tag/fingerprint bumps — kept out of this PR intentionally since the register lives in the parent.DCO sign-off present on every commit.
No-Issue: model-facing documentation and tool-gating audit fixes tracked in the pinvou-agent internal audit; no upstream CodeWhale issue exists for this batch.