Skip to content

Port upstream review fixes onto aidlc/integration - #1

Merged
fbdo merged 15 commits into
aidlc/integrationfrom
port/upstream-review-fixes
Nov 1, 2026
Merged

fbdo merged 15 commits into
aidlc/integrationfrom
port/upstream-review-fixes

Conversation

@fbdo

@fbdo fbdo commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Port of the upstream review fixes onto aidlc/integration

aidlc/integration carries the ten feature branches that were filed upstream as
1jehuang#2032 to 1jehuang#2041. Review (Greptile) and the box gate found real
problems in them, and each fix was made on the upstream pr/* branch. This PR
ports every one of those fixes, with its tests, onto the fork's integration
branch as new commits only. aidlc/integration is not rewritten.

Base: aidlc/integration (1a562a2). Branch: port/upstream-review-fixes.

Fixes

Fix Upstream PR Tests that cover it
Reloading global skills uses the same precedence as loading them 1jehuang#2033 skill tests in jcode-base (reload order case)
Quoted skill arguments stay one argument, a bare invocation clears stale arguments, rewind re-announces the skill 1jehuang#2034 agent_tests/skill_arguments.rs (empty_arguments_replace_old_ones_and_rewind_allows_reannouncing)
Swarm hook identity is kept until the final status update, so a disconnect still fires swarm_member_end 1jehuang#2035 swarm tests in jcode-app-core
swarm_member_end report is documented as truncated, and the worker identity limits are written down 1jehuang#2035 docs only
user_prompt_submit runs for context-only messages and carries the declared origin (sdk), visible worker startup is marked swarm_spawn, prompt origins are forgotten with the session, ambient and overnight prompts are marked system, and a hook-blocked prompt is never failed over to another account 1jehuang#2036 agent_tests/prompt_hook.rs (context-only, declared origin, run_once_capture_as), turn_failover (a_hook_block_keeps_its_own_error_type)
Unix-only guard on the prompt and stop hook test modules 1jehuang#2036, 1jehuang#2037 compile-time (the modules are #[cfg(unix)])
The stop hook is skipped after provider guardrail stops (refusal, content filter, safety) 1jehuang#2037 agent_tests/stop_hook.rs (guardrail case)
Project trust: the worktree back-link is verified, grant and revoke hold the store lock, the store is read from the primary file only, secret MCP env values are redacted in review output, the lock directory is tightened before locking 1jehuang#2038 project_trust_tests.rs (forged worktree pointer, concurrent grant and revoke, linked worktree helper), mcp/trust.rs redaction test
Cached project hooks re-check approval and the enable switch on every lookup, and a malformed project config no longer blocks jcode trust 1jehuang#2039 hooks/project_tests.rs (revoking_or_disabling_takes_effect_while_the_parse_is_cached)
Agent definitions resolve from the coordinator's directory, and the swarm tool schema lists only user-level definitions 1jehuang#2040 comm_session_agent_def_tests.rs (definition_comes_from_the_coordinator_dir_not_the_worker_dir), swarm_model_schema tests
Project policy trust is judged on the directory the definition came from, and on the definition being applied (no re-read of the files) 1jehuang#2041 swarm_agent_policy_tests.rs (a_definition_edited_after_approval_is_not_applied_from_a_stale_snapshot)
Narrowed worker tools also narrow nested batch calls (the registered session policy is refreshed) 1jehuang#2041 swarm_agent_policy_tests.rs
docs/PROJECT_TRUST.md corrected: all three scopes are live on this branch 1jehuang#2039 docs only

Differences from the upstream branches

The integration branch merges the features, so some code is arranged
differently from the stacked upstream PRs. Where a fix touched that code I
adapted it rather than copying it:

  • remove_session_env here does not forget the swarm identity (that happens in
    remove_session_entry), so only the prompt origin cleanup was added.
  • set_pending_prompt_origin_named did not exist on this branch and is added.
  • The stop hook keeps this branch's project-aware hook_configured_for("stop", ..)
    next to the new guardrail check.
  • The trust CLI is src/cli/commands/trust.rs here (src/cli/trust.rs upstream).
  • The agent definition modules are server::swarm_agent_defs and
    server::swarm_agent_policy here, so the commit's paths were adjusted.
  • The F1a fixes were folded into the upstream feature commit, so they arrive
    here as one new commit built from the diff.

Not ported

Nothing that was fixed upstream is left out. These review findings were not
fixed upstream either, so they are not here:

Validation

Gated on the build box, with aidlc/integration (1a562a2) gated the same way as the baseline. The gate is fmt, cargo check, clippy, module files, code size, test size, panic, swallowed-error and wildcard re-export budgets, dependency boundaries and SDK parity, plus the test suites for every area above (hooks, trust, mcp, skill, agent_def, skill_arguments, prompt_hook, stop_hook, swarm, agent_def_tests, turn_failover, client_lifecycle, and the jcode CLI args tests).

  • All 12 test targets pass. Tree stays clean after cargo fmt.
  • Same 7 checks pass and 5 fail as on the baseline. The failing ones are pre-existing on aidlc/integration (the jcode-tui clippy errors and the code size, test size, swallowed-error and similar ratchets).
  • Ratchet numbers on the failing checks are at or below the baseline, except these, which grow by the amounts the fixes need and sit inside budgets that were already exceeded: swallowed-error-like usage in project_trust.rs (2, the baseline's own copy has 3), dot_ok +7 (baseline +9), unwrap_or_default +11 (baseline +12), and client_lifecycle.rs 4000 lines (baseline 3999, one line more for the origin argument).
  • Not run: the full workspace test suite. Only the areas touched were run.
  • Separate from this change: accepted_reload_recovery_continuation_marks_intent_delivered fails on master too.

fbdo added 15 commits November 1, 2026 16:06
… bare invocation, and re-announce after rewind
…sible worker startup as swarm_spawn, forget prompt origins
…generated ambient and overnight prompts, and never fail over a hook-blocked prompt
…s grant and revoke, redact secret MCP env values in review output

Ports the upstream review fixes folded into the project trust change (1jehuang#2038).
…ormed project config from blocking trust commands

Ports the upstream review fixes for project hooks (1jehuang#2039) and
corrects PROJECT_TRUST.md now that all three scopes are live.
@fbdo
fbdo merged commit 37268ea into aidlc/integration Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant