Skip to content

fix: mode constant, README accuracy, SOUL.md Hermes warning#23

Open
TeoSlayer wants to merge 4 commits into
mainfrom
chore/repo-rename-teoslayer-to-pilot-protocol
Open

fix: mode constant, README accuracy, SOUL.md Hermes warning#23
TeoSlayer wants to merge 4 commits into
mainfrom
chore/repo-rename-teoslayer-to-pilot-protocol

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

Summary

  • config.goGetMode() always returned ModeAuto as a fallback, making defaultMode = ModeManual a dead constant. Fixed all three fallback returns to use defaultMode.
  • README.md — Usage section documented a Reconcile() function that does not exist. Updated to show the real public API: Run, Tick, and ForceTick.
  • skillinject.go — Added slog.Warn at the SOUL.md heartbeat write path calling out that gateway-mode Hermes ignores this file (issue #26596), so the write is a no-op for gateway users.
  • manifest.go — Added // TODO: update to pilot-protocol/pilot-skills once that repo is transferred from TeoSlayer. above both URL constants. Values are unchanged (repo returns 404).
  • plugin_allowlist.goclassifyPluginAllowList conflated all os.ReadFile errors into StateDrifted. Now os.IsNotExistStateDrifted (create the file); permission-denied / other I/O errors → StateIdentical (skip merge, do not overwrite an unreadable config).

Test plan

  • GOWORK=off go build ./... passes (verified locally)
  • GetMode unit test: confirm that a missing config file returns ModeManual, not ModeAuto
  • classifyPluginAllowList test: confirm permission-denied error returns StateIdentical
  • README usage block compiles when pasted into a main.go alongside the package

🤖 Generated with Claude Code

teovl and others added 2 commits June 19, 2026 09:30
…ndling

- config.go: GetMode() now falls back to defaultMode (ModeManual) instead
  of always returning ModeAuto when no config exists; the constant was
  declared but never used as a fallback.
- README.md: replace non-existent Reconcile() in usage example with the
  real public API: Run, Tick, and ForceTick.
- skillinject.go: add slog.Warn at SOUL.md write path noting that
  gateway-mode Hermes ignores the file (issue #26596).
- manifest.go: add TODO comments above DefaultManifestURL and
  DefaultRepoBaseURL pointing to the future pilot-protocol/pilot-skills
  repo (values unchanged — repo does not exist yet).
- plugin_allowlist.go: classifyPluginAllowList now distinguishes
  os.IsNotExist (StateDrifted — create the file) from permission-denied
  and other I/O errors (StateIdentical — skip merge, don't overwrite an
  unreadable config).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@TeoSlayer

Copy link
Copy Markdown
Contributor Author

CI is failing (test), and the mode-constant change is flagged as silently disabling the live ticker.

Recommendation: confirm the ticker stays enabled (or gate the new behaviour behind an explicit flag) and get the test green before merging.

Revert two backward-incompatible behaviour changes that broke CI:

- config.go: GetMode again defaults to ModeAuto when no skill_inject
  flag is present (or the config is unreadable/unparseable). The
  previous change to defaultMode (ModeManual) silently disabled the
  15-minute reconcile ticker for every existing install with no flag
  set, since Run() returns early for manual/disabled mode. New installs
  still get manual mode via the daemon's explicit SetMode startup path.
  Fixes TestGetMode_EmptyDefaultsAuto.

- plugin_allowlist.go: classifyPluginAllowList returns StateDrifted for
  any non-IsNotExist read error (permission denied, path is a directory)
  instead of StateIdentical. StateDrifted routes through
  mergePluginAllowList, which re-reads and surfaces the failure as an
  explicit ActionError; StateIdentical silently swallowed it as a no-op.
  mergePluginAllowList never overwrites an unreadable file, so the
  config is not at risk. Fixes TestClassifyPluginAllowList_PathIsDirectory.
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

3 participants