Skip to content

feat: refactor script_fix to white-hat mission with _system verification#14

Merged
jscriptcoder merged 6 commits intomainfrom
feat/script-fix-whitehat
Mar 28, 2026
Merged

feat: refactor script_fix to white-hat mission with _system verification#14
jscriptcoder merged 6 commits intomainfrom
feat/script-fix-whitehat

Conversation

@jscriptcoder
Copy link
Copy Markdown
Owner

@jscriptcoder jscriptcoder commented Mar 28, 2026

Summary

  • Refactors script_fix missions from adversarial to white-hat (authorized contractor, like forensics)
  • SSH entry forced, root password provided in briefing
  • Replaces _decode with _system verification — mail runs the script to check correctness
  • No ACCESS-KEY exchange — player sends "done" to complete

Changes

  • src/utils/scriptRunner.ts — New lightweight script runner for mail verification (sandboxed new Function() with _system capture)
  • src/generation/pools/scriptFix.ts — All 63 echo(_decode(...)) calls replaced with _system(...)
  • src/commands/node.ts — Added getSystemFn support alongside existing getDecodeFn
  • src/hooks/useCommands.ts_system injected for script_fix, _decode preserved for script_auto
  • src/generation/attackChain.ts — Removed ACCESS-KEY generation, added root password to briefing
  • src/generation/generateMission.ts — SSH entry forced for script_fix (like forensics)
  • src/commands/mail.ts — New verifyScriptFix reads and executes script, checks _system value; content now optional for state-check missions
  • src/commands/accept.ts — Updated briefing hint (no ACCESS-KEY mention)
  • src/mission/missionBoard.ts — White-hat framing for DKC-003, DKC-009, DKC-013; seeds updated to SSH entry

Test plan

  • Script runner unit tests (correct capture, syntax errors, runtime errors, no-op echo)
  • Node _system() injection tests (PASS/FAIL feedback, undefined when not provided)
  • Mail verification tests (correct script, wrong output, missing file, syntax error, no _system call, optional content)
  • Generation tests (SSH entry forced, root password in description, _system in content, no expectedProof)
  • Accept briefing tests (root password shown, "done" example)
  • All 1917 tests passing, lint clean, build clean

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
jshack-me Ready Ready Preview, Comment Mar 28, 2026 5:54pm

script_fix missions are now authorized contractor missions (like forensics):
- SSH entry forced, root password provided in briefing
- Scripts use _system() instead of echo(_decode()) for verification
- _system() gives PASS/FAIL feedback when player tests with node()
- mail() re-executes the script to verify _system() was called correctly
- No ACCESS-KEY exchange — player sends "done" to complete
- Mail content is optional for script_fix (and other state-check missions)
- Mission board descriptions updated to white-hat framing
- _decode() preserved for script_auto (future PR will convert it)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jscriptcoder jscriptcoder changed the title plan: refactor script_fix to white-hat mission feat: refactor script_fix to white-hat mission with _system verification Mar 28, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No players exist yet, so no backwards compatibility concern with
changing the PRNG sequence for script_fix seeds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix completion table: script_fix sends "done", not ACCESS-KEY
- Remove misleading "Same verification as script_fix" from script_auto description

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jscriptcoder jscriptcoder merged commit e368733 into main Mar 28, 2026
2 checks passed
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