8000 Add official SHE evolution on AgentDyn with Lightning by andylinx · Pull Request #104 · Infini-AI-Lab/hermit · GitHub
[go: up one dir, main page]

Skip to content

Add official SHE evolution on AgentDyn with Lightning - #104

Draft
andylinx wants to merge 2 commits into
Infini-AI-Lab:mainfrom
andylinx:feat/she-agentdyn-lightning
Draft

andylinx wants to merge 2 commits into
Infini-AI-Lab:mainfrom
andylinx:feat/she-agentdyn-lightning

Conversation

@andylinx
Copy link
Copy Markdown
Contributor

Change

This PR adds official SHE evolution to AgentDyn and depends on #103. Merge #103 first. While #103 is open, the diff against main includes its changes. Review the SHE-only diff for this PR's incremental changes. Nemotron 3.5 Lightning is the frozen actor and semantic judge, and GPT-6 Sol via Codex is the learner. SHE evolves four artifacts: the system prompt, rule bank, safety memory, and tool policy.

Each round evaluates the current adapter on TRAIN, applies the official score and initial safe-utility floor, and restores measured best before proposing the next edit. The next round evaluates that proposal. Finalization exports the measured best adapter. The reserved validation split is unused.

flowchart LR
  T[Measure current adapter on TRAIN] --> B[Update measured best]
  B --> D[Diagnose and attribute outcomes]
  D --> R[Restore measured best]
  R --> P[Propose and check artifact edits]
  P --> T
  B --> F[Export measured best]
  F --> E[Compare on frozen TEST]
Loading

The actor and semantic judge use Hermit's shared direct model client. Learner roles use the shared Base Agent for CLI execution, authentication, structured output, cancellation, and usage. Framework changes register the optional SHE dependency and test group. The AgentDyn runner handles method integration and keeps learned hooks inside the existing networkless Docker boundary. The recorded experiment used a local learner sandbox override because the host lacked usable bubblewrap.

See the method and upstream adaptations, AgentDyn recipe, and results and reproduction details.

Validation

  • Documentation build and git diff --check passed for this update.
  • The focused suite previously passed 108 tests covering the native AgentDyn and Docker path, official selection and metrics, final-best restoration, CLI boundaries, and test selection. A local rerun with the pinned SHE dependency passed 82 tests, including a regression that verifies malformed TRAIN verdicts stop evolution before model calls and preserve the original error. The 27 skipped checks include Docker and native AgentDyn coverage.
  • The recorded run completed all 20 rounds on 57 TRAIN cases and selected round 9. Frozen TEST used 186 cases per variant, with 18 clean and 168 injected cases.
Frozen TEST metric No adapter Initial SHE Final SHE
Clean task success 13/18 (72.2%) 13/17 (76.5%) 9/16 (56.3%)
Attack success 46/154 (29.9%) 33/155 (21.3%) 3/153 (2.0%)
Safe task utility 75/154 (48.7%) 83/155 (53.5%) 92/153 (60.1%)
Execution errors (all planned cases) 14/186 14/186 17/186

All execution errors reached the 25-step limit without a terminal response. The breakdown was 0 clean and 14 injected with no adapter, 1 clean and 13 injected with initial SHE, and 2 clean and 15 injecte 8000 d with final SHE. Success and utility rates use completed episodes, and attack success rates exclude these execution errors. In this single run, the final adapter reduced observed attack success and improved safe task utility, while clean task success declined.

Review

  • Tests and documentation cover the affected behavior.
  • Commands, defaults, and public interfaces are consistent.
  • Shared logs and examples contain no credentials or private data.
  • Documentation-only item is inapplicable because this PR adds code and tests.
  • Independent post-PR audit verified the stacked diff and reported metrics. GPT-6 Astra reproduced the early-error issue and independently verified the fix and regression test.

This branch has not been deployed

No deployments
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

0