diff --git a/Installation.md b/Installation.md index f21e4fb..45fd750 100644 --- a/Installation.md +++ b/Installation.md @@ -46,8 +46,8 @@ Requires [Rust](https://rustup.rs) (stable). ```sh git clone https://github.com/polyhook/steplock.git cd steplock -cargo build --release -mv target/release/steplock /usr/local/bin/ +cargo build --release --manifest-path core/Cargo.toml +mv core/target/release/steplock /usr/local/bin/ ``` ### Package managers diff --git a/core/Architecture.md b/core/Architecture.md index cd08056..08ad732 100644 --- a/core/Architecture.md +++ b/core/Architecture.md @@ -17,9 +17,9 @@ run(event, repo_root) ├─ reset = "always": │ block on initial state, no state file │ - └─ reset = "session" | "branch": + └─ reset = "session": │ - ├── get_scope_key → session-id or branch name + ├── get_scope_key → session-id, or the fallback-id ├── create .steplock/sessions// if absent ├── load state.json (or init from flow.initial) │ @@ -48,11 +48,9 @@ Built from `stateDiagram-v2` Mermaid syntax by `flow::parse_mmd`. Only two const ## Scope key resolution -`get_scope_key` is called for `reset = "session"` and `reset = "branch"`: +`get_scope_key` is called for `reset = "session"`: - **session**: uses `event.session_id` if non-empty; otherwise reads or generates a UUID in `.steplock/sessions/fallback-id`. -- **branch**: reads `.git/HEAD` walking up from the repo root. Falls back to `"unknown-branch"` if no `.git` found. - ## Session state file `.steplock/sessions//state.json` is the single source of truth. steplock writes it (via `save_state`) on each block and on each `steplock step done`; the deprecated `ack.sh` writes it via `jq + mv`. Both use atomic writes to avoid corruption under concurrent agent access. diff --git a/core/README.md b/core/README.md index 11b7664..daf7778 100644 --- a/core/README.md +++ b/core/README.md @@ -7,7 +7,10 @@ Rust library implementing the steplock gate logic. Used by the `steplock` CLI bi | Module | Responsibility | | ------------ | -------------- | | `run` | Entry point — evaluates all checklists and returns `HookResponse` | +| `catalog` | Discovers checklist directories under a checklists dir | +| `gate` | Evaluates one checklist against a hook event | | `config` | Parses `config.toml` (`ChecklistConfig`) | +| `global_config` | Finds the global steplock directory (`global_steplock_dir`) shared by every project | | `flow` | Parses `flow.mmd` into a `FlowGraph` (Mermaid `stateDiagram-v2`) | | `state` | `SessionState` — read/write `state.json` atomically | | `cel_eval` | Evaluates `match_input` CEL expressions against a `HookEvent` |