@yeison.restrepo.r/code-conductor 1.39.2 → 1.40.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 +0 -1
- package/package.json +1 -1
- package/project-template/.claude/commands/cc-implement.md +26 -0
- package/project-template/.claude/commands/cc-init.md +1 -1
- package/project-template/.claude/hooks/pre-tool-use.mjs +3 -1
- package/project-template/.claude/settings.json +1 -1
- package/project-template/CLAUDE.md +2 -0
package/README.md
CHANGED
|
@@ -457,7 +457,6 @@ The backup and temp rules keep the installer's own backups and crash-stranded te
|
|
|
457
457
|
- **`[BUG-057]`, open:** `.claude/memory/project.md` is append-only and the phase commands instruct a full read of it, which collides with Guard 1's 150-line read limit once the file grows; on a long-lived project the read cost rises with project age. Until it is fixed, prune or archive old checkpoint sections by hand when the file gets large.
|
|
458
458
|
- **`[BUG-058]`, open:** the test suite does not pass on a Windows checkout (CRLF checkout of `.mjs` files, `--import` given a bare path, symlink and `chmod` fixtures, `spawnSync('npm')` without a shell), and CI has no Windows leg to show it. Until it is fixed, develop against the suite on Linux/macOS or WSL; the shipped product itself is unaffected.
|
|
459
459
|
- **`[BUG-059]`, open:** the test helper that fakes the `gh` CLI is POSIX-only, so on a Windows machine where the suites load, tests can reach a real, logged-in `gh` and perform live GitHub writes. Until it is fixed, do not run `npm test` on Windows while authenticated to `gh`, or log out (`gh auth logout`) first.
|
|
460
|
-
- **`[BUG-061]`, open:** the PreToolUse hook command is a cwd-relative `node .claude/hooks/pre-tool-use.mjs`, so on Windows nearly every tool call can report a non-blocking `node:internal/modules/cjs/loader` error, and the guards are skipped for that call. Until it is fixed, keep the session's working directory at the project root.
|
|
461
460
|
- **The `P7` false positive** described under [Guard 3, and what it learned](#guard-3-and-what-it-learned), still live.
|
|
462
461
|
- **A re-run against an untouched `project.md` prints a recovery hint it cannot prove is needed.** If you install, never write anything into `.claude/memory/project.md`, and install again, you get a line suggesting the file may have been overwritten by a pre-`1.30.0` re-run. It was not; it equals the stub because it was seeded and never edited. The check compares content and **cannot distinguish "seeded and untouched" from "clobbered"**, which is why the wording is hedged to "may have been" rather than "was". This residual is named and accepted in [`BUG-039`'s spec at `:129`](docs/superpowers/specs/2026-09-27-bug039-installer-host-owned-state-design.md), where the alternative (restoring from the host's own git history) was rejected as writing host files out of the host's history with new failure modes. A **fresh** install is silent, which the Quickstart shows.
|
|
463
462
|
- **Three open dossiers**, which are the evidence-collection pipeline working rather than a backlog: a session denial tally, one for interleaved-artifact reports, and an intermittent commit-hook hang in the `snap-build` suite. A dossier holds specimens until a mechanism is characterized by probe; an id is minted only when the written condition is met. `[BUG-047]` is what that pipeline produces when it completes: an out-of-scope note, then a dossier, then four specimens across four sessions, then a mint, then a release.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yeison.restrepo.r/code-conductor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"description": "A governance layer for Claude Code sessions: hooks that check an agent's commands before they run, a spec-first workflow, and project memory the next session reads.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentic-development",
|
|
@@ -112,6 +112,31 @@ Construct `old_string` using the `old_string` construction rule. Use `Edit` to r
|
|
|
112
112
|
|
|
113
113
|
Carry out the task described on that line.
|
|
114
114
|
|
|
115
|
+
### Step 4.5: OWASP Security Scan (post-implement guardrail)
|
|
116
|
+
|
|
117
|
+
**Applies only when Step 4 wrote or edited code files** (`.js`, `.ts`, `.mjs`, `.cjs`, `.py`, `.java`, `.go`, `.rb`, `.php`, `.jsx`, `.tsx`, `.vue`, `.svelte`). Skip this step for markdown, config, documentation, or non-code changes.
|
|
118
|
+
|
|
119
|
+
After executing the task, review every code change you made in Step 4 against the OWASP Top 10. Scan the **diff only** (lines you added or modified), not the entire file:
|
|
120
|
+
|
|
121
|
+
| ID | Category | What to flag |
|
|
122
|
+
|----|----------|-------------|
|
|
123
|
+
| A01 | Broken Access Control | Missing auth/authz checks on new endpoints, CORS set to `*`, exposed admin routes without middleware |
|
|
124
|
+
| A02 | Cryptographic Failures | Hardcoded secrets/tokens/passwords/API keys, `MD5`/`SHA1` for password hashing, `http://` for sensitive data, encryption keys in source |
|
|
125
|
+
| A03 | Injection | String concatenation in SQL/NoSQL queries, unsanitized `eval()`, `exec()`, `Function()`, template literals in shell commands, raw user input in queries |
|
|
126
|
+
| A04 | Insecure Design | Missing input validation at system boundaries (user input, API params), no length/type checks on untrusted data |
|
|
127
|
+
| A05 | Security Misconfiguration | `debug: true` or `DEBUG=*` in production config, default credentials, stack traces exposed to client, verbose error messages with internal paths |
|
|
128
|
+
| A06 | Vulnerable Components | _(deferred — not scannable from diff)_ |
|
|
129
|
+
| A07 | Auth Failures | Session tokens in URLs or query strings, missing brute-force protection on login, weak password validation |
|
|
130
|
+
| A08 | Data Integrity | `dangerouslySetInnerHTML` without sanitization, `innerHTML` assignment from user input, `JSON.parse()` / deserialization of untrusted data without validation |
|
|
131
|
+
| A09 | Logging Failures | Secrets, tokens, or passwords in log statements, PII logged in plaintext |
|
|
132
|
+
| A10 | SSRF | User-controlled URLs passed directly to `fetch`/`axios`/`http.get` without allowlist validation |
|
|
133
|
+
|
|
134
|
+
**Behavior:**
|
|
135
|
+
|
|
136
|
+
- **Finding detected:** emit `[SECURITY] file:line — A0X: one-sentence description` for each finding. Fix all findings immediately, re-scan the fixed lines, and proceed to Step 5 only when the re-scan is clean.
|
|
137
|
+
- **Finding unresolved:** if a finding cannot be fixed without changing the task's scope, do not proceed. Take the Step 5 failure path (`[>]` → `[!]`), run Step 6, then halt with `SECURITY_FINDING_UNRESOLVED`, re-emitting each open `[SECURITY]` line. The halt escalates to human review: the loop stays stopped until the developer resolves the finding and resets the task to `[ ]`.
|
|
138
|
+
- **Clean:** silent — no output, proceed directly to Step 5.
|
|
139
|
+
|
|
115
140
|
### Step 5: Post-flip
|
|
116
141
|
|
|
117
142
|
Construct `old_string` from the pre-flip line with `[ ]` replaced by `[>]` (the state after Step 3). Apply the `old_string` construction rule. Use `Edit` to replace:
|
|
@@ -154,6 +179,7 @@ After the hook: if the task state is `[!]`, halt with the failure report from St
|
|
|
154
179
|
| Pre-flip Edit no-match >= 3 (same task) | Mark `[!]`, halt |
|
|
155
180
|
| Post-flip Edit no-match | Halt; manual resolution |
|
|
156
181
|
| Task execution failure | Mark `[>]` → `[!]`, halt |
|
|
182
|
+
| Unfixable OWASP finding (Step 4.5) | Mark `[>]` → `[!]`, halt; `SECURITY_FINDING_UNRESOLVED`; report open `[SECURITY]` lines |
|
|
157
183
|
| Hook write failure | Log warning, continue |
|
|
158
184
|
| `[>]` prerequisite | Halt; `PREREQUISITE_IN_PROGRESS`; report task ID |
|
|
159
185
|
| `DEPENDENCY_FAILED` | Halt; report failed prerequisite |
|
|
@@ -86,7 +86,7 @@ Run `/cc-checkpoint`. Persist current architectural state to `.claude/memory/pro
|
|
|
86
86
|
|
|
87
87
|
## Step 5 — Hook integrity check
|
|
88
88
|
|
|
89
|
-
Verify `.claude/hooks/pre-tool-use.mjs` exists. It is
|
|
89
|
+
Verify `.claude/hooks/pre-tool-use.mjs` exists. It is loaded by `node` through the PreToolUse command in `.claude/settings.json`, so it needs no execute bit:
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
92
|
HOOK=".claude/hooks/pre-tool-use.mjs"
|
|
@@ -622,10 +622,12 @@ const G3_CHECKS = [
|
|
|
622
622
|
// Present-but-unreadable means an empty list PLUS a debug line, because that is a
|
|
623
623
|
// fault worth seeing, and neither condition may throw: a permissions problem on a
|
|
624
624
|
// policy file must never escalate into denying every tool call in the session.
|
|
625
|
+
// The root is CLAUDE_PROJECT_DIR because the session's cwd drifts; cwd is only the
|
|
626
|
+
// fallback for a launcher that does not set it (BUG-061).
|
|
625
627
|
function g3ReadAllowlist() {
|
|
626
628
|
let raw;
|
|
627
629
|
try {
|
|
628
|
-
raw = readFileSync(join(process.cwd(), ...G3_ALLOWLIST_REL), 'utf8');
|
|
630
|
+
raw = readFileSync(join(process.env.CLAUDE_PROJECT_DIR || process.cwd(), ...G3_ALLOWLIST_REL), 'utf8');
|
|
629
631
|
} catch (e) {
|
|
630
632
|
if (e.code !== 'ENOENT') debug(`guard 3 allowlist unreadable: ${e.message}`);
|
|
631
633
|
return [];
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "node .claude/hooks/pre-tool-use.mjs"
|
|
9
|
+
"command": "node --input-type=commonjs -e \"import(require('url').pathToFileURL(require('path').resolve(process.env.CLAUDE_PROJECT_DIR||'.','.claude/hooks/pre-tool-use.mjs')).href)\""
|
|
10
10
|
}
|
|
11
11
|
]
|
|
12
12
|
}
|
|
@@ -87,6 +87,7 @@ After modifying any method, variable, class, or component:
|
|
|
87
87
|
| [TESTS] | Omitted in MIN mode — test files affected or written |
|
|
88
88
|
| [BUG] | Always when a bug is found — format: `file:line — one-sentence description`. Never suppressed, including in MIN mode. |
|
|
89
89
|
| [VALIDATION] | After implementation tasks only — edge cases, risks, justification |
|
|
90
|
+
| [SECURITY] | Always when OWASP finding detected — format: `file:line — A0X: description`. Never suppressed; an unfixable finding halts with `SECURITY_FINDING_UNRESOLVED` |
|
|
90
91
|
|
|
91
92
|
## Verbosity Protocol
|
|
92
93
|
VERBOSITY: MIN (default)
|
|
@@ -94,6 +95,7 @@ VERBOSITY: MIN (default)
|
|
|
94
95
|
- [CHANGES] tag: modified file list only.
|
|
95
96
|
- [VALIDATION] tag: included after implementation tasks only (code changes, file rewrites, behavioral modifications); condensed to exactly three lines — one each for: edge cases covered, residual risks, justification. Omitted entirely for non-implementation tasks (file deletions, config-only chores, maintenance commits, pure documentation edits).
|
|
96
97
|
- [BUG] tag: always included in MIN mode when a bug is found; format: `[BUG] file:line — one-sentence description`. Never suppressed.
|
|
98
|
+
- [SECURITY] tag: always included in MIN mode when an OWASP finding is detected; format: `[SECURITY] file:line — A0X: one-sentence description`. Never suppressed.
|
|
97
99
|
- All other tags ([REASON], [PLAN], [DEPS], [TESTS]) are omitted in MIN mode.
|
|
98
100
|
- Ambiguity: one clarifying question, nothing else.
|
|
99
101
|
|