Skip to content

Add Codex-first Nightshift runner#1

Merged
fazxes merged 3 commits intomainfrom
feat/codex-nightshift-runner
Apr 3, 2026
Merged

Add Codex-first Nightshift runner#1
fazxes merged 3 commits intomainfrom
feat/codex-nightshift-runner

Conversation

@HarshyChoc
Copy link
Copy Markdown
Collaborator

Summary

  • replace the Claude-only shell flow with a Codex-first Python orchestrator
  • add runner-enforced guard rails, schema-backed cycle output, and machine-readable shift state
  • update install/docs paths for Codex support while keeping Claude as a compatibility path
  • harden the runner based on live tmux validation: stale worktree recovery, bundled schema lookup, stdin closure, bootstrap shift-log commit, safe artifact cleanup, and more forgiving cycle timeouts

Testing

  • python3 -m py_compile nightshift.py
  • bash -n run.sh
  • bash -n test.sh
  • bash -n install.sh
  • ./run.sh --dry-run
  • ./test.sh --dry-run
  • real tmux sample-repo validation with committed build
  • real tmux large-repo validation against Reclip-Reposter-Hub copy (accepted log_only run with passing runner verification)

Notes

  • main was not pushed; this PR is opened from feat/codex-nightshift-runner
  • large-repo tmux validation surfaced a high-severity logged issue in the target repo: shared route error handling currently downgrades uncategorized backend failures to HTTP 400

What: replace the Claude-only shell flow with a Codex-first orchestrator and runner-enforced guard rails

Fix: add a Python control plane, schema-backed cycle output, worktree verification, and updated install/docs paths
What: large-repo tmux testing showed repo-wide npm test inside Codex sandbox can fail even when runner verification passes

Fix: instruct the agent to rely on runner baseline/final verification and only run narrow local checks when needed
What: large-repo tmux validation showed Codex could complete edits and targeted checks but still be killed before final JSON and commit bookkeeping

Fix: make the runner timeout more forgiving so real repo cycles can finish while still staying bounded
@fazxes fazxes merged commit 5ab1405 into main Apr 3, 2026
fazxes added a commit that referenced this pull request Apr 5, 2026
All 3 looping daemons now:
1. Re-source lib-agent.sh every loop iteration (picks up new functions)
2. Self-restart via exec when daemon.sh changes (md5 hash comparison)

Agent can modify shell scripts during a session and changes take effect
next iteration automatically. Eliminates the #1 cause of lost autonomy.
fazxes added a commit that referenced this pull request Apr 7, 2026
fazxes added a commit that referenced this pull request Apr 7, 2026
fazxes added a commit that referenced this pull request Apr 8, 2026
fazxes added a commit that referenced this pull request Apr 8, 2026
fazxes added a commit that referenced this pull request Apr 8, 2026
fazxes added a commit that referenced this pull request Apr 9, 2026
fazxes added a commit that referenced this pull request Apr 9, 2026
fazxes added a commit that referenced this pull request Apr 9, 2026
Quality audit findings and fixes (18 sessions since last audit):

1. OPERATIONS.md: test count 915 -> 1156 (stale by 241 tests)
2. OPERATIONS.md: add v0.0.7 and v0.0.8 version milestones (both missing)
3. OPERATIONS.md + CLAUDE.md: sync dependency flows -- both were divergent;
   add owl/eval_runner; correct settings/eval_targets ordering
4. DAEMON.md: arg 2 was "pause seconds" but daemon uses it as duration_hours
5. DAEMON.md: remove hardcoded absolute paths (/Users/no9labs/...) with wrong
   .recursive placement; replace with relative paths
6. DAEMON.md: remove stale pentest log references (v1 artifact, files don't exist)
7. ROLE-SCORING.md: add pentest_framework_tasks and sessions_since_eval signals
   (both active in pick-role.py since sessions #109 and #124 respectively)
8. sessions/index.md: fix corrupted role field in session 20260409-020609
   (shell injection artifact from regex extractor: .*'"$LOG_FILE"2>/d -> brain)

Tasks created:
- #249: Regenerate MODULE_MAP.md (stale since session #1, shows only 3 modules)
- #250: Fix DAEMON.md cycle lifecycle git commands (shows checkout+clean-fd, actual
         daemon only does fetch+reset)

make check: 1156 tests pass
fazxes added a commit that referenced this pull request Apr 9, 2026
…session #1)

The module-map generator only scanned top-level nightshift/*.py files, missing
all 5 subpackages (core, settings, owl, raven, infra) and 24 of 27 modules.
Fixed _module_paths to scan known subpackage dirs, updated _parse_modules to
use relative path keys (e.g. core/constants), and updated _internal_dependencies
to map nightshift.core.constants -> core/constants for correct dep ordering.
The regenerated MODULE_MAP.md now shows all 27 modules with accurate dependency
order matching the flow documented in CLAUDE.md. Added 5 new tests covering
subpackage discovery, module count, dependency ordering, display format, and
tests/ exclusion.
fazxes added a commit that referenced this pull request Apr 9, 2026
feat: regenerate MODULE_MAP.md (stale since session #1)
fazxes added a commit that referenced this pull request Apr 9, 2026
fazxes added a commit that referenced this pull request Apr 9, 2026
fazxes added a commit that referenced this pull request Apr 9, 2026
fazxes added a commit that referenced this pull request Apr 9, 2026
fazxes added a commit that referenced this pull request Apr 9, 2026
fazxes added a commit that referenced this pull request Apr 9, 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.

2 participants