opencode-commit-guard 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -61,15 +61,25 @@ You can also specify custom configuration options:
61
61
  Call `commit_context` before your first commit in each session and worktree.
62
62
  If the Git repository is in a subdirectory or differs from the project root, specify `workdir` (e.g., `commit_context({ workdir: "my-repo" })`).
63
63
  If `workdir` is omitted and the project root is not a Git repository, the plugin automatically selects the repository if exactly one exists, or lists available repositories if multiple are present.
64
- Run the returned command through the foreground `shell` tool with the indicated workdir.
65
- Call `commit_context` again to read concise guidance.
66
- Repeat the same `workdir` on each call when you select a repository explicitly.
64
+ Run the returned command immediately, unchanged, through the foreground `shell` tool with the indicated workdir and `background:false`.
65
+ Do not wrap it or chain another command onto it.
66
+ Commit after the shell result reports `Frozen commit baseline` and follow its commit rules.
67
+ If the result lacks that report, call `commit_context` again with the same workdir for status and next steps.
68
+ A second call is optional after inline success.
69
+ Repeat an explicit `workdir` when you check that checkout.
67
70
  An argument-free call selects the session directory when it is inside a Git repository, even after an explicit selection.
68
71
  If the shell result lacks a verified successful process exit, capture again instead of using a partial baseline.
69
- The command writes full historical messages to a private file and prints only a fixed receipt.
72
+ The command writes full historical messages to a private file and prints a fixed receipt.
73
+ The plugin appends the capture outcome and commit rules to the shell result.
74
+ `RECEIPT_OK` confirms only that the artifact was written, not that the baseline was published.
75
+ The next context call reports whether a capture is unclaimed, awaiting permission or execution, expired, or failed.
76
+ Run an unclaimed command within 20 seconds; a claimed capture does not expire during permission approval.
77
+ Expired unclaimed captures release their private files on later context or tool calls.
70
78
  The plugin does not put complete historical messages into tool results or model context.
71
79
  Set `refresh: true` after a branch switch, a signing setting change, or a change to commit instructions.
72
80
  A failed refresh does not restore the previous baseline.
81
+ Calls from the checkout root and its subdirectories share one baseline and refresh state.
82
+ Run each capture from its exact indicated workdir.
73
83
  An external Git configuration change or checkout replacement at the same path is not detected until you refresh.
74
84
  Remote workspaces are unsupported.
75
85
  Historical scopes are observations, not allowed scopes or policy.
@@ -98,17 +108,23 @@ The plugin rejects subject lines that omit the colon, leave the scope empty, or
98
108
 
99
109
  When `allowedScopes` contains values, the extracted scope must match an entry in the list.
100
110
  For conventional commits such as `feat(parser): ...`, the plugin accepts either the inner scope (`parser`), the full scope token (`feat(parser)`), or the type prefix (`feat`).
111
+ Each configured entry must match the scope syntax; spaces and characters such as `@` are invalid.
101
112
 
102
113
  ### 3. Maximum line length (`maxLineLength`)
103
114
 
104
115
  No line in the commit subject or body may exceed the configured character limit (default 72 characters).
105
116
  When a line exceeds this limit, the error identifies the exact line number, current character length, and offending text.
117
+ Each `-m` supplies a paragraph, not automatic line wrapping.
118
+ Wrap with real newlines inside `$'...'`; `"\n"` inside double quotes remains literal.
106
119
 
107
120
  ### 4. Signoff
108
121
 
109
122
  When the captured effective `commit.gpgsign` is `true`, every commit with a supplied message must include a signoff indicator.
110
123
  When it is `false` or unset, signoff is not required.
111
- An invalid or missing signing snapshot blocks the commit until you capture context again.
124
+ A missing signing snapshot blocks the commit until you capture context.
125
+ An invalid signing setting requires a configuration repair, not repeated capture.
126
+ Inspect it with `git config --show-origin --get-all commit.gpgsign` (or `user.signingkey`).
127
+ Fix the value without changing the intended signing policy, then call `commit_context({ refresh: true })`.
112
128
  You can provide this either via flags or directly in the message body:
113
129
 
114
130
  - Pass `-s` or `--signoff` in the git command.
@@ -139,6 +155,18 @@ EOF
139
155
 
140
156
  The plugin rejects file-backed `-F` or `--file` messages without reading the files.
141
157
  It also rejects unquoted or ambiguous standard-input sources.
158
+ Supply the final message literally; message words containing shell expansion are rejected without evaluation.
159
+ Single quotes and ANSI-C quotes (`$'...'`) supply literal text.
160
+ The parser inspects commits inside command substitutions, backticks, and literal `bash`, `sh`, or `zsh` `-c` bodies.
161
+ Use simple double-quoted parameters such as `"${HOME}"`; nested quoting, escapes, and expansions inside these parameters are rejected.
162
+ Run `case` commands outside command substitutions; the parser rejects their ambiguous parentheses.
163
+ Run function and `coproc` declarations outside command substitutions; their compound bodies are rejected there.
164
+ Use `bash -c` or `zsh -c` instead of `sh -c` for bodies containing `$'` quoting; the guard rejects this nonportable syntax under `sh`.
165
+ Unquoted heredoc delimiters match after backslash-newline continuations are removed; quote the delimiter to preserve literal body text.
166
+ Run Git directly if a shell body is dynamic or cannot be parsed reliably.
167
+ Put trailers in the literal message body or use `-s`; `--trailer` is rejected.
168
+ The guard resolves the signing baseline before reporting message-format violations.
169
+ `git commit --help` and `git commit -h` do not require a baseline.
142
170
 
143
171
  ## Development
144
172