opencode-commit-guard 1.0.7 → 1.1.0
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 +22 -8
- package/dist/index.js +1510 -953
- package/package.json +31 -29
- package/index.ts +0 -1
- package/src/capture.ts +0 -415
- package/src/config.ts +0 -78
- package/src/plugin.ts +0 -418
- package/src/scope.ts +0 -1
- package/src/shell.ts +0 -1159
- package/src/types.ts +0 -67
- package/src/validator.ts +0 -197
package/README.md
CHANGED
|
@@ -50,11 +50,11 @@ You can also specify custom configuration options:
|
|
|
50
50
|
|
|
51
51
|
## Configuration options
|
|
52
52
|
|
|
53
|
-
| Option
|
|
54
|
-
|
|
55
|
-
| `requireScope`
|
|
56
|
-
| `allowedScopes` | `string[]` | `undefined` | Restricts allowed scope identifiers to a specified list.
|
|
57
|
-
| `maxLineLength` | `number`
|
|
53
|
+
| Option | Type | Default | Description |
|
|
54
|
+
| --------------- | ---------- | ----------- | -------------------------------------------------------------------------------- |
|
|
55
|
+
| `requireScope` | `boolean` | `true` | Requires the first line to match `<scope>: <subject>`. |
|
|
56
|
+
| `allowedScopes` | `string[]` | `undefined` | Restricts allowed scope identifiers to a specified list. |
|
|
57
|
+
| `maxLineLength` | `number` | `72` | Limits every line in the subject and body to this length. Set to `0` to disable. |
|
|
58
58
|
|
|
59
59
|
## Capture commit context
|
|
60
60
|
|
|
@@ -70,6 +70,9 @@ Repeat an explicit `workdir` when you check that checkout.
|
|
|
70
70
|
An argument-free call selects the session directory when it is inside a Git repository, even after an explicit selection.
|
|
71
71
|
If the shell result lacks a verified successful process exit, capture again instead of using a partial baseline.
|
|
72
72
|
The command writes full historical messages to a private file and prints a fixed receipt.
|
|
73
|
+
On Linux and macOS, capture uses Bash, portable `base64`, and a 15-second process-group watchdog.
|
|
74
|
+
On Windows, capture uses Windows PowerShell through an encoded command that you can run from PowerShell, `pwsh`, `cmd.exe`, or Git Bash.
|
|
75
|
+
Both capture paths limit the artifact to 256 KiB and preserve NUL-delimited Git history.
|
|
73
76
|
The plugin appends the capture outcome and commit rules to the shell result.
|
|
74
77
|
`RECEIPT_OK` confirms only that the artifact was written, not that the baseline was published.
|
|
75
78
|
The next context call reports whether a capture is unclaimed, awaiting permission or execution, expired, or failed.
|
|
@@ -158,16 +161,27 @@ It also rejects unquoted or ambiguous standard-input sources.
|
|
|
158
161
|
Supply the final message literally; message words containing shell expansion are rejected without evaluation.
|
|
159
162
|
Single quotes and ANSI-C quotes (`$'...'`) supply literal text.
|
|
160
163
|
The parser inspects commits inside command substitutions, backticks, and literal `bash`, `sh`, or `zsh` `-c` bodies.
|
|
161
|
-
|
|
162
|
-
Run
|
|
164
|
+
Double-quoted parameters support nested defaults and quotes, such as `"${VAR:-"default"}"`, but remain expansions rather than literal message text.
|
|
165
|
+
Run command substitutions and backticks outside these parameters; the parser rejects executable substitutions inside them.
|
|
166
|
+
Command substitutions support command-position `case` branches, optional leading pattern parentheses, and `;;`, `;&`, and `;;&` terminators.
|
|
167
|
+
The guard also validates commits inside those branches.
|
|
163
168
|
Run function and `coproc` declarations outside command substitutions; their compound bodies are rejected there.
|
|
164
169
|
Use `bash -c` or `zsh -c` instead of `sh -c` for bodies containing `$'` quoting; the guard rejects this nonportable syntax under `sh`.
|
|
165
170
|
Unquoted heredoc delimiters match after backslash-newline continuations are removed; quote the delimiter to preserve literal body text.
|
|
166
|
-
|
|
171
|
+
Use a literal shell body if expansion can change its executable words.
|
|
172
|
+
Both `bash -c "$SCRIPT"` and `bash -c "FOO=$BAR pytest"` fail closed because expansion can introduce executable commands.
|
|
173
|
+
Parser failures identify pre-execution shell inspection with a `[commit-guard]` prefix.
|
|
174
|
+
Simplify unsupported syntax or quote literal text; run Git directly when committing.
|
|
167
175
|
Put trailers in the literal message body or use `-s`; `--trailer` is rejected.
|
|
168
176
|
The guard resolves the signing baseline before reporting message-format violations.
|
|
169
177
|
`git commit --help` and `git commit -h` do not require a baseline.
|
|
170
178
|
|
|
179
|
+
### Code Mode boundary
|
|
180
|
+
|
|
181
|
+
The `commit_context` tool remains available through Code Mode.
|
|
182
|
+
The OC-1 proposal to exclude it with `codemode: false` is deferred and is not implemented.
|
|
183
|
+
Require the same verified foreground shell result and `Frozen commit baseline` report regardless of how you call the tool.
|
|
184
|
+
|
|
171
185
|
## Development
|
|
172
186
|
|
|
173
187
|
Use Bun for all repository operations.
|