Skip to content

[AUTOMATION] feat: clean up internal canonical paths#287

Open
michiosw wants to merge 1 commit into
mainfrom
feat/cleanup-internal-canonical-paths
Open

[AUTOMATION] feat: clean up internal canonical paths#287
michiosw wants to merge 1 commit into
mainfrom
feat/cleanup-internal-canonical-paths

Conversation

@michiosw

Copy link
Copy Markdown
Contributor

Summary

This cleans up internal canonical paths by deleting dead wrapper entry points and reusing shared decision and timestamp helpers.

Before this, duplicate constructors and parser/type aliases lived in internal/guard/app/server, internal/managedstream, internal/guard/store/sqlite, internal/hook, and internal/run, which made internal ownership harder to reason about and easier to drift.

Now one canonical internal path owns each helper:

internal callers
-> canonical server constructor / decision type / ledger timestamp parser
-> reused by managed stream and hook code
-> less duplicate internal surface

Why

This gives kontext-cli a cleaner maintenance path for internal runtime plumbing:

internal callers
-> canonical internal helper
-> one implementation
-> less drift

This PR does not broaden behavior beyond the cleanup scope.

What changed

Removed unused Guard server wrapper constructors and the unused hosted run alias
Consolidated the hook decision type onto the canonical guard decision type
Reused the SQLite ledger timestamp parser from managed stream
Updated tests for the managed stream timestamp parser and Guard server helpers

Verification

go test ./internal/run ./internal/hook ./internal/guard/store/sqlite ./internal/managedstream ./internal/guard/app/server
go test ./...
git diff --check

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR consolidates internal helper ownership and removes duplicate wrapper entry points. The main changes are:

  • Deleted unused Guard server and risk policy wrapper constructors.
  • Reused the canonical SQLite ledger timestamp parser from managed stream code.
  • Moved hook decisions onto the shared Guard decision type.
  • Removed the historical hosted run alias in favor of StartManaged.
  • Updated related server and managed stream tests.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Reviews (1): Last reviewed commit: "feat: clean up internal canonical paths" | Re-trigger Greptile

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