Skip to content

reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities

docs(02): plan phase — security quoting & supply-chain hygiene

six2dez65253cc388d2
diff --git a/.planning/STATE.md b/.planning/STATE.md
index 78b6f7d..f09a44e 100644
--- a/.planning/STATE.md
+++ b/.planning/STATE.md
@@ -2,16 +2,16 @@
gsd_state_version: 1.0
milestone: v1.0
milestone_name: milestone
-status: planning
+status: executing
stopped_at: Phase 2 context gathered
-last_updated: "2026-05-13T11:46:37.209Z"
-last_activity: 2026-05-13
+last_updated: "2026-05-13T12:09:14.147Z"
+last_activity: 2026-05-13 -- Phase 02 planning complete
progress:
total_phases: 5
completed_phases: 1
- total_plans: 5
+ total_plans: 8
completed_plans: 5
- percent: 100
+ percent: 63
---
# Project State
@@ -27,8 +27,8 @@ See: .planning/PROJECT.md (updated 2026-05-13)
Phase: 2
Plan: Not started
-Status: Ready to plan
-Last activity: 2026-05-13
+Status: Ready to execute
+Last activity: 2026-05-13 -- Phase 02 planning complete
Progress: [░░░░░░░░░░] 0%
diff --git a/.planning/phases/02-security-quoting-supply-chain-hygiene/02-01-PLAN.md b/.planning/phases/02-security-quoting-supply-chain-hygiene/02-01-PLAN.md
new file mode 100644
index 0000000..351a880
--- /dev/null
+++ b/.planning/phases/02-security-quoting-supply-chain-hygiene/02-01-PLAN.md
@@ -0,0 +1,317 @@
+---
+id: 02-01
+phase: 02
+plan: 01
+type: execute
+wave: 1
+depends_on: []
+requirements: [SEC-01]
+files_modified:
+ - lib/common.sh
+ - tests/unit/test_common.bats
+ - tests/integration/test_full_flow.bats
+ - CHANGELOG.md
+ - CLAUDE.md
+ - .planning/codebase/CONVENTIONS.md
+ - .planning/codebase/STRUCTURE.md
+ - .planning/codebase/ARCHITECTURE.md
+autonomous: true
+must_haves:
+ truths:
+ - "D-01: `safe_count()` function definition (lib/common.sh:748-764) and its 17-line block (Usage comment + body) are entirely removed — no deprecation stub, no back-compat wrapper, no zero-caller function left behind"
+ - "D-01: `grep -rn 'safe_count' . --include='*.sh' --include='*.bats'` returns 0 hits after the change (function definition gone, 3 bats tests gone)"
+ - "D-01: `count_lines()` (lib/common.sh:125) and `count_lines_stdin()` (lib/common.sh:136) remain untouched — they are the canonical replacement helpers and are already used by 11 callers in modules/"
+ - "D-02: Two bats `@test` blocks at tests/unit/test_common.bats:253-266 (including the `# safe_count tests` section banner) are deleted as one chunk — they exercise the eval pipeline branch and cannot be ported to `count_lines`"
+ - "D-02: One bats `@test` block at tests/integration/test_full_flow.bats:245-256 (the full-flow `safe_count handles missing files` test) is deleted — `count_lines` is already covered by sibling tests in test_common.bats"
+ - "D-02: After deletion, `bats tests/unit/test_common.bats` and `bats tests/integration/test_full_flow.bats` still succeed (no syntax errors from dangling section headers or orphaned `setup`/`teardown` blocks)"
+ - "D-03: All 5 documentation files referencing `safe_count` (CHANGELOG.md:203, CLAUDE.md:283, .planning/codebase/CONVENTIONS.md:~162-164, .planning/codebase/STRUCTURE.md:18, .planning/codebase/ARCHITECTURE.md:63) are updated in-place to drop the `safe_count` mention or substitute the `count_lines` equivalent"
+ - "D-03: `.planning/PROJECT.md:46` Active bullet for SEC-01 is NOT edited as part of this plan — it is the transition step's responsibility to move from Active → Validated"
+ - "lib/common.sh source-guard `[[ -n \"$_COMMON_SH_LOADED\" ]] && return 0` (line 6) is preserved; the blank line at lib/common.sh:747 and the `# Pipeline Helpers` section divider at lib/common.sh:766 are both preserved (only lines 748-764 are removed)"
+ - "bash syntax check passes on lib/common.sh after deletion — `bash -n lib/common.sh` exits 0"
+ artifacts:
+ - path: "lib/common.sh"
+ provides: "safe_count() function definition removed; count_lines/count_lines_stdin preserved"
+ pattern_absent: "safe_count"
+ - path: "tests/unit/test_common.bats"
+ provides: "safe_count test section + 2 @test blocks removed; surrounding sections intact"
+ pattern_absent: "safe_count"
+ - path: "tests/integration/test_full_flow.bats"
+ provides: "safe_count integration @test block removed"
+ pattern_absent: "safe_count"
+ - path: "CHANGELOG.md"
+ provides: "safe_count reference dropped from line ~203"
+ pattern_absent: "safe_count"
+ - path: "CLAUDE.md"
+ provides: "safe_count reference dropped from line ~283"
+ pattern_absent: "safe_count"
+ - path: ".planning/codebase/CONVENTIONS.md"
+ provides: "safe_count example block retitled or removed at line ~162-164"
+ pattern_absent: "safe_count"
+ - path: ".planning/codebase/STRUCTURE.md"
+ provides: "safe_count reference dropped from common.sh listing at line ~18"
+ pattern_absent: "safe_count"
+ - path: ".planning/codebase/ARCHITECTURE.md"
+ provides: "safe_count reference dropped from Component Responsibilities table at line ~63"
+ pattern_absent: "safe_count"
+ key_links:
+ - from: "callers in modules/*.sh"
+ to: "lib/common.sh count_lines() / count_lines_stdin()"
+ via: "direct file-path or stdin-pipe invocation"
+ pattern: "count_lines"
+---
+
+<objective>
+Delete `safe_count()` from `lib/common.sh` (function body + Usage comment block at :748-764), its 3 bats tests, and 5 doc-file references. Closes SEC-01 by removing the latent `eval` injection vector entirely rather than just trimming its `else` branch.
+
+Purpose: `lib/common.sh:760` runs `eval "$1"` when `$1` is not a file path. Today there are zero live callers in `lib/` or `modules/` (verified via `grep -rn 'safe_count' . --include='*.sh'`); only the function definition itself and 3 bats tests reference it. The ROADMAP success criterion ("else branch is gone") is satisfied trivially by full deletion. Per CONTEXT.md D-01 and CLAUDE.md "if certain something is unused, delete it completely", we delete the whole function rather than leaving a zero-caller surface as a future trap. The 3 bats tests exercise the eval branch via pipeline-string form (`safe_count "cat test.txt"`) and cannot be ported as-is; per D-02 they are deleted because `count_lines` is already covered elsewhere in `test_common.bats`.
+
+Output: 17-line block removed from `lib/common.sh`; 14-line block + 12-line block removed from the two bats files; 5 documentation files updated in-place to drop the `safe_count` mention. Bash and bats syntax remain valid. The replacement helpers `count_lines()` and `count_lines_stdin()` (already living at `lib/common.sh:125` and `:136`) remain untouched.
+</objective>
+
+<execution_context>
+@$HOME/.claude/get-shit-done/workflows/execute-plan.md
+@$HOME/.claude/get-shit-done/templates/summary.md
+</execution_context>
+
+<context>
[email protected]/phases/02-security-quoting-supply-chain-hygiene/02-CONTEXT.md
[email protected]/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md
[email protected]/codebase/CONVENTIONS.md
[email protected]/codebase/CONCERNS.md
+
+<interfaces>
+<!-- Key existing identifiers in lib/common.sh. Extracted from codebase. -->
+
+From lib/common.sh:122-140 (REPLACEMENT HELPERS — keep untouched):
+```bash
+# Count non-empty lines in a file safely
+# Usage: count_lines filename
+# Returns: line count (0 if file doesn't exist or is empty)
+count_lines() {
+ local file="$1"
+ if [[ -s "$file" ]]; then
+ sed '/^$/d' "$file" | wc -l | tr -d ' '
+ else
+ echo 0
+ fi
+}
+
+# Count lines from stdin, with fallback to 0 on failure
+# Usage: result=$(command | count_lines_stdin)
+count_lines_stdin() {
+ local count
+ count=$(sed '/^$/d' | wc -l | tr -d ' ') || count=0
+ echo "${count:-0}"
+}
+```
+
+From lib/common.sh:748-764 (BLOCK TO DELETE):
+```bash
+# Count non-empty lines in a file safely
+# Usage: NUMOFLINES=$(safe_count "file_path")
+# NUMOFLINES=$(safe_count "command | pipeline") # legacy: still supported via eval
+# Always returns a valid number (0 on failure)
+safe_count() {
+ local result
+ if [[ -f "$1" ]]; then
+ # Safe path: count lines in file directly, no eval
+ result=$(sed '/^$/d' "$1" 2>/dev/null | wc -l | tr -d ' ') || result=0
+ else
+ # Legacy fallback for callers passing pipeline strings
+ # TODO: migrate remaining callers to pass file paths
+ result=$(eval "$1" 2>/dev/null | sed '/^$/d' | wc -l | tr -d ' ') || result=0
+ fi
+ [[ "$result" =~ ^[0-9]+$ ]] || result=0
+ echo "$result"
+}
+```
+
+From tests/unit/test_common.bats:253-266 (BLOCK TO DELETE):
+```bash
+###############################################################################
+# safe_count tests
+###############################################################################
+
+@test "safe_count returns valid number" {
+ printf "line1\nline2\n" > test.txt
+ result=$(safe_count "cat test.txt")
+ [ "$result" -eq 2 ]
+}
+
+@test "safe_count returns 0 on failure" {
+ result=$(safe_count "cat nonexistent_file_xyz.txt")
+ [ "$result" -eq 0 ]
+}
+```
+
+From tests/integration/test_full_flow.bats:245-256 (BLOCK TO DELETE):
+```bash
+@test "full flow: safe_count handles missing files" {
+ source_reconftw
+
+ # shellcheck source=/dev/null
+ source "$SCRIPTPATH/lib/common.sh"
+
+ # Test with non-existent file
+ local count
+ count=$(safe_count "/nonexistent/file.txt")
+ [ "$count" -eq 0 ]
+}
+```
+</interfaces>
+</context>
+
+<tasks>
+
+<task type="auto">
+ <name>Task 1: Delete safe_count() from lib/common.sh + its 3 bats tests</name>
+ <files>lib/common.sh, tests/unit/test_common.bats, tests/integration/test_full_flow.bats</files>
+ <read_first>
+ - lib/common.sh (current state — locate lines 748-764 containing the Usage comment block + function body; confirm the blank line at 747 and the `# Pipeline Helpers` divider at 766 frame the deletion)
+ - lib/common.sh:122-140 (the `count_lines` / `count_lines_stdin` replacement helpers — must remain untouched)
+ - tests/unit/test_common.bats:253-266 (the `safe_count tests` section header + 2 `@test` blocks; locate the trailing blank line before line 267 to determine the exact end-of-block)
+ - tests/integration/test_full_flow.bats:245-256 (the `full flow: safe_count handles missing files` test; check siblings at :234-243 and :257+ for the surrounding blank-line spacing pattern)
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-CONTEXT.md sections "D-01" and "D-02"
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md sections "lib/common.sh:748-764", "tests/unit/test_common.bats:253-266", "tests/integration/test_full_flow.bats:245-256"
+ </read_first>
+ <action>
+ Per D-01: in lib/common.sh, delete the 17-line block from line 748 through line 764 inclusive — that block contains the 4-line Usage comment (`# Count non-empty lines in a file safely` / `# Usage: NUMOFLINES=...` / `# NUMOFLINES=...` / `# Always returns a valid number...`) followed by the `safe_count()` function body (`safe_count() { ... }`) and its closing `}` brace. Preserve the blank line at line 747 (separator between `run_with_heartbeat_shell` end and the `safe_count` doc comment) AND preserve the section divider beginning at line 766 (`###############################################################################` followed by `# Pipeline Helpers`). The source-guard at line 6 (`[[ -n "$_COMMON_SH_LOADED" ]] && return 0`) is untouched.
+
+ Per D-02: in tests/unit/test_common.bats, delete the entire 14-line block from line 253 through line 266 inclusive — that comprises the 3-line section banner (`#####...`, `# safe_count tests`, `#####...`), a blank line, two `@test` blocks (`safe_count returns valid number`, `safe_count returns 0 on failure`), and the trailing blank line before line 267 (`# process_results tests` banner). Do NOT leave a dangling section header.
+
+ Per D-02: in tests/integration/test_full_flow.bats, delete the entire 12-line block from line 245 through line 256 inclusive — that is the `@test "full flow: safe_count handles missing files" { ... }` block plus the blank line that follows. Sibling `@test` blocks at :234-243 and :257+ remain untouched.
+
+ Do NOT port the deleted tests to `count_lines`-form: per CONTEXT.md D-02, `count_lines` is already covered by sibling tests in test_common.bats, so porting would add no new coverage.
+ </action>
+ <verify>
+ <automated>bash -n lib/common.sh && grep -rn 'safe_count' lib/ modules/ tests/ --include='*.sh' --include='*.bats' | wc -l | tr -d ' '</automated>
+ </verify>
+ <acceptance_criteria>
+ - `bash -n lib/common.sh` exits 0 (no syntax error from incomplete deletion)
+ - `grep -rn 'safe_count' lib/ modules/ tests/ --include='*.sh' --include='*.bats' | wc -l | tr -d ' '` returns `0`
+ - `grep -n 'safe_count' lib/common.sh` returns 0 hits
+ - `grep -n 'safe_count' tests/unit/test_common.bats` returns 0 hits
+ - `grep -n 'safe_count' tests/integration/test_full_flow.bats` returns 0 hits
+ - `grep -n '# Pipeline Helpers' lib/common.sh` returns exactly 1 hit (the section divider after the deleted block is preserved)
+ - `grep -nE '^count_lines\(\)' lib/common.sh` returns 1 hit (the file-path helper at :125 is preserved)
+ - `grep -nE '^count_lines_stdin\(\)' lib/common.sh` returns 1 hit (the stdin helper at :136 is preserved)
+ - `bash -c 'source lib/common.sh; type count_lines >/dev/null && type count_lines_stdin >/dev/null'` exits 0 (helpers still callable post-deletion)
+ - `bats tests/unit/test_common.bats` reports zero "syntax error" / "command not found" output (full pass not required from this task — the deleted tests were the only safe_count callers; remaining tests are unrelated to this change)
+ </acceptance_criteria>
+ <done>
+ lib/common.sh has no `safe_count` definition; tests/unit/test_common.bats has no `# safe_count tests` section and no safe_count `@test`; tests/integration/test_full_flow.bats has no safe_count `@test`; bash syntax intact; replacement helpers `count_lines`/`count_lines_stdin` callable.
+ </done>
+</task>
+
+<task type="auto">
+ <name>Task 2: Update 5 doc files to drop safe_count references</name>
+ <files>CHANGELOG.md, CLAUDE.md, .planning/codebase/CONVENTIONS.md, .planning/codebase/STRUCTURE.md, .planning/codebase/ARCHITECTURE.md</files>
+ <read_first>
+ - CHANGELOG.md (locate the line referencing `count_lines()` / `safe_count()` around line 203)
+ - CLAUDE.md (locate the line in the Architecture / Common section referencing `safe_count` around line 283)
+ - .planning/codebase/CONVENTIONS.md (locate the `**safe_count()** in lib/common.sh` example block around lines 162-164)
+ - .planning/codebase/STRUCTURE.md (locate the `common.sh` directory listing line referencing `safe_count` around line 18)
+ - .planning/codebase/ARCHITECTURE.md (locate the Component Responsibilities table row for `lib/common.sh` around line 63 referencing `safe_count`)
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-CONTEXT.md section "D-03"
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md "Doc reference updates (Plan 02-01 / D-03)" table
+ </read_first>
+ <action>
+ Per D-03 (mechanical text substitution in 5 files; precise per-file edits):
+
+ 1. CHANGELOG.md line ~203 — replace the bullet text `` - `count_lines()`/`safe_count()` `` with `` - `count_lines()` `` (drop the `/safe_count()` slash-paired alternative). If the actual on-disk text differs from this exact form (e.g., spacing variation), preserve the surrounding sentence structure and just remove the `safe_count` token + its separator.
+
+ 2. CLAUDE.md line ~283 — locate the prose mentioning `... count_lines, safe_count, incident tracking ...` and remove `, safe_count` so the list reads `... count_lines, incident tracking ...`.
+
+ 3. .planning/codebase/CONVENTIONS.md around lines 162-164 — the current block reads (per phase patterns):
+ ```
+ **`safe_count()`** in `lib/common.sh` — always returns a valid integer:
+ ```bash
+ NUMOFLINES=$(safe_count "subdomains/subdomains.txt") # preferred: direct file path
+ ```
+ Falls back to `eval` for legacy pipeline strings (marked TODO for migration).
+ ```
+ Replace the entire block with:
+ ```
+ **`count_lines()`** in `lib/common.sh` — counts non-empty lines in a file; returns 0 if missing or empty:
+ ```bash
+ NUMOFLINES=$(count_lines "subdomains/subdomains.txt")
+ ```
+ For stdin-pipe inputs, use `count_lines_stdin` (e.g., `result=$(some_cmd | count_lines_stdin)`).
+ ```
+ Match the existing CONVENTIONS.md heading-style; do not introduce new section banners.
+
+ 4. .planning/codebase/STRUCTURE.md line ~18 — replace `│ ├── common.sh # File/dir helpers, incident tracking, count_lines, safe_count` with `│ ├── common.sh # File/dir helpers, incident tracking, count_lines` (drop `, safe_count`).
+
+ 5. .planning/codebase/ARCHITECTURE.md line ~63 — in the Component Responsibilities table row for `Shared file/counter utilities`, change the responsibility cell from `\`ensure_dirs\`, \`ensure_webs_all\`, \`safe_backup\`, \`count_lines\`, \`safe_count\`, incident tracking` to `\`ensure_dirs\`, \`ensure_webs_all\`, \`safe_backup\`, \`count_lines\`, incident tracking` (drop `, \`safe_count\``).
+
+ Per CONTEXT.md D-03 explicit exclusion: do NOT edit `.planning/PROJECT.md:46` — the SEC-01 Active → Validated transition is the responsibility of the post-phase transition step, not this plan.
+
+ Per CONTEXT.md Claude's Discretion: bundle these 5 edits in the same commit as Task 1, OR split them into a follow-up commit — either is acceptable. Recommend a single commit (`docs(02-01): drop safe_count references`) bundled with Task 1 for atomic remediation.
+ </action>
+ <verify>
+ <automated>grep -c 'safe_count' CHANGELOG.md CLAUDE.md .planning/codebase/CONVENTIONS.md .planning/codebase/STRUCTURE.md .planning/codebase/ARCHITECTURE.md | awk -F: '{sum+=$2} END {print sum}'</automated>
+ </verify>
+ <acceptance_criteria>
+ - `grep -c 'safe_count' CHANGELOG.md CLAUDE.md .planning/codebase/CONVENTIONS.md .planning/codebase/STRUCTURE.md .planning/codebase/ARCHITECTURE.md | awk -F: '{sum+=$2} END {print sum}'` returns `0`
+ - `grep -n 'count_lines' .planning/codebase/STRUCTURE.md` still returns at least 1 hit (the replacement reference is present)
+ - `grep -n 'count_lines' .planning/codebase/ARCHITECTURE.md` still returns at least 1 hit (the replacement reference is present)
+ - `grep -n 'count_lines' CHANGELOG.md` still returns at least 1 hit
+ - `grep -n 'count_lines' .planning/codebase/CONVENTIONS.md` returns at least 1 hit (the replacement block uses `count_lines` as the title)
+ - `grep -n 'safe_count' .planning/PROJECT.md` returns whatever was there before (this plan does NOT edit PROJECT.md — exclusion per D-03)
+ - `grep -rn 'safe_count' . --include='*.md' --exclude-dir=node_modules --exclude-dir=.git | grep -v '/.planning/phases/02-' | wc -l | tr -d ' '` returns `0` (no doc files outside the 02-* phase planning artefacts still reference safe_count)
+ </acceptance_criteria>
+ <done>
+ 5 doc files have zero `safe_count` matches; replacement `count_lines` references are present where appropriate; .planning/PROJECT.md unmodified by this plan.
+ </done>
+</task>
+
+</tasks>
+
+<threat_model>
+## Trust Boundaries
+
+| Boundary | Description |
+|----------|-------------|
+| internal helper → eval | `safe_count()` accepts a string arg; the `else` branch executes the string via `eval` |
+| caller intent → callee form | Callers passed either a file path (safe branch) or a pipeline string (eval branch). Same function signature, two semantically distinct trust postures. |
+
+## STRIDE Threat Register
+
+| Threat ID | Category | Component | Disposition | Mitigation Plan |
+|-----------|----------|-----------|-------------|-----------------|
+| T-02-01-01 | E (Elevation of Privilege) | `safe_count()` eval branch at lib/common.sh:760 | mitigate | Function deletion (D-01) removes the surface entirely. No opt-in, no deprecation stub — the eval branch is gone because the function is gone. |
+| T-02-01-02 | E (Elevation of Privilege) | Future re-introduction of a `safe_count`-shaped helper | mitigate | Doc updates (D-03) remove all 5 references that documented the previous "safe_count is the way" pattern. CONVENTIONS.md now documents `count_lines`/`count_lines_stdin` as the canonical helpers, steering future contributors away from any string-eval shape. |
+| T-02-01-03 | T (Tampering) | bats tests at test_common.bats:253-266 / test_full_flow.bats:245-256 | mitigate | Test deletion (D-02) is required because the tests literally pass pipeline-strings (`safe_count "cat test.txt"`) — keeping them would force the function to remain, blocking remediation. `count_lines` has independent coverage elsewhere in test_common.bats. |
+| T-02-01-04 | R (Repudiation) | Documentation drift between code and docs | accept | The 5 doc edits (D-03) close the drift window. Future drift would require a new contribution to re-introduce the term. |
+| T-02-01-05 | I (Information Disclosure) | `eval`-driven log expansion of attacker-controlled input | mitigate | Same as T-02-01-01: function deletion eliminates the surface. No log path could ever again pass attacker-controlled data through `eval`. |
+
+**Residual risk:** None within this plan's scope. The only re-introduction vector is a future contributor proposing a similarly-shaped helper. CONVENTIONS.md / CLAUDE.md doc updates direct future authors to `count_lines` instead.
+</threat_model>
+
+<verification>
+- `bash -n lib/common.sh` → exit 0 (syntax intact after deletion)
+- `grep -rn 'safe_count' lib/ modules/ tests/ --include='*.sh' --include='*.bats' | wc -l | tr -d ' '` → `0`
+- `grep -c 'safe_count' CHANGELOG.md CLAUDE.md .planning/codebase/CONVENTIONS.md .planning/codebase/STRUCTURE.md .planning/codebase/ARCHITECTURE.md | awk -F: '{sum+=$2} END {print sum}'` → `0`
+- `bash -c 'source lib/common.sh; type count_lines >/dev/null && type count_lines_stdin >/dev/null'` → exit 0 (replacement helpers callable)
+- `bats tests/unit/test_common.bats` parses cleanly (no "unbound variable" / "command not found: safe_count" output)
+- `bats tests/integration/test_full_flow.bats` parses cleanly
+- `shellcheck -s bash --severity=error lib/common.sh` → exit 0 (no NEW error-level findings caused by deletion)
+- `grep -n 'safe_count' .planning/PROJECT.md` returns whatever existed before this plan (PROJECT.md is intentionally untouched per D-03)
+</verification>
+
+<success_criteria>
+- ROADMAP §"Phase 2" SC#1 satisfied: `grep -n "eval " lib/common.sh modules/*.sh` returns no `eval` calls under `safe_count()` because `safe_count()` no longer exists; the `else` branch at the former `lib/common.sh:760` is gone by virtue of the entire function being gone.
+- All `must_haves.truths` observable per the acceptance criteria above.
+- No back-compat wrapper or deprecation stub left behind (D-01).
+- No port of deleted tests to `count_lines` form (D-02 explicit choice).
+- `.planning/PROJECT.md` is not edited by this plan.
+- Replacement helpers `count_lines()` and `count_lines_stdin()` remain untouched and callable.
+</success_criteria>
+
+<output>
+After completion, create `.planning/phases/02-security-quoting-supply-chain-hygiene/02-01-SUMMARY.md`.
+</output>
+</content>
diff --git a/.planning/phases/02-security-quoting-supply-chain-hygiene/02-02-PLAN.md b/.planning/phases/02-security-quoting-supply-chain-hygiene/02-02-PLAN.md
new file mode 100644
index 0000000..fc3576b
--- /dev/null
+++ b/.planning/phases/02-security-quoting-supply-chain-hygiene/02-02-PLAN.md
@@ -0,0 +1,317 @@
+---
+id: 02-02
+phase: 02
+plan: 02
+type: execute
+wave: 2
+depends_on: ["02-03"]
+requirements: [SEC-02, FIX-01]
+files_modified:
+ - modules/core.sh
+ - modules/web.sh
+autonomous: true
+must_haves:
+ truths:
+ - "D-04: Every variable expansion inside `sendToNotify()` (modules/core.sh, ~lines 1387-1417) is double-quoted — bare `$1`/`$NOTIFY_CONFIG`/`$discord_url`/`$slack_channel`/`$slack_auth` no longer appear in the function body"
+ - "D-04: All curl `-F` form pairs use the quoted-form-pair pattern (`-F \"key=value\"`, `-F \"key=@${1}\"`) rather than bare `-F key=value` or bare `-F key=@${1}` — quoting the entire `-F` argument prevents word-splitting on filenames or values containing spaces"
+ - "D-04: The Telegram URL interpolation `https://api.telegram.org/bot${telegram_key}/sendDocument` is fully double-quoted (`\"https://api.telegram.org/bot${telegram_key}/sendDocument\"`) — the bare-URL form is gone"
+ - "D-04: The four bare `$NOTIFY_CONFIG` references at lines ~1399, ~1401, ~1402, ~1406, ~1408 (inside `grep -q ... $NOTIFY_CONFIG` and `sed -n ... ${NOTIFY_CONFIG}` patterns) are all double-quoted as `\"${NOTIFY_CONFIG}\"`"
+ - "D-05: After the quoting pass, `shellcheck -s bash modules/core.sh` produces NO new SC2086 / SC2068 / SC2027 findings inside lines :1385-1420 vs the pre-pass baseline (any pre-existing findings outside this line range are not in scope)"
+ - "D-05: If any intentional word-split survives (none expected), it is annotated with an inline `# shellcheck disable=SCXXXX # <reason>` comment on the line ABOVE — NEVER a file-level disable (CONVENTIONS.md:277)"
+ - "D-04: Existing `register_secret \"$telegram_key\"` and `register_secret \"$discord_url\"` calls remain functionally intact — these were already correctly quoted; stylistic normalisation to `\"${telegram_key}\"` / `\"${discord_url}\"` is allowed but optional"
+ - "D-04: Function declaration form `function sendToNotify {` (parentheses-less) is preserved verbatim — do NOT normalise it to `function sendToNotify()` as part of the quoting pass"
+ - "D-06: modules/web.sh line 2340 is changed from `github.com/Brosck/mantra@latest` to `github.com/brosck/mantra@latest` (1-character `B`→`b` lowercase fix)"
+ - "D-06: After the fix, `grep -n 'Brosck' modules/web.sh` returns 0 hits"
+ - "FIX-01 traceability: the lowercase `brosck` value matches the local install path established by commit `f64383c2` (`install.sh` `gotools[\"mantra\"]=\"github.com/brosck/mantra\"`) — the local and remote install paths agree"
+ - "Plan 02-02 lands ON TOP of Plan 02-03's modules/web.sh edits (Wave 2 / depends_on 02-03). Line 2340 in modules/web.sh as of pre-Plan-02-03 is the `axiom-exec` line containing `Brosck`; after Plan 02-03 lands the surrounding axiom-scan line 2341 (the `\"$AXIOM_EXTRA_ARGS\"` site at PATTERNS.md table) becomes `\"${AXIOM_EXTRA_ARGS_ARR[@]}\"`. Plan 02-02 then changes only the `B`→`b` on the axiom-exec line — independent of the axiom-scan change."
+ - "bash -n passes on modules/core.sh and modules/web.sh after both edits"
+ artifacts:
+ - path: "modules/core.sh"
+ provides: "sendToNotify() body fully-quoted (lines ~1387-1417); all variable expansions safe against word-splitting; URL interpolation quoted"
+ pattern: 'sendToNotify'
+ - path: "modules/web.sh"
+ provides: "1-char fix at line 2340 — Brosck → brosck in github.com/brosck/mantra@latest module path"
+ pattern: 'github.com/brosck/mantra'
+ pattern_absent: 'Brosck'
+ key_links:
+ - from: "modules/core.sh sendToNotify() curl invocations"
+ to: "shell argv parser"
+ via: "fully-quoted variable expansions (no word-splitting on user-derived strings)"
+ pattern: '"[$]{[A-Za-z_]+}"'
+ - from: "modules/web.sh axiom-exec mantra install path"
+ to: "GitHub module path resolution (case-sensitive)"
+ via: "lowercase brosck/mantra matching the local install path from commit f64383c2"
+ pattern: 'github\.com/brosck/mantra@latest'
+---
+
+<objective>
+Two security-hardening edits in `modules/`:
+
+1. **`sendToNotify()` full-function quoting pass (SEC-02 / D-04+D-05)** — Quote every variable expansion in `modules/core.sh`'s `sendToNotify()` body (~lines 1387-1417). Beyond the three names listed in the ROADMAP success criterion (`$discord_url`, `${slack_channel}`, `${1}`), this is a full-function pass: every `-F` form pair, every `$NOTIFY_CONFIG` reference in `grep`/`sed` invocations, and the Telegram URL interpolation. Per CONTEXT.md: a future contributor copy-pasting any line in this block should not be able to reintroduce the same class of bug from an unquoted neighbour.
+
+2. **`modules/web.sh:2340` mantra path fix (FIX-01 / D-06)** — 1-character `B`→`b` change so `axiom-exec "go install github.com/Brosck/mantra@latest"` becomes `axiom-exec "go install github.com/brosck/mantra@latest"`. GitHub module path matching is case-sensitive; the current value 404s on the remote axiom node. The local install path was already corrected in commit `f64383c2` (`install.sh:gotools["mantra"]="github.com/brosck/mantra"`); this plan brings the axiom-exec branch into agreement.
+
+Purpose: SEC-02 closes the audit finding that `$discord_url`, `${slack_channel}`, and `${1}` (filename) are unquoted in `sendToNotify()`'s curl calls, breaking on filenames with spaces and creating shell-metacharacter injection surface. CONTEXT.md D-04 elevates the patch from "fix the 3 named vars" to "fix the whole function body" so the function survives future copy-paste contributions. FIX-01 closes the `Brosck/mantra` typo so axiom-exec installs the tool successfully instead of falling back to a 404 + empty axiom-scan run.
+
+Output: `sendToNotify()` body matches the target shape in PATTERNS.md (every `$var` → `"${var}"`, every `-F key=value` → `-F "key=value"`, every URL interpolation fully-quoted); modules/web.sh:2340 contains lowercase `brosck`; shellcheck-clean for the quoting pass.
+
+**Dependency note:** This plan is Wave 2 / depends_on 02-03 because Plan 02-03 also edits modules/web.sh (15 axiom-scan call sites including line 2341 which is ONE LINE AWAY from this plan's line 2340). The two plans touch adjacent but non-overlapping lines; ordering 02-03 first lets the 1-character edit in this plan apply cleanly on top of the larger refactor.
+</objective>
+
+<execution_context>
+@$HOME/.claude/get-shit-done/workflows/execute-plan.md
+@$HOME/.claude/get-shit-done/templates/summary.md
+</execution_context>
+
+<context>
[email protected]/phases/02-security-quoting-supply-chain-hygiene/02-CONTEXT.md
[email protected]/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md
[email protected]/codebase/CONVENTIONS.md
[email protected]/codebase/CONCERNS.md
[email protected]/phases/02-security-quoting-supply-chain-hygiene/02-03-PLAN.md
+
+<interfaces>
+<!-- Key existing identifiers and current shape. Extracted from codebase. -->
+
+From modules/core.sh:1387-1417 (CURRENT sendToNotify body — UNDER-QUOTED):
+```bash
+function sendToNotify {
+ if [[ -z $1 ]]; then
+ _print_status WARN "No file provided to send"
+ else
+ if [[ -z $NOTIFY_CONFIG ]]; then
+ NOTIFY_CONFIG=~/.config/notify/provider-config.yaml
+ fi
+ if [[ -n "$(find "${1}" -prune -size +8000000c)" ]]; then
+ _print_msg WARN "${1} is larger than 8MB, sending over external service"
+ transfer "${1}" | notify -silent
+ return 0
+ fi
+ if grep -q '^ telegram\|^telegram\|^ telegram' $NOTIFY_CONFIG; then
+ notification "Sending ${domain} data over Telegram" info
+ telegram_chat_id=$(sed -n '/^telegram:/,/^[^ ]/p' ${NOTIFY_CONFIG} | sed -n 's/^[ ]*telegram_chat_id:[ ]*"\([^"]*\)".*/\1/p')
+ telegram_key=$(sed -n '/^telegram:/,/^[^ ]/p' ${NOTIFY_CONFIG} | sed -n 's/^[ ]*telegram_api_key:[ ]*"\([^"]*\)".*/\1/p')
+ register_secret "$telegram_key"
+ run_command curl -F "chat_id=${telegram_chat_id}" -F "document=@${1}" https://api.telegram.org/bot${telegram_key}/sendDocument 2>>"$LOGFILE" >/dev/null
+ fi
+ if grep -q '^ discord\|^discord\|^ discord' $NOTIFY_CONFIG; then
+ notification "Sending ${domain} data over Discord" info
+ discord_url=$(sed -n '/^discord:/,/^[^ ]/p' ${NOTIFY_CONFIG} | sed -n 's/^[ ]*discord_webhook_url:[ ]*"\([^"]*\)".*/\1/p')
+ register_secret "$discord_url"
+ run_command curl -v -i -H "Accept: application/json" -H "Content-Type: multipart/form-data" -X POST -F 'payload_json={"username": "test", "content": "hello"}' -F file1=@${1} $discord_url 2>>"$LOGFILE" >/dev/null
+ fi
+ if [[ -n $slack_channel ]] && [[ -n $slack_auth ]]; then
+ notification "Sending ${domain} data over Slack" info
+ run_command curl -F file=@${1} -F "initial_comment=reconftw zip file" -F channels=${slack_channel} -H "Authorization: Bearer ${slack_auth}" https://slack.com/api/files.upload 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+}
+```
+
+From modules/core.sh:1372-1386 (CANONICAL fully-quoted curl analog — `transfer()`):
+```bash
+function transfer() {
+ if [[ $ALLOW_TRANSFER != true ]]; then
+ return 0
+ fi
+ local file="${1:-}"
+ [[ -n "$file" && -s "$file" ]] || return 0
+ local file_name="${RANDOM}_${file##*/}"
+ run_command tar -czvf "/tmp/$file_name" "$file" >/dev/null 2>&1 && \
+ run_command curl -s "https://bashupload.com/${file_name}.tgz" \
+ --data-binary "@/tmp/$file_name" | grep wget
+}
+```
+
+From modules/web.sh:2336-2342 (CURRENT axiom-exec mantra block — BEFORE the Plan 02-03 axiom_extra_args migration on line 2341):
+```bash
+ if [[ -s "js/js_livelinks.txt" ]]; then
+ if [[ $AXIOM != true ]]; then
+ cat js/js_livelinks.txt | mantra -ua \"$HEADER\" -s | anew -q js/js_secrets.txt 2>>"$LOGFILE" >/dev/null || true
+ else
+ axiom-exec "go install github.com/Brosck/mantra@latest" 2>>"$LOGFILE" >/dev/null
+ run_command axiom-scan js/js_livelinks.txt -m mantra -ua "$HEADER" -s -o js/js_secrets.txt "$AXIOM_EXTRA_ARGS" &>/dev/null
+ fi
+```
+
+After Plan 02-03 lands (Wave 1), line 2341 (the axiom-scan invocation) becomes:
+```bash
+ run_command axiom-scan js/js_livelinks.txt -m mantra -ua "$HEADER" -s -o js/js_secrets.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" &>/dev/null
+```
+
+This plan (02-02) leaves line 2341 alone and edits only the `Brosck` on line 2340.
+
+Precedent reference (commit f64383c2 — already merged):
+```diff
+- ["mantra"]="github.com/Brosck/mantra"
++ ["mantra"]="github.com/brosck/mantra"
+```
+Currently in install.sh:330 (already merged): `["mantra"]="github.com/brosck/mantra"`.
+</interfaces>
+</context>
+
+<tasks>
+
+<task type="auto">
+ <name>Task 1: Full-function quoting pass on sendToNotify() in modules/core.sh</name>
+ <files>modules/core.sh</files>
+ <read_first>
+ - modules/core.sh:1387-1417 (the current sendToNotify body — read in full to see every variable expansion and curl invocation; verify the actual on-disk line numbers since prior phase commits may have shifted them slightly)
+ - modules/core.sh:1372-1386 (the `transfer()` function — the canonical fully-quoted curl analog living ~7 lines above sendToNotify in the same file)
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-CONTEXT.md sections "D-04" and "D-05"
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md section "modules/core.sh:1387-1417 — sendToNotify full-function quoting pass" (includes the per-line change inventory)
+ - .planning/codebase/CONVENTIONS.md §"Variable Naming" (always-quote-expansions rule) and §"Comments" (inline shellcheck disable policy)
+ </read_first>
+ <action>
+ Per D-04: Replace every variable expansion in `sendToNotify()`'s body with the double-quoted braced form. The target post-pass shape is provided verbatim in PATTERNS.md §"Target shape after the quoting pass". Per-line change inventory (executor checklist; line numbers are approximate from PATTERNS.md — re-verify locally):
+
+ 1. `[[ -z $1 ]]` → `[[ -z "${1}" ]]`
+ 2. `[[ -z $NOTIFY_CONFIG ]]` → `[[ -z "${NOTIFY_CONFIG}" ]]`
+ 3. `grep -q '...' $NOTIFY_CONFIG` (Telegram branch) → `grep -q '...' "${NOTIFY_CONFIG}"`
+ 4. `sed -n '/^telegram:/,/^[^ ]/p' ${NOTIFY_CONFIG}` (Telegram chat_id extraction) → `sed -n '/^telegram:/,/^[^ ]/p' "${NOTIFY_CONFIG}"`
+ 5. `sed -n '/^telegram:/,/^[^ ]/p' ${NOTIFY_CONFIG}` (Telegram api_key extraction) → `sed -n '/^telegram:/,/^[^ ]/p' "${NOTIFY_CONFIG}"`
+ 6. `register_secret "$telegram_key"` — already correctly quoted; either leave verbatim or normalise to `register_secret "${telegram_key}"` for stylistic consistency
+ 7. `run_command curl -F "chat_id=${telegram_chat_id}" -F "document=@${1}" https://api.telegram.org/bot${telegram_key}/sendDocument 2>>"$LOGFILE" >/dev/null` — the `-F "chat_id=..."` and `-F "document=@${1}"` pairs are already quoted; quote the bare URL: append `"` around the whole `https://...` argument so it becomes `"https://api.telegram.org/bot${telegram_key}/sendDocument"`
+ 8. `grep -q '...' $NOTIFY_CONFIG` (Discord branch) → `grep -q '...' "${NOTIFY_CONFIG}"`
+ 9. `sed -n '/^discord:/,/^[^ ]/p' ${NOTIFY_CONFIG}` → `sed -n '/^discord:/,/^[^ ]/p' "${NOTIFY_CONFIG}"`
+ 10. `register_secret "$discord_url"` — already correctly quoted; either leave verbatim or normalise to `register_secret "${discord_url}"`
+ 11. `-F file1=@${1} $discord_url` → `-F "file1=@${1}" "${discord_url}"`
+ 12. `[[ -n $slack_channel ]] && [[ -n $slack_auth ]]` → `[[ -n "${slack_channel}" ]] && [[ -n "${slack_auth}" ]]`
+ 13. `-F file=@${1} -F "initial_comment=reconftw zip file" -F channels=${slack_channel}` → `-F "file=@${1}" -F "initial_comment=reconftw zip file" -F "channels=${slack_channel}"`
+ 14. `-H "Authorization: Bearer ${slack_auth}"` — already correctly quoted; leave verbatim
+
+ Preserve VERBATIM:
+ - The function declaration form `function sendToNotify {` (no parentheses). Do NOT normalise to `function sendToNotify()`.
+ - The literal-string `-F 'payload_json={"username": "test", "content": "hello"}'` argument with single quotes — these are intentional (single quotes prevent expansion of the JSON braces).
+ - The `2>>"$LOGFILE" >/dev/null` redirection chain.
+ - The `notification "Sending ${domain} data over Telegram" info` / `... over Discord` / `... over Slack` info calls — already correctly quoted.
+ - The line `_print_msg WARN "${1} is larger than 8MB, sending over external service"` — already correctly quoted.
+ - The `transfer "${1}" | notify -silent` call — already correctly quoted.
+ - The `[[ -n "$(find "${1}" -prune -size +8000000c)" ]]` test — already correctly quoted.
+
+ Per D-05: After the pass, run `shellcheck -s bash modules/core.sh` and capture findings filtered to lines 1385-1420. The diff vs baseline must show NO NEW SC2086 / SC2068 / SC2027 findings within this line range. If any intentional word-split survives (none expected in this block), annotate with an inline `# shellcheck disable=SCXXXX # <reason>` on the line ABOVE the offending expansion — NEVER a file-level disable directive (CONVENTIONS.md:277).
+
+ Per CONTEXT.md Claude's Discretion: shellcheck is already wired into `.pre-commit-config.yaml` (CONVENTIONS.md); the pre-commit gate will catch any regression automatically — running shellcheck explicitly here is verification, not new tooling.
+ </action>
+ <verify>
+ <automated>bash -n modules/core.sh && grep -nE '\$1[^"}]|\$NOTIFY_CONFIG[^"}]|\$discord_url[^"}]|\$slack_channel[^"}]|\$slack_auth[^"}]' modules/core.sh | awk -F: '$1>=1385 && $1<=1420' | wc -l | tr -d ' '</automated>
+ </verify>
+ <acceptance_criteria>
+ - `bash -n modules/core.sh` exits 0
+ - `grep -nE '\$1[^"}]|\$NOTIFY_CONFIG[^"}]|\$discord_url[^"}]|\$slack_channel[^"}]|\$slack_auth[^"}]' modules/core.sh | awk -F: '$1>=1385 && $1<=1420' | wc -l | tr -d ' '` returns `0` (no bare-`$` variable references inside the sendToNotify body)
+ - `awk 'NR>=1385 && NR<=1420' modules/core.sh | grep -cE 'grep -q .* \$NOTIFY_CONFIG'` returns `0` (the Telegram + Discord `grep -q` lines now quote NOTIFY_CONFIG)
+ - `awk 'NR>=1385 && NR<=1420' modules/core.sh | grep -cE 'sed -n .* \$\{NOTIFY_CONFIG\}'` returns `0` (the bare-brace form is also quoted now)
+ - `awk 'NR>=1385 && NR<=1420' modules/core.sh | grep -c 'https://api.telegram.org/bot'` returns at least 1 hit AND that line contains the full URL inside double quotes (regex check: `grep -E '"https://api\.telegram\.org/bot\$\{telegram_key\}/sendDocument"' modules/core.sh` returns at least 1 hit)
+ - `awk 'NR>=1385 && NR<=1420' modules/core.sh | grep -cE '\-F file1?=@'` returns `0` (no bare-form `-F file=@...` or `-F file1=@...` remain; all are quoted-pair form)
+ - `awk 'NR>=1385 && NR<=1420' modules/core.sh | grep -cE '\-F channels=\$'` returns `0` (no bare-form `-F channels=$slack_channel` remains)
+ - `awk 'NR>=1385 && NR<=1420' modules/core.sh | grep -c 'function sendToNotify {'` returns exactly `1` (declaration form preserved — no `()` introduced)
+ - `shellcheck -s bash --severity=error modules/core.sh` exits 0 (no NEW error-level findings introduced by the quoting pass)
+ - Optionally: `shellcheck -s bash modules/core.sh 2>&1 | awk -F: '$2>=1385 && $2<=1420' | grep -cE 'SC2086|SC2068|SC2027'` returns `0` (no NEW warning-level findings in the SC208x/SC202x family within the function range)
+ </acceptance_criteria>
+ <done>
+ sendToNotify body has every variable expansion double-quoted; no bare `$1` / `$NOTIFY_CONFIG` / `$discord_url` / `$slack_channel` / `$slack_auth` remain inside lines 1385-1420; all `-F` form pairs are quoted-pair form; the Telegram URL is quoted; function declaration form preserved verbatim; shellcheck clean.
+ </done>
+</task>
+
+<task type="auto">
+ <name>Task 2: One-character mantra path fix at modules/web.sh:2340</name>
+ <files>modules/web.sh</files>
+ <read_first>
+ - modules/web.sh — locate the axiom-exec mantra-install line: run `grep -n 'Brosck/mantra' modules/web.sh` (should return 1 hit; the line is around :2340 pre-Plan-02-03, may have shifted slightly after Plan 02-03's local-block deletion in webprobe_full removed 7 lines earlier in the file)
+ - install.sh:330 (verify the local install path uses lowercase `["mantra"]="github.com/brosck/mantra"` — this is the precedent established by commit f64383c2)
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-CONTEXT.md section "D-06"
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md section "modules/web.sh:2340 — Brosck → brosck 1-char fix"
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-03-PLAN.md (read frontmatter `files_modified` — confirm modules/web.sh is also edited there at non-overlapping lines)
+ </read_first>
+ <action>
+ Per D-06 / FIX-01: Locate the unique line in modules/web.sh that currently reads:
+ ```bash
+ axiom-exec "go install github.com/Brosck/mantra@latest" 2>>"$LOGFILE" >/dev/null
+ ```
+ (Approximate line 2340 pre-Plan-02-03; may be ~2333 after Plan 02-03 deletes 7 lines in webprobe_full at the top of the file. Use text-keyed lookup, not line-number lookup, to be resilient.)
+
+ Replace `Brosck` with `brosck` (lowercase B → b) so the line reads:
+ ```bash
+ axiom-exec "go install github.com/brosck/mantra@latest" 2>>"$LOGFILE" >/dev/null
+ ```
+
+ This is a 1-character change. Preserve VERBATIM:
+ - The surrounding indentation (matches the existing if/else block).
+ - The double-quoted bash-style `"go install ..."` argument to axiom-exec.
+ - The redirect `2>>"$LOGFILE" >/dev/null`.
+
+ Do NOT touch the adjacent line 2341 (the axiom-scan invocation with `"${AXIOM_EXTRA_ARGS_ARR[@]}"`) — that line was migrated by Plan 02-03 (`depends_on: ["02-03"]`). If for some reason 02-03's migration of line 2341 has NOT landed (the executor is running plans out of order), STOP and surface the issue to the developer; the plan ordering is `02-03` then `02-02`.
+
+ Do NOT touch line 2338 (the local-mode `cat js/js_livelinks.txt | mantra -ua \"$HEADER\" -s | anew ...` line) — it doesn't reference any Brosck/brosck case; the local mantra binary on PATH is invoked directly without a module-path reference.
+ </action>
+ <verify>
+ <automated>bash -n modules/web.sh && grep -c 'Brosck' modules/web.sh && grep -c 'github.com/brosck/mantra@latest' modules/web.sh</automated>
+ </verify>
+ <acceptance_criteria>
+ - `bash -n modules/web.sh` exits 0
+ - `grep -c 'Brosck' modules/web.sh` returns `0` (no remaining uppercase-B reference anywhere in the file)
+ - `grep -c 'github.com/brosck/mantra@latest' modules/web.sh` returns at least `1` (the fixed line)
+ - `grep -n 'github.com/brosck/mantra@latest' modules/web.sh | awk -F: 'NR==1 {print $1}'` is within ±15 lines of 2340 (allow for Plan 02-03's earlier deletions shifting the line number; the line still lives in the same axiom-exec block — verifiable by `grep -B2 -A2 'github.com/brosck/mantra@latest' modules/web.sh` showing the surrounding `if [[ $AXIOM != true ]]; then ... else ... axiom-scan ... fi` context)
+ - The line 2341 (or wherever the axiom-scan immediately following lives) shows `"${AXIOM_EXTRA_ARGS_ARR[@]}"` (verifying Plan 02-03 landed first per the depends_on contract)
+ - Cross-file consistency check: `grep -E 'brosck/mantra' install.sh modules/web.sh | wc -l | tr -d ' '` returns at least `2` (one in install.sh:gotools, one in modules/web.sh axiom-exec — local and remote install paths now agree)
+ - `shellcheck -s bash --severity=error modules/web.sh` exits 0 (no NEW error-level findings)
+ </acceptance_criteria>
+ <done>
+ modules/web.sh contains the lowercase `github.com/brosck/mantra@latest` axiom-exec module path; no `Brosck` references remain in the file; local (install.sh) and remote (modules/web.sh) install paths agree.
+ </done>
+</task>
+
+</tasks>
+
+<threat_model>
+## Trust Boundaries
+
+| Boundary | Description |
+|----------|-------------|
+| filename / config string → curl argv | `${1}` (caller-supplied filename), `$NOTIFY_CONFIG` (config-derived path), `$discord_url` / `$telegram_key` / `$slack_channel` / `$slack_auth` (notify.conf-derived secrets) all enter curl's argv via shell expansion. |
+| `bash -lc` arg → remote `go install` | `axiom-exec "go install <module>@latest"` runs the quoted string remotely; module path correctness is essential because case-sensitive resolution is the failure mode FIX-01 addresses. |
+
+## STRIDE Threat Register
+
+| Threat ID | Category | Component | Disposition | Mitigation Plan |
+|-----------|----------|-----------|-------------|-----------------|
+| T-02-02-01 | I (Information Disclosure) | `sendToNotify` filename `${1}` injected into curl argv unquoted | mitigate | D-04 quotes every `${1}` reference in `-F file=@${1}`, `-F file1=@${1}`, `-F document=@${1}`. A filename containing spaces (e.g., `recon report.zip`) no longer word-splits into multiple curl form-fields. |
+| T-02-02-02 | T (Tampering) | `$discord_url` unquoted in curl invocation; webhook URL containing whitespace breaks the call | mitigate | D-04 quotes `"${discord_url}"`. Discord webhook URLs do not typically contain whitespace, but the un-quoted form is indistinguishable from intentional word-split and creates ambiguity for future contributors. |
+| T-02-02-03 | T (Tampering) | `$NOTIFY_CONFIG` path containing shell metacharacters reaches `grep`/`sed` unquoted | mitigate | D-04 quotes `"${NOTIFY_CONFIG}"` at all 5 reference sites. A config-path with spaces (e.g., `~/My Configs/notify.yaml`) now works correctly. |
+| T-02-02-04 | T (Tampering) | Telegram URL interpolation `https://api.telegram.org/bot${telegram_key}/sendDocument` bare-form word-splits if `$telegram_key` contains a space (it shouldn't, but defence-in-depth) | mitigate | D-04 quotes the whole URL. The `register_secret "$telegram_key"` call also ensures the key value is redacted from log output. |
+| T-02-02-05 | T (Tampering) | Future contributor copy-pastes an unquoted neighbour expansion when adding a new notify backend | mitigate | D-04 makes the full function shellcheck-clean. A new contribution that re-introduces an unquoted form fails the pre-commit shellcheck hook. CONVENTIONS.md inline-disable policy (D-05) prevents file-level shellcheck-disable workarounds. |
+| T-02-02-06 | D (Denial of Service) | Axiom-exec mantra install 404s on case-sensitive GitHub path; subsequent axiom-scan runs with no module installed, producing empty output silently | mitigate | D-06 changes `Brosck` → `brosck` (matching commit f64383c2 / current install.sh:330). The remote install path now resolves correctly; mantra is installed; axiom-scan runs against a real binary. |
+| T-02-02-07 | R (Repudiation) | "Why is the axiom-mantra output empty?" debugging trail | mitigate | After D-06, axiom-mantra produces real output. The prior silent failure mode is gone; the `2>>"$LOGFILE"` capture remains for any future failure. |
+| T-02-02-08 | S (Spoofing) | The lowercase `brosck/mantra` GitHub user is the upstream-trusted source for the `mantra` tool — there is no risk of a typo-squat at the GitHub-username level because user names are unique and case-folded for username matching (only module paths are case-sensitive) | accept | The fix aligns the module path with the canonical upstream. No new spoofing surface introduced. |
+
+**Residual risk:** None within this plan's scope. The full-function quoting pass removes the entire neighbour-copy-paste regression vector. The 1-char fix is a tiny but high-value patch that closes a silent-failure path. Future notify-backend additions must follow the now-canonical quoting pattern (enforced by pre-commit shellcheck).
+</threat_model>
+
+<verification>
+- `bash -n modules/core.sh modules/web.sh` → all exit 0
+- `grep -nE '\$1[^"}]|\$NOTIFY_CONFIG[^"}]|\$discord_url[^"}]|\$slack_channel[^"}]|\$slack_auth[^"}]' modules/core.sh | awk -F: '$1>=1385 && $1<=1420' | wc -l | tr -d ' '` → `0`
+- `grep -c 'Brosck' modules/web.sh` → `0`
+- `grep -c 'github.com/brosck/mantra@latest' modules/web.sh` → at least `1`
+- `shellcheck -s bash --severity=error modules/core.sh modules/web.sh` → exit 0 (no NEW error-level findings)
+- Cross-file consistency: `grep -E 'brosck/mantra' install.sh modules/web.sh | wc -l | tr -d ' '` → at least `2`
+- Plan-ordering proof: in modules/web.sh, the axiom-scan line immediately following the (now-fixed) axiom-exec brosck line contains `"${AXIOM_EXTRA_ARGS_ARR[@]}"` (proves Plan 02-03 landed first)
+- shellcheck targeted: `shellcheck -s bash modules/core.sh 2>&1 | awk -F: '$2>=1385 && $2<=1420' | grep -cE 'SC2086|SC2068|SC2027'` → `0`
+- Optional smoke: `bash -c 'source modules/core.sh 2>/dev/null; declare -f sendToNotify >/dev/null && echo OK'` → `OK` (function still parses and is declarable in isolation)
+</verification>
+
+<success_criteria>
+- ROADMAP §"Phase 2" SC#2 satisfied: `sendToNotify()` in `modules/core.sh` quotes every variable passed to `curl` (`"$discord_url"`, `"${slack_channel}"`, `"${1}"` named in the criterion — and the rest of the body per D-04); shellcheck reports no new findings against the function range.
+- ROADMAP §"Phase 2" SC#5 satisfied: running `axiom-exec mantra` against a remote node installs `github.com/brosck/mantra@latest` (lowercase) and the binary runs — the previous 404 / module-not-found on case-sensitive GitHub paths is gone.
+- All `must_haves.truths` observable per the acceptance criteria above.
+- Function declaration form `function sendToNotify {` preserved verbatim (no parentheses introduced).
+- No file-level shellcheck-disable directives added (D-05 / CONVENTIONS.md:277).
+- Local (`install.sh:gotools`) and remote (`modules/web.sh:axiom-exec`) install paths for mantra agree on lowercase `brosck/mantra`.
+</success_criteria>
+
+<output>
+After completion, create `.planning/phases/02-security-quoting-supply-chain-hygiene/02-02-SUMMARY.md`.
+</output>
+</content>
diff --git a/.planning/phases/02-security-quoting-supply-chain-hygiene/02-03-PLAN.md b/.planning/phases/02-security-quoting-supply-chain-hygiene/02-03-PLAN.md
new file mode 100644
index 0000000..619429b
--- /dev/null
+++ b/.planning/phases/02-security-quoting-supply-chain-hygiene/02-03-PLAN.md
@@ -0,0 +1,658 @@
+---
+id: 02-03
+phase: 02
+plan: 03
+type: execute
+wave: 1
+depends_on: []
+requirements: [SEC-03, SEC-04]
+files_modified:
+ - reconftw.sh
+ - modules/subdomains.sh
+ - modules/web.sh
+ - install.sh
+ - tools.lock
+autonomous: true
+must_haves:
+ truths:
+ - "D-07: reconftw.sh declares `declare -a AXIOM_EXTRA_ARGS_ARR=()` and parses it once via `read -r -a AXIOM_EXTRA_ARGS_ARR <<<\"${AXIOM_EXTRA_ARGS}\"` (with defensive IFS save/restore) — the parse runs AFTER `secrets.cfg` source (~line 503) AND AFTER `CUSTOM_CONFIG` source (~line 511) AND BEFORE the `CLI_*` re-apply block (~line 513)"
+ - "D-07: `AXIOM_EXTRA_ARGS_ARR` is `UPPER_SNAKE_CASE` (matches CONVENTIONS.md:60-63 for globals like `AXIOM`, `AXIOM_EXTRA_ARGS`, `AXIOM_FLEET_COUNT`)"
+ - "D-07: When `AXIOM_EXTRA_ARGS` is unset or empty, `AXIOM_EXTRA_ARGS_ARR` is an empty array; expanding `\"${AXIOM_EXTRA_ARGS_ARR[@]}\"` produces zero arguments"
+ - "D-07: When `AXIOM_EXTRA_ARGS=\"--rate-limit 100 --threads 50\"`, sourcing reconftw.sh produces `AXIOM_EXTRA_ARGS_ARR` with exactly 4 tokens (`--rate-limit`, `100`, `--threads`, `50`)"
+ - "D-08: 21 call sites in modules/subdomains.sh that reference `AXIOM_EXTRA_ARGS` (lines 672, 737, 745, 768, 962, 1100, 1107, 1233, 1366, 1570, 1587, 1666, 1742, 1825, 1838, 1905, 1926, 1944, 1990, 2068, 2197) all become `\"${AXIOM_EXTRA_ARGS_ARR[@]}\"`"
+ - "D-08: 15 axiom-scan call sites in modules/web.sh (lines 340, 431, 506, 786, 1008, 1152, 1537, 1988, 1990, 2257, 2280, 2341, 2479, 2925, 2927) all become `\"${AXIOM_EXTRA_ARGS_ARR[@]}\"`"
+ - "D-09: The `local -a axiom_extra_args=()` declaration at modules/web.sh:144 and the `if/then/read/fi` block at modules/web.sh:150-155 are entirely removed from `webprobe_full()`"
+ - "D-09: The expansion at modules/web.sh:200 (`axiom_cmd+=(\"${axiom_extra_args[@]}\")`) becomes `axiom_cmd+=(\"${AXIOM_EXTRA_ARGS_ARR[@]}\")`; the surrounding guard at :199 also references the global array"
+ - "D-10: Verification sweep after AXIOM_EXTRA_ARGS_ARR migration runs three independent checks (D-10a/b/c below) — no new bats test is added in this phase (test coverage deferred to Phase 4 TEST-03 per CONTEXT.md)"
+ - "D-10a: `grep -nE 'AXIOM_EXTRA_ARGS([^_]|$)' modules/subdomains.sh modules/web.sh` returns 0 hits — every legacy reference has migrated to the `_ARR` form (the `[^_]|$` pattern excludes the new `AXIOM_EXTRA_ARGS_ARR` reads)"
+ - "D-10b: Sourcing smoke-test demonstrates correct tokenisation — `bash -c 'AXIOM_EXTRA_ARGS=\"--rate-limit 100 --threads 50\" source reconftw.sh --source-only; echo \"${#AXIOM_EXTRA_ARGS_ARR[@]}\"'` outputs `4`"
+ - "D-10c: `shellcheck -s bash --severity=error modules/subdomains.sh modules/web.sh reconftw.sh` exits 0 with no NEW error-level findings tied to the migration"
+ - "D-11: install.sh `install_rust_uv()` (lines 159-188) wires `verify_sha256` calls behind `RUSTUP_INSTALLER_SHA256` and `UV_INSTALLER_SHA256` env vars — when set, the script verifies the downloaded tempfile and aborts with `msg_err` + `return 1` on mismatch; when unset, behaviour is unchanged"
+ - "D-11: install.sh documentation comment block at lines ~1228-1239 is extended to list `RUSTUP_INSTALLER_SHA256` and `UV_INSTALLER_SHA256` alongside the existing `GETJSWORDS_SHA256` example"
+ - "D-12: A new file `tools.lock` exists at the repo root with exactly 5 entries for `nuclei`, `httpx`, `ffuf`, `puredns`, `subfinder` in `<binary>=<module>@<version>` format with `#`-comment-line tolerance"
+ - "D-12: install.sh `install_tools()` (lines ~489-521) reads `tools.lock` into a `pinned_tools` associative array BEFORE the `for gotool in \"${!gotools[@]}\"` loop; when `${pinned_tools[$gotool]}` is non-empty, `go install -v` uses that pinned `<module>@<version>` string; otherwise falls back to the existing `${gotools[$gotool]}@latest` behaviour"
+ - "D-12: Each `tools.lock` entry's left-hand side matches a key in the `gotools` associative array at install.sh:293-355 (case-sensitive); each right-hand side matches the corresponding `gotools` module path"
+ - "D-13: `tools.lock` does NOT pin any tool outside the 5 named — the file contains exactly 5 non-comment, non-blank entries"
+ - "Backwards-compatible: a user with no `tools.lock` (or no `RUSTUP_INSTALLER_SHA256` / `UV_INSTALLER_SHA256` env vars set) sees identical install behaviour to pre-Plan-02-03"
+ - "bash -n passes on reconftw.sh, lib/common.sh, modules/core.sh, modules/web.sh, modules/subdomains.sh, install.sh after all edits"
+ artifacts:
+ - path: "reconftw.sh"
+ provides: "Global AXIOM_EXTRA_ARGS_ARR parse inserted between CUSTOM_CONFIG source and CLI_* re-apply"
+ pattern: "AXIOM_EXTRA_ARGS_ARR"
+ - path: "modules/subdomains.sh"
+ provides: "21 axiom-scan call sites migrated to \"${AXIOM_EXTRA_ARGS_ARR[@]}\""
+ pattern_absent: 'AXIOM_EXTRA_ARGS([^_]|$)'
+ - path: "modules/web.sh"
+ provides: "15 axiom-scan call sites migrated + local axiom_extra_args block in webprobe_full removed (lines 144, 150-155, 199-200)"
+ pattern_absent: 'AXIOM_EXTRA_ARGS([^_]|$)'
+ - path: "install.sh"
+ provides: "install_rust_uv() wires verify_sha256 behind RUSTUP_INSTALLER_SHA256 / UV_INSTALLER_SHA256; install_tools() reads tools.lock before iterating gotools; comment block at :1228-1239 documents new env vars"
+ pattern: "RUSTUP_INSTALLER_SHA256|UV_INSTALLER_SHA256|tools.lock"
+ - path: "tools.lock"
+ provides: "5 pinned Go tool entries (nuclei, httpx, ffuf, puredns, subfinder); plain-text key=value with # comments"
+ contains: "nuclei="
+ key_links:
+ - from: "reconftw.sh AXIOM_EXTRA_ARGS_ARR parse"
+ to: "modules/subdomains.sh + modules/web.sh axiom-scan call sites"
+ via: "global UPPER_SNAKE_CASE array expansion"
+ pattern: 'AXIOM_EXTRA_ARGS_ARR\[@\]'
+ - from: "install.sh install_rust_uv()"
+ to: "install.sh verify_sha256() helper (:82-102)"
+ via: "env-var-driven optional verification (RUSTUP_INSTALLER_SHA256, UV_INSTALLER_SHA256)"
+ pattern: 'verify_sha256 "\$_tmpfile" "\$_expected"'
+ - from: "install.sh install_tools()"
+ to: "tools.lock file at SCRIPTPATH root"
+ via: "while-read parse into pinned_tools associative array, lookup per gotool"
+ pattern: 'pinned_tools\[\$gotool\]'
+---
+
+<objective>
+Three independent supply-chain hardening changes bundled in one plan:
+
+1. **AXIOM_EXTRA_ARGS array refactor (SEC-03)** — Replace 38 inconsistent `$AXIOM_EXTRA_ARGS` / `"$AXIOM_EXTRA_ARGS"` call sites across `modules/subdomains.sh` (21 sites) and `modules/web.sh` (15 sites + 1 local-pattern block) with a single global `AXIOM_EXTRA_ARGS_ARR=()` array parsed once in `reconftw.sh`. Eliminate the per-function `axiom_extra_args=()` local pattern in `webprobe_full` (D-09).
+2. **Installer SHA256 verification (SEC-04 part 1)** — Wire env-var-driven `verify_sha256` checks into `install_rust_uv()` behind `RUSTUP_INSTALLER_SHA256` and `UV_INSTALLER_SHA256`. Backwards-compatible: unset env vars preserve pre-change behaviour.
+3. **`tools.lock` manifest (SEC-04 part 2)** — Pin exactly 5 stability-critical Go tools (`nuclei`, `httpx`, `ffuf`, `puredns`, `subfinder`) in a new repo-root `tools.lock` file. `install.sh` reads the manifest before the Go install loop; pinned tools install at the recorded version, unpinned tools fall through to `@latest`.
+
+Purpose: SEC-03 closes a "word-splitting an unquoted variable" anti-pattern that breaks when `AXIOM_EXTRA_ARGS="--rate-limit 100 --threads 50"` is set as intended (the `"$AXIOM_EXTRA_ARGS"` quoted form makes the whole string a single token; the bare form works but is indistinguishable from accidental unquoting). SEC-04 addresses the audit finding that the installer downloads and executes upstream scripts without integrity verification AND that commit `71653984` ("remove pinned versions") removed all Go-tool version pins, leaving every install at the mercy of `@latest`. Env-var-driven pinning + a 5-tool lock manifest matches the existing `GETJSWORDS_SHA256`/`AXIOM_CONFIG_SHA256` precedent and keeps maintenance surface small (D-13).
+
+Output: One global parse in `reconftw.sh` + 36 mechanical token substitutions across 2 modules + 1 local-block deletion in `webprobe_full`; `install_rust_uv` extended with verification gates; `install_tools` extended to consult `tools.lock` before the Go install loop; one new file `tools.lock` with 5 pinned entries.
+</objective>
+
+<execution_context>
+@$HOME/.claude/get-shit-done/workflows/execute-plan.md
+@$HOME/.claude/get-shit-done/templates/summary.md
+</execution_context>
+
+<context>
[email protected]/phases/02-security-quoting-supply-chain-hygiene/02-CONTEXT.md
[email protected]/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md
[email protected]/codebase/CONVENTIONS.md
[email protected]/codebase/CONCERNS.md
+
+<interfaces>
+<!-- Key existing identifiers the executor will read/modify/extend. Extracted from codebase. -->
+
+From reconftw.sh:497-513 (TARGET REGION for the AXIOM_EXTRA_ARGS_ARR parse insertion):
+```bash
+. "${SCRIPTPATH}"/reconftw.cfg || {
+ _print_error "Error importing reconftw.cfg"
+ exit 1
+}
+
+# Source optional secrets file (gitignored, for API keys and tokens)
+[[ -f "${SCRIPTPATH}/secrets.cfg" ]] && . "${SCRIPTPATH}/secrets.cfg"
+
+if [[ -s $CUSTOM_CONFIG ]]; then
+ # shellcheck source=/home/six2dez/Tools/reconftw/custom_config.cfg
+ . "${CUSTOM_CONFIG}" || {
+ _print_error "Error importing custom config"
+ exit 1
+ }
+fi
+
+# Re-apply CLI overrides after config load (config defaults should not clobber CLI flags)
+```
+
+From modules/web.sh:144-202 (THE LOCAL BLOCK TO DELETE / EXPANSIONS TO REPLACE in webprobe_full):
+```bash
+ local probe_out=".tmp/web_full_info_probe.txt"
+ local common_json_tmp=".tmp/web_full_info_common_current.txt"
+ local uncommon_json_tmp=".tmp/web_full_info_uncommon_current.txt"
+ local -a axiom_extra_args=() # ← DELETE
+ : >"$probe_out" 2>/dev/null || true
+ : >"$common_json_tmp" 2>/dev/null || true
+ : >"$uncommon_json_tmp" 2>/dev/null || true
+
+ if [[ $AXIOM == true ]] && [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then # ← DELETE block 150-155
+ local _ifs="$IFS"
+ IFS=' '
+ read -r -a axiom_extra_args <<<"$AXIOM_EXTRA_ARGS"
+ IFS="$_ifs"
+ fi # ← end DELETE
+ ...
+ if [[ ${#axiom_extra_args[@]} -gt 0 ]]; then # ← :199 REPLACE
+ axiom_cmd+=("${axiom_extra_args[@]}") # ← :200 REPLACE
+ fi
+```
+
+From install.sh:82-102 (verify_sha256 helper — REUSE, do not modify):
+```bash
+verify_sha256() {
+ local file="$1"
+ local expected="$2"
+ local actual=""
+ [[ -n "$expected" ]] || return 0 # nothing to verify
+ [[ -s "$file" ]] || return 1
+ if command -v sha256sum >/dev/null 2>&1; then
+ actual=$(sha256sum "$file" | awk '{print $1}')
+ elif command -v shasum >/dev/null 2>&1; then
+ actual=$(shasum -a 256 "$file" | awk '{print $1}')
+ else
+ return 0 # no hashing tool available; skip (don't block install)
+ fi
+ [[ -n "$actual" && "$actual" == "$expected" ]]
+}
+```
+
+From install.sh:159-188 (install_rust_uv body — TARGET for SHA wiring):
+```bash
+install_rust_uv() {
+ local _tmpfile
+ _tmpfile=$(mktemp "${TMPDIR:-/tmp}/rustup_install.XXXXXX")
+ if curl -sSf https://sh.rustup.rs -o "$_tmpfile" 2>/dev/null; then
+ sh "$_tmpfile" -y >/dev/null 2>&1
+ else
+ msg_warn "[!] Failed to download rustup installer"
+ fi
+ rm -f "$_tmpfile"
+ ...
+ _tmpfile=$(mktemp "${TMPDIR:-/tmp}/uv_install.XXXXXX")
+ if curl -LsSf https://astral.sh/uv/install.sh -o "$_tmpfile" 2>/dev/null; then
+ sh "$_tmpfile" &>/dev/null
+ else
+ msg_warn "[!] Failed to download uv installer"
+ fi
+ rm -f "$_tmpfile"
+ ...
+}
+```
+
+From install.sh:1240-1290 (download_sha256 PRECEDENT — env-var-driven optional pin pattern to mirror):
+```bash
+declare -A download_sha256=(
+ ["getjswords"]="${GETJSWORDS_SHA256:-}"
+ ["axiom_config"]="${AXIOM_CONFIG_SHA256:-}"
+)
+...
+local _expected="${download_sha256[$key]:-}"
+if [[ -n "$_expected" ]]; then
+ if verify_sha256 "$destination" "$_expected"; then
+ msg_ok "[$dl_step/$total_dl] $key fetched (sha256 verified)"
+ else
+ msg_err "[$dl_step/$total_dl] $key sha256 mismatch for $url; refusing to install"
+ rm -f "$destination"
+ continue
+ fi
+else
+ msg_ok "[$dl_step/$total_dl] $key fetched"
+fi
+```
+
+From install.sh:489-521 (install_tools — TARGET for tools.lock consumer wiring):
+```bash
+function install_tools() {
+ header "Installing Golang tools (${#gotools[@]})"
+ export GOFLAGS="-mod=mod"
+ export GO111MODULE="on"
+ local go_step=0
+ local failed_tools=()
+ local total_go=${#gotools[@]}
+ local go_ok=0 go_skip=0 go_fail=0
+ for gotool in "${!gotools[@]}"; do
+ ((++go_step))
+ if q go install -v "${gotools[$gotool]}@latest"; then
+ ((++go_ok))
+ msg_ok "[$go_step/$total_go] ${gotool} installed"
+ else
+ ...
+ fi
+ done
+```
+
+From install.sh:293-355 (gotools associative array — module paths to match in tools.lock RHS):
+- `["nuclei"]="github.com/projectdiscovery/nuclei/v3/cmd/nuclei"`
+- `["httpx"]="github.com/projectdiscovery/httpx/cmd/httpx"`
+- `["ffuf"]="github.com/ffuf/ffuf/v2"`
+- `["puredns"]="github.com/d3mondev/puredns/v2"`
+- `["subfinder"]="github.com/projectdiscovery/subfinder/v2/cmd/subfinder"`
+</interfaces>
+</context>
+
+<tasks>
+
+<task type="auto">
+ <name>Task 1: Insert global AXIOM_EXTRA_ARGS_ARR parse in reconftw.sh + migrate 36 call sites + delete webprobe_full local block</name>
+ <files>reconftw.sh, modules/subdomains.sh, modules/web.sh</files>
+ <read_first>
+ - reconftw.sh:495-580 (the config-source + CUSTOM_CONFIG block + start of CLI re-apply — confirm exact line numbers where the parse insertion lands)
+ - modules/subdomains.sh — run `grep -nE 'AXIOM_EXTRA_ARGS' modules/subdomains.sh` to enumerate the 21 call sites (lines 672, 737, 745, 768, 962, 1100, 1107, 1233, 1366, 1570, 1587, 1666, 1742, 1825, 1838, 1905, 1926, 1944, 1990, 2068, 2197 per PATTERNS.md)
+ - modules/web.sh — run `grep -nE 'AXIOM_EXTRA_ARGS' modules/web.sh` to enumerate the call sites + the local-block lines (144, 150-155, 199-200, 340, 431, 506, 786, 1008, 1152, 1537, 1988, 1990, 2257, 2280, 2341, 2479, 2925, 2927)
+ - modules/web.sh:144-202 (the `webprobe_full` local-pattern block to remove per D-09 — read the whole `local -a axiom_extra_args=()` declaration through the `if [[ ${#axiom_extra_args[@]} -gt 0 ]]; then axiom_cmd+=(...) fi` expansion to understand the surrounding `axiom_cmd` array build)
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-CONTEXT.md sections "D-07", "D-08", "D-09", "D-10"
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md sections "reconftw.sh:~503-512 — INSERT global AXIOM_EXTRA_ARGS_ARR parse", "modules/subdomains.sh (21 sites)", "modules/web.sh (17 sites)", "modules/web.sh:144-155, 199-202 — REMOVE local axiom_extra_args=() block"
+ - .planning/codebase/CONVENTIONS.md §"Variable Naming" (UPPER_SNAKE_CASE globals)
+ </read_first>
+ <action>
+ Per D-07: Insert the following block into `reconftw.sh` immediately AFTER the `CUSTOM_CONFIG` source block (the `if [[ -s $CUSTOM_CONFIG ]]; then ... fi` ending around line 511) AND BEFORE the `# Re-apply CLI overrides after config load` comment block (around line 513). Use the defensive IFS-save/restore variant mirroring `modules/web.sh:150-155`:
+
+ ```bash
+ # Global parse of AXIOM_EXTRA_ARGS once after config load — single source of truth.
+ # Consumed via "${AXIOM_EXTRA_ARGS_ARR[@]}" in modules/subdomains.sh and modules/web.sh.
+ # Empty/unset env → empty array → expands to nothing at the call sites.
+ declare -a AXIOM_EXTRA_ARGS_ARR=()
+ if [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then
+ _axiom_ifs_saved="$IFS"
+ IFS=' '
+ read -r -a AXIOM_EXTRA_ARGS_ARR <<<"${AXIOM_EXTRA_ARGS}"
+ IFS="$_axiom_ifs_saved"
+ unset _axiom_ifs_saved
+ fi
+ ```
+
+ Rationale for IFS-save/restore: reconftw.sh ships `IFS=$'\n\t'` (top of file, CONVENTIONS.md:11). Forcing `IFS=' '` for the `read -r -a` ensures space-separated values like `"--rate-limit 100"` tokenise as expected, and restoring `IFS` keeps downstream behaviour identical. Per CONVENTIONS.md, no `set -u` is used, so expanding `"${AXIOM_EXTRA_ARGS_ARR[@]}"` against an empty array is safe.
+
+ Per D-08: In `modules/subdomains.sh`, perform 21 mechanical token substitutions. For each line listed below, replace the trailing token only (NOT surrounding whitespace, NOT line-continuation `\`, NOT trailing redirects `2>>"$LOGFILE" >/dev/null`):
+
+ | Line | Replace | With |
+ |------|---------|------|
+ | 672 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 737 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 745 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 768 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 962 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1100 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1107 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1233 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1366 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1570 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1587 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1666 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1742 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1825 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1838 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1905 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1926 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1944 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1990 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 2068 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 2197 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+
+ Line numbers above are from PATTERNS.md (verified `grep -nE` audit). If the executor's local `grep -nE 'AXIOM_EXTRA_ARGS' modules/subdomains.sh` shows different line numbers (e.g., a prior phase 1 commit shifted them), use the grep output as the source of truth — the substitution rule is: every occurrence of bare `$AXIOM_EXTRA_ARGS` or quoted `"$AXIOM_EXTRA_ARGS"` becomes `"${AXIOM_EXTRA_ARGS_ARR[@]}"`.
+
+ Per D-08: In `modules/web.sh`, perform the same substitution at these axiom-scan call sites (15 sites — note lines 144, 150, 153, 199, 200 are NOT in this list; they are handled by D-09 below):
+
+ | Line | Replace | With |
+ |------|---------|------|
+ | 340 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 431 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 506 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 786 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1008 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1152 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1537 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1988 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 1990 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 2257 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 2280 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 2341 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 2479 | `"$AXIOM_EXTRA_ARGS"` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 2925 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+ | 2927 | `$AXIOM_EXTRA_ARGS` | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+
+ Preserve `&>/dev/null` at line 2341 (bash combined-redirect) verbatim — only the token changes. Preserve all line-continuation `\` characters and trailing redirects.
+
+ Per D-09: In `modules/web.sh` (inside `webprobe_full`):
+ 1. Line 144: DELETE the line ` local -a axiom_extra_args=()` (entire line, including the leading indentation).
+ 2. Lines 150-155 inclusive: DELETE the entire 6-line block:
+ ```bash
+ if [[ $AXIOM == true ]] && [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then
+ local _ifs="$IFS"
+ IFS=' '
+ read -r -a axiom_extra_args <<<"$AXIOM_EXTRA_ARGS"
+ IFS="$_ifs"
+ fi
+ ```
+ 3. Line 199: REPLACE `if [[ ${#axiom_extra_args[@]} -gt 0 ]]; then` with `if [[ ${#AXIOM_EXTRA_ARGS_ARR[@]} -gt 0 ]]; then`.
+ 4. Line 200: REPLACE `axiom_cmd+=("${axiom_extra_args[@]}")` with `axiom_cmd+=("${AXIOM_EXTRA_ARGS_ARR[@]}")`.
+
+ PATTERNS.md notes that the `if [[ ${#...[@]} -gt 0 ]]` guard at :199 is now redundant (because `axiom_cmd+=("${AXIOM_EXTRA_ARGS_ARR[@]}")` against an empty array is a no-op in bash 4.3+). The guard MAY be dropped for simplicity, but doing so is OPTIONAL. Recommendation: keep the guard for defensive symmetry with the rest of the function — fewer diff lines, easier review. Either choice is acceptable.
+
+ Line numbers in the action above are from PATTERNS.md; deleting lines 144 and 150-155 in `modules/web.sh` will shift subsequent line numbers in that file by 7 lines. Apply the deletions BEFORE the line-by-line substitutions in `modules/web.sh`, OR perform all `web.sh` edits via a single targeted-text substitution pass (e.g., per-line `sed` invocations keyed on the surrounding text rather than line numbers). The substitution targets (`"$AXIOM_EXTRA_ARGS"`, `$AXIOM_EXTRA_ARGS`) are unique to the axiom-scan-call context within their lines, so text-keyed substitution is reliable.
+ </action>
+ <verify>
+ <automated>bash -n reconftw.sh && bash -n modules/subdomains.sh && bash -n modules/web.sh && grep -cE 'AXIOM_EXTRA_ARGS([^_]|$)' modules/subdomains.sh modules/web.sh | awk -F: '{sum+=$2} END {print sum}' && grep -c 'AXIOM_EXTRA_ARGS_ARR' reconftw.sh</automated>
+ </verify>
+ <acceptance_criteria>
+ - `bash -n reconftw.sh` exits 0
+ - `bash -n modules/subdomains.sh` exits 0
+ - `bash -n modules/web.sh` exits 0
+ - `grep -cE 'AXIOM_EXTRA_ARGS([^_]|$)' modules/subdomains.sh modules/web.sh | awk -F: '{sum+=$2} END {print sum}'` returns `0` (no legacy references; the `[^_]|$` pattern excludes the new `AXIOM_EXTRA_ARGS_ARR` reads)
+ - `grep -c 'AXIOM_EXTRA_ARGS_ARR' reconftw.sh` returns at least `2` (the `declare -a` line plus the `read -r -a` line)
+ - `grep -c '"${AXIOM_EXTRA_ARGS_ARR\[@\]}"' modules/subdomains.sh` returns `21` (one per migrated site)
+ - `grep -c '"${AXIOM_EXTRA_ARGS_ARR\[@\]}"' modules/web.sh` returns at least `16` (15 call sites + 1 in the webprobe_full axiom_cmd append at :200; allow 17 if the executor opted to drop the `if [[ ${#...[@]} -gt 0 ]]` guard and inlined)
+ - `grep -n 'local -a axiom_extra_args=()' modules/web.sh` returns 0 hits (D-09)
+ - `grep -nE 'read -r -a axiom_extra_args' modules/web.sh` returns 0 hits (D-09)
+ - `grep -c '"${axiom_extra_args\[@\]}"' modules/web.sh` returns 0 hits (D-09 — the local-pattern expansion is gone)
+ - Sourcing smoke test: `bash -c 'AXIOM_EXTRA_ARGS="--rate-limit 100 --threads 50" source reconftw.sh --source-only; echo "${#AXIOM_EXTRA_ARGS_ARR[@]}"'` outputs exactly `4`
+ - Empty-env smoke test: `bash -c 'unset AXIOM_EXTRA_ARGS; source reconftw.sh --source-only; echo "${#AXIOM_EXTRA_ARGS_ARR[@]}"'` outputs exactly `0`
+ - `shellcheck -s bash --severity=error modules/subdomains.sh modules/web.sh reconftw.sh` exits 0 (no NEW error-level findings caused by this migration)
+ </acceptance_criteria>
+ <done>
+ reconftw.sh has the global parse; modules/subdomains.sh has 21 migrated sites; modules/web.sh has 15 migrated call sites + the `webprobe_full` local block removed and `axiom_cmd+=` updated to use the global; both bare and quoted legacy forms are gone (`grep -nE 'AXIOM_EXTRA_ARGS([^_]|$)'` returns 0); sourcing smoke test demonstrates correct tokenisation.
+ </done>
+</task>
+
+<task type="auto">
+ <name>Task 2: Wire verify_sha256 into install_rust_uv() + extend env-var documentation block</name>
+ <files>install.sh</files>
+ <read_first>
+ - install.sh:82-102 (the existing `verify_sha256` helper — read its signature: skip-don't-block on missing tool, skip-on-empty-hash via `[[ -n "$expected" ]] || return 0`)
+ - install.sh:159-188 (the current `install_rust_uv` body — read the curl + sh tempfile pattern for both rustup and uv blocks)
+ - install.sh:1228-1240 (the existing env-var-driven SHA pin documentation comment block referencing `GETJSWORDS_SHA256` and `AXIOM_CONFIG_SHA256`)
+ - install.sh:1251-1290 (the `download_sha256` map iteration that demonstrates the env-var-driven pinning pattern — D-11's analog)
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-CONTEXT.md section "D-11"
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md section "install.sh:159-188 (install_rust_uv) — WIRE verify_sha256 calls"
+ </read_first>
+ <action>
+ Per D-11: In `install.sh`, modify `install_rust_uv()` (lines 159-188) to gate the `sh "$_tmpfile"` execution behind an optional SHA256 verification. Mirror the `download_sha256[$key]:-` env-var-driven pattern from install.sh:1240-1289 (the canonical precedent).
+
+ Target post-edit shape of `install_rust_uv`:
+
+ ```bash
+ install_rust_uv() {
+ local _tmpfile
+ local _expected
+ # Install rustup via downloaded script (verify before executing)
+ _tmpfile=$(mktemp "${TMPDIR:-/tmp}/rustup_install.XXXXXX")
+ if curl -sSf https://sh.rustup.rs -o "$_tmpfile" 2>/dev/null; then
+ _expected="${RUSTUP_INSTALLER_SHA256:-}"
+ if [[ -n "$_expected" ]]; then
+ if verify_sha256 "$_tmpfile" "$_expected"; then
+ msg_ok "[!] rustup installer sha256 verified"
+ sh "$_tmpfile" -y >/dev/null 2>&1
+ else
+ msg_err "[!] rustup installer sha256 mismatch; refusing to execute"
+ rm -f "$_tmpfile"
+ return 1
+ fi
+ else
+ sh "$_tmpfile" -y >/dev/null 2>&1
+ fi
+ else
+ msg_warn "[!] Failed to download rustup installer"
+ fi
+ rm -f "$_tmpfile"
+
+ # shellcheck source=/dev/null
+ source "${HOME}/.cargo/env" 2>/dev/null || true
+ cargo install smugglex &>/dev/null
+
+ # Install uv via downloaded script (verify before executing)
+ _tmpfile=$(mktemp "${TMPDIR:-/tmp}/uv_install.XXXXXX")
+ if curl -LsSf https://astral.sh/uv/install.sh -o "$_tmpfile" 2>/dev/null; then
+ _expected="${UV_INSTALLER_SHA256:-}"
+ if [[ -n "$_expected" ]]; then
+ if verify_sha256 "$_tmpfile" "$_expected"; then
+ msg_ok "[!] uv installer sha256 verified"
+ sh "$_tmpfile" &>/dev/null
+ else
+ msg_err "[!] uv installer sha256 mismatch; refusing to execute"
+ rm -f "$_tmpfile"
+ return 1
+ fi
+ else
+ sh "$_tmpfile" &>/dev/null
+ fi
+ else
+ msg_warn "[!] Failed to download uv installer"
+ fi
+ rm -f "$_tmpfile"
+
+ # shellcheck source=/dev/null
+ source "${HOME}/.local/bin/env" 2>/dev/null || export PATH="${HOME}/.local/bin:$PATH"
+ uv tool update-shell &>/dev/null || true
+ # Install shodan CLI via uv
+ uv tool install shodan --force &>/dev/null || uv tool upgrade shodan &>/dev/null || true
+ }
+ ```
+
+ Per D-11 documentation: Extend the comment block at install.sh:1228-1239 to mention the new env vars. Locate the existing block (the one that introduces `GETJSWORDS_SHA256` and `AXIOM_CONFIG_SHA256` as `export VAR=<sha>` examples) and append two lines:
+ ```
+ # export RUSTUP_INSTALLER_SHA256=<64 hex chars> # rustup-init.sh from https://sh.rustup.rs
+ # export UV_INSTALLER_SHA256=<64 hex chars> # uv installer from https://astral.sh/uv/install.sh
+ ```
+
+ Notes:
+ - `verify_sha256` returns 0 when no hash tool is available (skip-don't-block semantics, install.sh:98). The new path inherits this behaviour — the `msg_ok "[!] rustup installer sha256 verified"` line may fire even on systems without `sha256sum`/`shasum`, which is acceptable for opt-in pinning.
+ - `return 1` aborts `install_rust_uv` but does NOT abort `install.sh` overall (install.sh's `ERR` trap is log-and-continue). Per CONTEXT.md D-11: "aborts with a clear error message before executing it" — abort the bootstrapping function, not the whole install.
+ - `msg_ok`, `msg_warn`, `msg_err` are existing install.sh UI helpers — do NOT introduce new helper names.
+ - `local _expected` is declared once at the top of the function (after `local _tmpfile`); re-using the variable name across both rustup and uv branches is intentional (Bash locals shadow correctly).
+ </action>
+ <verify>
+ <automated>bash -n install.sh && grep -c 'RUSTUP_INSTALLER_SHA256' install.sh && grep -c 'UV_INSTALLER_SHA256' install.sh && grep -c 'verify_sha256 "\$_tmpfile"' install.sh</automated>
+ </verify>
+ <acceptance_criteria>
+ - `bash -n install.sh` exits 0
+ - `grep -c 'RUSTUP_INSTALLER_SHA256' install.sh` returns at least `2` (one in `install_rust_uv` reading the env var + one in the documentation comment block)
+ - `grep -c 'UV_INSTALLER_SHA256' install.sh` returns at least `2`
+ - `grep -c 'verify_sha256 "\$_tmpfile"' install.sh` returns exactly `2` (one rustup call, one uv call)
+ - `grep -n 'rustup installer sha256 mismatch' install.sh` returns at least 1 hit (the abort path message)
+ - `grep -n 'uv installer sha256 mismatch' install.sh` returns at least 1 hit
+ - `grep -n 'rustup installer sha256 verified' install.sh` returns at least 1 hit (the OK-path message)
+ - `grep -n 'uv installer sha256 verified' install.sh` returns at least 1 hit
+ - Backwards-compatibility smoke: `bash -c 'unset RUSTUP_INSTALLER_SHA256 UV_INSTALLER_SHA256; declare -f install_rust_uv >/dev/null && echo OK'` — the function must remain definable (i.e., bash parses install.sh cleanly with no env vars set)
+ - `shellcheck -s bash --severity=error install.sh` exits 0 (no NEW error-level findings caused by this change)
+ </acceptance_criteria>
+ <done>
+ install.sh has `verify_sha256 "$_tmpfile" "$_expected"` calls for both rustup and uv blocks; both calls are env-var-driven via `RUSTUP_INSTALLER_SHA256` and `UV_INSTALLER_SHA256`; the comment block at :1228-1239 documents both env vars; behaviour with env vars unset is identical to pre-change.
+ </done>
+</task>
+
+<task type="auto">
+ <name>Task 3: Create tools.lock + wire install.sh install_tools() to consume it</name>
+ <files>tools.lock, install.sh</files>
+ <read_first>
+ - install.sh:293-355 (the `gotools` associative array — verify the exact module paths for `nuclei`, `httpx`, `ffuf`, `puredns`, `subfinder` so tools.lock RHS values match exactly)
+ - install.sh:489-525 (the current `install_tools()` body — the `for gotool in "${!gotools[@]}"; do ... go install -v "${gotools[$gotool]}@latest" ...` loop that will be extended)
+ - install.sh:1258-1290 (the `download_sha256` map iteration — the canonical env-var-driven optional lookup pattern that mirrors what `pinned_tools` will do)
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-CONTEXT.md sections "D-12" and "D-13"
+ - .planning/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md sections "tools.lock (new file, repo root)" and "install.sh:489-521 — Read tools.lock before iterating"
+ </read_first>
+ <action>
+ Per D-12 and D-13: Create a new file at the repo root `/Users/six2dez/Tools/reconftw/tools.lock` with exactly 5 pinned-tool entries plus header comments.
+
+ File contents:
+
+ ```text
+ # tools.lock — pinned Go tool versions for stability-critical tools.
+ # Format: <binary>=<go-module>@<version>
+ # - Comment lines start with '#'
+ # - Blank lines tolerated
+ # - Tools not listed here fall through to `go install <module>@latest` in install.sh
+ # - Update by running `go install <module>@latest` once and recording the resolved tag
+
+ nuclei=github.com/projectdiscovery/nuclei/v3/cmd/[email protected]
+ httpx=github.com/projectdiscovery/httpx/cmd/[email protected]
+ ffuf=github.com/ffuf/ffuf/[email protected]
+ puredns=github.com/d3mondev/puredns/[email protected]
+ subfinder=github.com/projectdiscovery/subfinder/v2/cmd/[email protected]
+ ```
+
+ Per CONTEXT.md D-12: the example version tags above are illustrative. The executor MUST verify the actual latest stable version tag at execution time and record the resolved value. Acceptable approaches:
+ - Run `go install -v <module>@latest` once for each of the 5 tools and read the resolved `@vX.Y.Z` tag from `go list -m -versions <module> | awk '{print $NF}'` or from the installed binary's `--version` output.
+ - Browse the upstream release page (e.g., https://github.com/projectdiscovery/nuclei/releases) and record the latest non-prerelease tag.
+
+ The exact module paths on the RHS MUST match the `gotools[<name>]` value in install.sh:293-355 character-for-character (verified path: `nuclei` → `github.com/projectdiscovery/nuclei/v3/cmd/nuclei`, etc., per PATTERNS.md). Mismatched paths will silently fall through to `@latest`.
+
+ Per D-13: ONLY these 5 tools are pinned. Do NOT add `anew`, `unfurl`, `qsreplace`, or any other Go tool. Commit `71653984` explicitly removed wholesale pinning; this plan re-introduces it only for the 5 stability-critical tools named in the success criterion.
+
+ File ends with a trailing newline.
+
+ Per D-12: In `install.sh`, extend `install_tools()` (lines 489-521) to read `tools.lock` into an associative array BEFORE the existing `for gotool in "${!gotools[@]}"; do ... done` loop. Target post-edit shape:
+
+ ```bash
+ function install_tools() {
+ header "Installing Golang tools (${#gotools[@]})"
+
+ export GOFLAGS="-mod=mod"
+ export GO111MODULE="on"
+
+ # Load optional tool pins from ./tools.lock (D-12 / SEC-04).
+ # Each line: <binary>=<module>@<version>. Comments (#) and blank lines ignored.
+ # If a tool listed here is also in $gotools, the lock entry wins; otherwise
+ # `go install @latest` is used. Errors loading tools.lock are non-fatal.
+ declare -A pinned_tools=()
+ local _lockfile="${SCRIPTPATH:-$(pwd)}/tools.lock"
+ if [[ -f "$_lockfile" ]]; then
+ local _key _val
+ while IFS='=' read -r _key _val; do
+ # Strip surrounding whitespace; skip blanks/comments
+ _key="${_key#"${_key%%[![:space:]]*}"}"
+ _key="${_key%"${_key##*[![:space:]]}"}"
+ [[ -z "$_key" || "$_key" == \#* ]] && continue
+ _val="${_val#"${_val%%[![:space:]]*}"}"
+ _val="${_val%"${_val##*[![:space:]]}"}"
+ [[ -z "$_val" ]] && continue
+ pinned_tools["$_key"]="$_val"
+ done < "$_lockfile"
+ msg_ok "Loaded ${#pinned_tools[@]} pin(s) from tools.lock"
+ fi
+
+ local go_step=0
+ local failed_tools=()
+ local total_go=${#gotools[@]}
+ local go_ok=0 go_skip=0 go_fail=0
+ for gotool in "${!gotools[@]}"; do
+ ((++go_step))
+ # Pinned version wins; otherwise fall through to @latest.
+ local _module_at_version
+ if [[ -n "${pinned_tools[$gotool]:-}" ]]; then
+ _module_at_version="${pinned_tools[$gotool]}"
+ else
+ _module_at_version="${gotools[$gotool]}@latest"
+ fi
+ if q go install -v "$_module_at_version"; then
+ ((++go_ok))
+ msg_ok "[$go_step/$total_go] ${gotool} installed"
+ else
+ # ... existing else branch unchanged ...
+ if command -v "$gotool" >/dev/null 2>&1; then
+ ((++go_skip))
+ msg_warn "[$go_step/$total_go] ${gotool} upgrade failed (existing binary kept)"
+ else
+ failed_tools+=("$gotool")
+ ((++go_fail))
+ double_check=true
+ msg_err "[$go_step/$total_go] ${gotool} failed"
+ fi
+ fi
+ done
+ # ... rest of install_tools (the failed_tools summary etc.) unchanged ...
+ ```
+
+ Notes:
+ - `SCRIPTPATH` is set by `reconftw.sh` but `install.sh` may run before reconftw.sh sources it; the fallback `${SCRIPTPATH:-$(pwd)}` covers both standalone-install and post-reconftw-load contexts.
+ - The lock value already includes the `@version` suffix from the file format, so `_module_at_version="${pinned_tools[$gotool]}"` directly contains the full `<module>@<version>` string. Do NOT append `@latest` to a pinned value.
+ - Whitespace stripping uses pure-Bash parameter expansion (no `sed`/`tr` dependency).
+ - Comment / blank line handling: `[[ -z "$_key" || "$_key" == \#* ]] && continue` covers `# comment`, empty lines, and whitespace-only lines.
+ - The `if [[ -n "${pinned_tools[$gotool]:-}" ]]` lookup is safe against unset keys (the `:-` default fallback works on associative-array reads in bash 4+).
+ - Unpinned tools (~50 of them) fall through to the existing `@latest` behaviour — no regression for tools outside the manifest.
+ - The "Loaded ${#pinned_tools[@]} pin(s) from tools.lock" `msg_ok` is informational; if the lockfile is missing the message is silently absent.
+ </action>
+ <verify>
+ <automated>test -f tools.lock && bash -n install.sh && grep -cE '^[a-z][a-z_]*=github\.com' tools.lock && grep -c 'pinned_tools' install.sh && grep -c 'tools.lock' install.sh</automated>
+ </verify>
+ <acceptance_criteria>
+ - `test -f tools.lock` exits 0 (file exists at repo root)
+ - `wc -l < tools.lock` returns at least 11 (6 comment lines + 1 blank + 5 entries; trailing newline allowed)
+ - `grep -cE '^[a-z][a-z_]*=github\.com' tools.lock` returns exactly `5` (5 entries, no extras per D-13)
+ - `grep -E '^nuclei=' tools.lock` returns 1 hit and the value matches `nuclei=github.com/projectdiscovery/nuclei/v3/cmd/nuclei@v[0-9.]+`
+ - `grep -E '^httpx=' tools.lock` returns 1 hit and the value matches `httpx=github.com/projectdiscovery/httpx/cmd/httpx@v[0-9.]+`
+ - `grep -E '^ffuf=' tools.lock` returns 1 hit and the value matches `ffuf=github.com/ffuf/ffuf/v2@v[0-9.]+`
+ - `grep -E '^puredns=' tools.lock` returns 1 hit and the value matches `puredns=github.com/d3mondev/puredns/v2@v[0-9.]+`
+ - `grep -E '^subfinder=' tools.lock` returns 1 hit and the value matches `subfinder=github.com/projectdiscovery/subfinder/v2/cmd/subfinder@v[0-9.]+`
+ - `bash -n install.sh` exits 0
+ - `grep -c 'pinned_tools' install.sh` returns at least `4` (declaration + lookup + value-read + the if-guard)
+ - `grep -c 'tools.lock' install.sh` returns at least `1` (the `_lockfile=` path)
+ - Parse smoke test: `bash -c 'declare -A pinned_tools=(); while IFS="=" read -r _k _v; do _k="${_k#"${_k%%[![:space:]]*}"}"; [[ -z "$_k" || "$_k" == \#* ]] && continue; pinned_tools["$_k"]="$_v"; done < tools.lock; echo "${#pinned_tools[@]}"'` outputs `5`
+ - Each LHS in `tools.lock` must match a key in `install.sh:gotools`: `for k in nuclei httpx ffuf puredns subfinder; do grep -qE "^\s*\\[\"$k\"\\]=" install.sh && echo OK || echo MISMATCH; done` outputs `OK` 5 times
+ - `shellcheck -s bash --severity=error install.sh` exits 0
+ </acceptance_criteria>
+ <done>
+ tools.lock exists at repo root with exactly 5 pinned entries; install.sh install_tools() reads the file into `pinned_tools` and consults it before the `for gotool` loop; pinned tools install at the recorded version; unpinned tools fall through to `@latest`; behaviour is backwards-compatible when tools.lock is absent.
+ </done>
+</task>
+
+</tasks>
+
+<threat_model>
+## Trust Boundaries
+
+| Boundary | Description |
+|----------|-------------|
+| user config → bash word-split | `AXIOM_EXTRA_ARGS` value from `reconftw.cfg` enters the shell as a string; legacy code path unquoted it for word-split. Intent invisible to readers. |
+| upstream HTTPS → executed shell | `install_rust_uv()` downloads scripts from `sh.rustup.rs` and `astral.sh/uv/install.sh` and pipes them to `sh "$_tmpfile"` — TLS protects transit but not source integrity. |
+| upstream Go module proxy → `go install` | `go install ...@latest` resolves to whatever the proxy returns at install time; a compromised upstream tag or a typo-squat could install attacker code. |
+
+## STRIDE Threat Register
+
+| Threat ID | Category | Component | Disposition | Mitigation Plan |
+|-----------|----------|-----------|-------------|-----------------|
+| T-02-03-01 | T (Tampering) | `$AXIOM_EXTRA_ARGS` unquoted word-split call sites | mitigate | Migration to `"${AXIOM_EXTRA_ARGS_ARR[@]}"` (D-08) makes tokenisation explicit and predictable. A future contributor cannot accidentally introduce a single-token value that breaks (`--rate-limit 100` would split correctly under the old bare form but break under the old quoted form). The array form has one tokenisation point (D-07 global parse) and one consumption shape (`"${...[@]}"`) — uniform across the codebase. |
+| T-02-03-02 | I (Information Disclosure) | Empty `AXIOM_EXTRA_ARGS` causing accidental empty-string arg | mitigate | D-07 guards the parse with `[[ -n "${AXIOM_EXTRA_ARGS:-}" ]]`; expanding `"${AXIOM_EXTRA_ARGS_ARR[@]}"` against an empty array produces zero arguments. No more `axiom-scan ... -o output.txt ""` empty-string positional injection. |
+| T-02-03-03 | T (Tampering) | Future re-introduction of `axiom_extra_args=()` local pattern | mitigate | D-09 explicitly removes the only existing local copy of this pattern; CONVENTIONS.md UPPER_SNAKE_CASE rules + PATTERNS.md make `"${AXIOM_EXTRA_ARGS_ARR[@]}"` the documented canonical form, steering future contributors away from per-function locals. |
+| T-02-03-04 | T (Tampering) | MITM / DNS hijack of `sh.rustup.rs` or `astral.sh/uv/install.sh` downloads | mitigate (opt-in) | `RUSTUP_INSTALLER_SHA256` and `UV_INSTALLER_SHA256` env vars (D-11) enable verification when set. Unset = legacy behaviour preserved (HTTPS-trust). CI / security-conscious users opt in. Hard-pinning was explicitly rejected per D-11 reasoning ("breaks on every upstream release without an opt-out"). |
+| T-02-03-05 | S (Spoofing) | Compromised upstream Go module replacing tagged release | mitigate (partial) | `tools.lock` pins 5 tools (D-12) by `<module>@<version>`. Go's module proxy verifies module-path-to-sha checksum on first download (`go.sum`-style), so a re-tag attack would be caught by Go's own verification — `tools.lock` makes the version explicit and re-installable. Tools outside the 5 named (D-13 scope cap) remain at `@latest` and inherit the unmitigated risk; this is accepted because re-introducing wholesale pinning was explicitly reverted in commit `71653984`. |
+| T-02-03-06 | R (Repudiation) | "Was the install bit-for-bit reproducible?" question for the 5 critical tools | mitigate | `tools.lock` makes the 5 critical tool versions auditable in git history; `git log -- tools.lock` shows the version-change trail. |
+| T-02-03-07 | D (Denial of Service) | Stale `tools.lock` version causing `go install` failure | accept | Pinned tools may break if the recorded tag is yanked or if a transitive dependency goes missing. `install.sh:518-520` (the `failed_tools` collector + `command -v "$gotool"` skip) provides the same graceful-degradation path that exists today. CI alerting on `install.sh` failure is the canonical fix. |
+| T-02-03-08 | E (Elevation of Privilege) | Malformed `tools.lock` line causing `go install` to receive attacker-controlled module path | accept | `tools.lock` is in the repo and edited by trusted contributors; the same trust applies as for `install.sh` itself. The parser uses pure-Bash parameter expansion (no `eval`); a malformed line silently skips. No new privilege surface. |
+
+**Residual risk:** Tools outside the 5 pinned (50+ of them) still install `@latest` — this is accepted per D-13. The `install_rust_uv` SHA verification is opt-in — users who don't set the env vars get pre-change behaviour. Both gaps are documented and have explicit user-driven mitigation paths.
+</threat_model>
+
+<verification>
+- `bash -n reconftw.sh modules/subdomains.sh modules/web.sh install.sh` → all exit 0
+- `grep -nE 'AXIOM_EXTRA_ARGS([^_]|$)' modules/subdomains.sh modules/web.sh` → 0 hits
+- `grep -c 'AXIOM_EXTRA_ARGS_ARR' reconftw.sh` → at least 2
+- `grep -c '"${AXIOM_EXTRA_ARGS_ARR\[@\]}"' modules/subdomains.sh` → exactly 21
+- `grep -c '"${AXIOM_EXTRA_ARGS_ARR\[@\]}"' modules/web.sh` → at least 16
+- `grep -n 'local -a axiom_extra_args=()' modules/web.sh` → 0 hits (D-09)
+- `grep -q "RUSTUP_INSTALLER_SHA256" install.sh && grep -q "UV_INSTALLER_SHA256" install.sh` → exit 0
+- `grep -c 'verify_sha256 "\$_tmpfile"' install.sh` → exactly 2
+- `test -f tools.lock` → exit 0
+- `grep -cE '^[a-z][a-z_]*=github\.com' tools.lock` → exactly 5
+- `grep -E '^(nuclei|httpx|ffuf|puredns|subfinder)=' tools.lock` → exactly 5 hits
+- `grep -c 'pinned_tools' install.sh` → at least 4
+- `shellcheck -s bash --severity=error reconftw.sh modules/subdomains.sh modules/web.sh install.sh` → exit 0
+- Tokenisation smoke: `bash -c 'AXIOM_EXTRA_ARGS="--rate-limit 100 --threads 50" source reconftw.sh --source-only; echo "${#AXIOM_EXTRA_ARGS_ARR[@]}"'` → `4`
+- Empty-env smoke: `bash -c 'unset AXIOM_EXTRA_ARGS; source reconftw.sh --source-only; echo "${#AXIOM_EXTRA_ARGS_ARR[@]}"'` → `0`
+- Backwards-compatible install smoke: `bash -c 'unset RUSTUP_INSTALLER_SHA256 UV_INSTALLER_SHA256; source install.sh 2>/dev/null; declare -f install_rust_uv >/dev/null && echo OK'` → `OK`
+- Lockfile parse smoke: `bash -c 'declare -A p=(); while IFS="=" read -r k v; do k="${k#"${k%%[![:space:]]*}"}"; [[ -z "$k" || "$k" == \#* ]] && continue; p["$k"]="$v"; done < tools.lock; echo "${#p[@]}"'` → `5`
+</verification>
+
+<success_criteria>
+- ROADMAP §"Phase 2" SC#3 satisfied: `AXIOM_EXTRA_ARGS` consumed as `AXIOM_EXTRA_ARGS_ARR=()` across `modules/subdomains.sh` and `modules/web.sh`; a value with intentional whitespace tokenises correctly (4 tokens); an empty/single-token value produces 0/1 array entries (no broken `--rate-limit 100`-style values).
+- ROADMAP §"Phase 2" SC#4 satisfied: `install.sh` calls `verify_sha256()` against pinned hashes for `rustup-init.sh` and `uv/install.sh` (when env vars set); aborts with `msg_err "... refusing to execute"` + `return 1` on mismatch; `tools.lock` pins versions for `nuclei`, `httpx`, `ffuf`, `puredns`, `subfinder`.
+- All `must_haves.truths` observable per the acceptance criteria above.
+- Backwards-compatible: users with no env vars and no `tools.lock` (e.g., installing from a tarball pre-Plan-02-03) get pre-change behaviour.
+- `webprobe_full` local `axiom_extra_args=()` block removed (D-09); no other function in `modules/web.sh` reintroduces the local-array pattern.
+- Scope cap honored: exactly 5 entries in `tools.lock` (D-13); no wholesale pinning re-introduction.
+</success_criteria>
+
+<output>
+After completion, create `.planning/phases/02-security-quoting-supply-chain-hygiene/02-03-SUMMARY.md`.
+</output>
+</content>
diff --git a/.planning/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md b/.planning/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md
new file mode 100644
index 0000000..abca539
--- /dev/null
+++ b/.planning/phases/02-security-quoting-supply-chain-hygiene/02-PATTERNS.md
@@ -0,0 +1,1001 @@
+# Phase 2: Security Quoting & Supply-Chain Hygiene - Pattern Map
+
+**Mapped:** 2026-05-13
+**Files analyzed:** 11 file/region scopes (across 3 plans 02-01 / 02-02 / 02-03)
+**Analogs found:** 11 / 11
+
+## File Classification
+
+| File / Region | Plan | Role | Data Flow | Closest Analog | Match Quality |
+|---------------|------|------|-----------|----------------|---------------|
+| `lib/common.sh:748-764` | 02-01 | delete | utility / counter | `lib/common.sh:122-140` (`count_lines`/`count_lines_stdin`) | exact-role |
+| `tests/unit/test_common.bats:253-266` | 02-01 | delete (tests) | bats `@test` blocks | `tests/unit/test_common.bats:253-255` (header banner pattern) | exact |
+| `tests/integration/test_full_flow.bats:245-256` | 02-01 | delete (tests) | bats `@test` block | `tests/integration/test_full_flow.bats:234-243` (sibling `@test` style) | exact |
+| `CHANGELOG.md:203`, `CLAUDE.md:283`, `.planning/codebase/CONVENTIONS.md:162-164`, `.planning/codebase/STRUCTURE.md:18`, `.planning/codebase/ARCHITECTURE.md:63` | 02-01 | update-in-place (docs) | text-substitution | (n/a — markdown) | n/a |
+| `modules/core.sh:1387-1417` (`sendToNotify`) | 02-02 | refactor (quote pass) | curl multi-form POST | `modules/core.sh:1380` (`transfer()` curl line — fully-quoted) | exact |
+| `modules/web.sh:2340` (1-char path fix) | 02-02 | update-in-place | string literal | commit `f64383c2` `install.sh:325` `gotools["mantra"]` lowercase | exact |
+| `reconftw.sh:~503-512` (insert global `AXIOM_EXTRA_ARGS_ARR` parse) | 02-03 | insert (global state) | `read -r -a` from string | `modules/web.sh:150-155` (existing IFS-juggling `read -r -a` block) + `modules/vulns.sh:258` (simpler `read -r -a`) | exact |
+| `modules/subdomains.sh` (21 sites) | 02-03 | refactor (var → array) | axiom-scan invocations | `modules/subdomains.sh:1300, 2227` (`"${webinfo_files[@]}"`, `"${cloud_enum_cmd[@]}"`) | role-match |
+| `modules/web.sh` (17 sites + delete local block) | 02-03 | refactor + delete-local-block | axiom-scan invocations | `modules/web.sh:179-202` (existing `axiom_cmd=(...)` + `axiom_extra_args[@]` append pattern) | exact |
+| `install.sh:159-188` (`install_rust_uv` SHA wiring) | 02-03 | refactor (insert verify) | `mktemp` → `curl -o` → `verify_sha256` → `sh "$_tmpfile"` | `install.sh:1240-1289` (`download_sha256` map + env-var-driven `verify_sha256` precedent) | exact |
+| `tools.lock` (new, repo root) | 02-03 | new-file (manifest) | key=value text | No existing analog — spec is verbatim from CONTEXT.md D-12 | none-fallback-to-spec |
+| `install.sh:489-521` (Go install loop reads `tools.lock`) | 02-03 | refactor (consume manifest) | `awk`/`while read` over text file | `install.sh:1258-1290` (`for key in "${!downloads[@]}"; do … "${download_sha256[$key]:-}"; do`) | role-match |
+
+## Pattern Assignments
+
+---
+
+### `lib/common.sh:748-764` — DELETE `safe_count()` (Plan 02-01 / D-01)
+
+**Analog:** `lib/common.sh:122-140` — the canonical `count_lines()` + `count_lines_stdin()` replacement helpers that must remain after deletion.
+
+**Existing function header / pattern to preserve next to the deletion** (`lib/common.sh:122-140`):
+
+```bash
+# Count non-empty lines in a file safely
+# Usage: count_lines filename
+# Returns: line count (0 if file doesn't exist or is empty)
+count_lines() {
+ local file="$1"
+ if [[ -s "$file" ]]; then
+ sed '/^$/d' "$file" | wc -l | tr -d ' '
+ else
+ echo 0
+ fi
+}
+
+# Count lines from stdin, with fallback to 0 on failure
+# Usage: result=$(command | count_lines_stdin)
+count_lines_stdin() {
+ local count
+ count=$(sed '/^$/d' | wc -l | tr -d ' ') || count=0
+ echo "${count:-0}"
+}
+```
+
+**Block to DELETE verbatim** (`lib/common.sh:748-764`):
+
+```bash
+# Count non-empty lines in a file safely
+# Usage: NUMOFLINES=$(safe_count "file_path")
+# NUMOFLINES=$(safe_count "command | pipeline") # legacy: still supported via eval
+# Always returns a valid number (0 on failure)
+safe_count() {
+ local result
+ if [[ -f "$1" ]]; then
+ # Safe path: count lines in file directly, no eval
+ result=$(sed '/^$/d' "$1" 2>/dev/null | wc -l | tr -d ' ') || result=0
+ else
+ # Legacy fallback for callers passing pipeline strings
+ # TODO: migrate remaining callers to pass file paths
+ result=$(eval "$1" 2>/dev/null | sed '/^$/d' | wc -l | tr -d ' ') || result=0
+ fi
+ [[ "$result" =~ ^[0-9]+$ ]] || result=0
+ echo "$result"
+}
+```
+
+**Quirks to respect:**
+- The blank line at line 747 (separator between `run_with_heartbeat_shell` end at 746 and the `safe_count` doc-comment start at 748) and the section header `###############################################################################` block at line 766 (`# Pipeline Helpers`) must remain intact. Delete only lines 748-764; the next sibling section divider keeps its position.
+- Zero live callers in `modules/*.sh` or `lib/*.sh` (verified via `grep -rn 'safe_count' . --include='*.sh'`). Only the 3 bats tests below reference it.
+- File-level source guard `[[ -n "$_COMMON_SH_LOADED" ]] && return 0` (line 6) is untouched.
+
+---
+
+### `tests/unit/test_common.bats:253-266` — DELETE 2 `@test` blocks + section header (Plan 02-01 / D-02)
+
+**Analog:** the surrounding `@test` blocks at `tests/unit/test_common.bats:240-251` (`run_tool` tests) and `:272+` (`process_results` tests). Both follow the same `@test "name" { ... }` pattern with a section banner above each cluster.
+
+**Section banner pattern above each cluster** (already present at `:253-255`):
+
+```bash
+###############################################################################
+# safe_count tests
+###############################################################################
+```
+
+**Block to DELETE verbatim** (`tests/unit/test_common.bats:253-266`):
+
+```bash
+###############################################################################
+# safe_count tests
+###############################################################################
+
+@test "safe_count returns valid number" {
+ printf "line1\nline2\n" > test.txt
+ result=$(safe_count "cat test.txt")
+ [ "$result" -eq 2 ]
+}
+
+@test "safe_count returns 0 on failure" {
+ result=$(safe_count "cat nonexistent_file_xyz.txt")
+ [ "$result" -eq 0 ]
+}
+```
+
+**Quirks to respect:**
+- Delete the 14-line block as one chunk: the section divider `###` lines AND the two `@test` blocks AND the trailing blank line before line 267 (`process_results tests` banner). Do NOT leave a dangling section header.
+- Both deleted tests pass pipeline-strings (`"cat test.txt"`, `"cat nonexistent_file_xyz.txt"`) — they exercised the eval branch specifically. There is nothing to port to `count_lines`; that helper is already covered by sibling tests in this file.
+- Maintain spacing/blank-line consistency: 1 blank line between `@test` blocks; 1 blank line before each `###...###` banner.
+
+---
+
+### `tests/integration/test_full_flow.bats:245-256` — DELETE 1 `@test` block (Plan 02-01 / D-02)
+
+**Analog:** sibling `@test` blocks `:234-243` (`notification skip works`) and `:257-263` (`parallel_funcs handles empty list`) — same `source_reconftw; source "$SCRIPTPATH/lib/common.sh"` setup pattern.
+
+**Block to DELETE verbatim** (`tests/integration/test_full_flow.bats:245-256`):
+
+```bash
+@test "full flow: safe_count handles missing files" {
+ source_reconftw
+
+ # shellcheck source=/dev/null
+ source "$SCRIPTPATH/lib/common.sh"
+
+ # Test with non-existent file
+ local count
+ count=$(safe_count "/nonexistent/file.txt")
+ [ "$count" -eq 0 ]
+}
+```
+
+**Quirks to respect:**
+- Delete the entire 12-line block (the `@test` plus the blank line that follows at line 256). Sibling tests above and below remain.
+- This test uses the file-path form (not pipeline-string), so it would superficially port to `count_lines`. Decision per CONTEXT.md D-02 is **delete, do not port** — `count_lines` is already covered by `test_common.bats`.
+
+---
+
+### Doc reference updates (Plan 02-01 / D-03)
+
+**5 files, each a 1-line substitution.** No analog needed; mechanical text replacement.
+
+| File | Line | Current | Replace with |
+|------|------|---------|--------------|
+| `CHANGELOG.md` | 203 | `` - `count_lines()`/`safe_count()` `` | `` - `count_lines()` `` |
+| `CLAUDE.md` | 283 | `... `count_lines`, `safe_count`, incident tracking ...` | `... `count_lines`, incident tracking ...` |
+| `.planning/codebase/CONVENTIONS.md` | 162-164 | The "**`safe_count()`** in `lib/common.sh` — always returns a valid integer:" example block referencing `safe_count` | Replace with a `count_lines` example, or drop entirely. CONVENTIONS.md is regenerated periodically — minimal touch: just retitle to `count_lines` and change the snippet to `NUMOFLINES=$(count_lines "subdomains/subdomains.txt")` with no legacy/eval mention. |
+| `.planning/codebase/STRUCTURE.md` | 18 | `│ ├── common.sh # File/dir helpers, incident tracking, count_lines, safe_count` | `│ ├── common.sh # File/dir helpers, incident tracking, count_lines` |
+| `.planning/codebase/ARCHITECTURE.md` | 63 | `| Shared file/counter utilities | `ensure_dirs`, `ensure_webs_all`, `safe_backup`, `count_lines`, `safe_count`, incident tracking | `lib/common.sh` |` | `| Shared file/counter utilities | `ensure_dirs`, `ensure_webs_all`, `safe_backup`, `count_lines`, incident tracking | `lib/common.sh` |` |
+
+**Quirks to respect:**
+- `.planning/PROJECT.md:46` Active bullet for SEC-01 is moved to Validated by the transition step — **do NOT edit here**.
+- Planner-level call (per CONTEXT.md Claude's Discretion): bundle these 5 edits in the same commit as the `safe_count` delete (`Plan 02-01`), OR split into a follow-up commit. Either is acceptable.
+
+---
+
+### `modules/core.sh:1387-1417` — `sendToNotify` full-function quoting pass (Plan 02-02 / D-04)
+
+**Analog (canonical fully-quoted curl pattern):** `modules/core.sh:1380` (`transfer()` function — the same file, ~7 lines above `sendToNotify`). Already uses `--data-binary "@/tmp/$file_name"` with the `@` form quoted as `"@..."`.
+
+**Existing fully-quoted pattern in `transfer()`** (`modules/core.sh:1380`):
+
+```bash
+run_command tar -czvf "/tmp/$file_name" "$file" >/dev/null 2>&1 && \
+ run_command curl -s "https://bashupload.com/${file_name}.tgz" \
+ --data-binary "@/tmp/$file_name" | grep wget
+```
+
+**Current `sendToNotify` body** (`modules/core.sh:1387-1417`) — **every bare/under-quoted expansion to fix**:
+
+```bash
+function sendToNotify {
+ if [[ -z $1 ]]; then
+ _print_status WARN "No file provided to send"
+ else
+ if [[ -z $NOTIFY_CONFIG ]]; then
+ NOTIFY_CONFIG=~/.config/notify/provider-config.yaml
+ fi
+ if [[ -n "$(find "${1}" -prune -size +8000000c)" ]]; then
+ _print_msg WARN "${1} is larger than 8MB, sending over external service"
+ transfer "${1}" | notify -silent
+ return 0
+ fi
+ if grep -q '^ telegram\|^telegram\|^ telegram' $NOTIFY_CONFIG; then
+ notification "Sending ${domain} data over Telegram" info
+ telegram_chat_id=$(sed -n '/^telegram:/,/^[^ ]/p' ${NOTIFY_CONFIG} | sed -n 's/^[ ]*telegram_chat_id:[ ]*"\([^"]*\)".*/\1/p')
+ telegram_key=$(sed -n '/^telegram:/,/^[^ ]/p' ${NOTIFY_CONFIG} | sed -n 's/^[ ]*telegram_api_key:[ ]*"\([^"]*\)".*/\1/p')
+ register_secret "$telegram_key"
+ run_command curl -F "chat_id=${telegram_chat_id}" -F "document=@${1}" https://api.telegram.org/bot${telegram_key}/sendDocument 2>>"$LOGFILE" >/dev/null
+ fi
+ if grep -q '^ discord\|^discord\|^ discord' $NOTIFY_CONFIG; then
+ notification "Sending ${domain} data over Discord" info
+ discord_url=$(sed -n '/^discord:/,/^[^ ]/p' ${NOTIFY_CONFIG} | sed -n 's/^[ ]*discord_webhook_url:[ ]*"\([^"]*\)".*/\1/p')
+ register_secret "$discord_url"
+ run_command curl -v -i -H "Accept: application/json" -H "Content-Type: multipart/form-data" -X POST -F 'payload_json={"username": "test", "content": "hello"}' -F file1=@${1} $discord_url 2>>"$LOGFILE" >/dev/null
+ fi
+ if [[ -n $slack_channel ]] && [[ -n $slack_auth ]]; then
+ notification "Sending ${domain} data over Slack" info
+ run_command curl -F file=@${1} -F "initial_comment=reconftw zip file" -F channels=${slack_channel} -H "Authorization: Bearer ${slack_auth}" https://slack.com/api/files.upload 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+}
+```
+
+**Target shape after the quoting pass** (every variable expansion quoted; matches the `transfer()` analog idiom):
+
+```bash
+function sendToNotify {
+ if [[ -z "${1}" ]]; then
+ _print_status WARN "No file provided to send"
+ else
+ if [[ -z "${NOTIFY_CONFIG}" ]]; then
+ NOTIFY_CONFIG=~/.config/notify/provider-config.yaml
+ fi
+ if [[ -n "$(find "${1}" -prune -size +8000000c)" ]]; then
+ _print_msg WARN "${1} is larger than 8MB, sending over external service"
+ transfer "${1}" | notify -silent
+ return 0
+ fi
+ if grep -q '^ telegram\|^telegram\|^ telegram' "${NOTIFY_CONFIG}"; then
+ notification "Sending ${domain} data over Telegram" info
+ telegram_chat_id=$(sed -n '/^telegram:/,/^[^ ]/p' "${NOTIFY_CONFIG}" | sed -n 's/^[ ]*telegram_chat_id:[ ]*"\([^"]*\)".*/\1/p')
+ telegram_key=$(sed -n '/^telegram:/,/^[^ ]/p' "${NOTIFY_CONFIG}" | sed -n 's/^[ ]*telegram_api_key:[ ]*"\([^"]*\)".*/\1/p')
+ register_secret "${telegram_key}"
+ run_command curl -F "chat_id=${telegram_chat_id}" -F "document=@${1}" "https://api.telegram.org/bot${telegram_key}/sendDocument" 2>>"$LOGFILE" >/dev/null
+ fi
+ if grep -q '^ discord\|^discord\|^ discord' "${NOTIFY_CONFIG}"; then
+ notification "Sending ${domain} data over Discord" info
+ discord_url=$(sed -n '/^discord:/,/^[^ ]/p' "${NOTIFY_CONFIG}" | sed -n 's/^[ ]*discord_webhook_url:[ ]*"\([^"]*\)".*/\1/p')
+ register_secret "${discord_url}"
+ run_command curl -v -i -H "Accept: application/json" -H "Content-Type: multipart/form-data" -X POST -F 'payload_json={"username": "test", "content": "hello"}' -F "file1=@${1}" "${discord_url}" 2>>"$LOGFILE" >/dev/null
+ fi
+ if [[ -n "${slack_channel}" ]] && [[ -n "${slack_auth}" ]]; then
+ notification "Sending ${domain} data over Slack" info
+ run_command curl -F "file=@${1}" -F "initial_comment=reconftw zip file" -F "channels=${slack_channel}" -H "Authorization: Bearer ${slack_auth}" https://slack.com/api/files.upload 2>>"$LOGFILE" >/dev/null
+ fi
+ fi
+}
+```
+
+**Per-line change inventory** (executor checklist):
+1. Line 1388: `[[ -z $1 ]]` → `[[ -z "${1}" ]]`
+2. Line 1391: `[[ -z $NOTIFY_CONFIG ]]` → `[[ -z "${NOTIFY_CONFIG}" ]]`
+3. Line 1399: `grep -q '...' $NOTIFY_CONFIG` → `grep -q '...' "${NOTIFY_CONFIG}"`
+4. Lines 1401-1402: `${NOTIFY_CONFIG}` already braced; wrap in double quotes → `"${NOTIFY_CONFIG}"` (twice).
+5. Line 1404: `https://api.telegram.org/bot${telegram_key}/sendDocument` is the trailing bare URL — quote the whole URL: `"https://api.telegram.org/bot${telegram_key}/sendDocument"`. The `-F` form pairs are already quoted with `${1}` braced and protected.
+6. Line 1406: `grep -q '...' $NOTIFY_CONFIG` → `"${NOTIFY_CONFIG}"`.
+7. Line 1408: `${NOTIFY_CONFIG}` → `"${NOTIFY_CONFIG}"`.
+8. Line 1410: bare `-F file1=@${1}` → `-F "file1=@${1}"`; bare `$discord_url` → `"${discord_url}"`.
+9. Line 1412: `[[ -n $slack_channel ]] && [[ -n $slack_auth ]]` → `[[ -n "${slack_channel}" ]] && [[ -n "${slack_auth}" ]]`.
+10. Line 1414: bare `-F file=@${1}` → `-F "file=@${1}"`; bare `-F channels=${slack_channel}` → `-F "channels=${slack_channel}"`.
+11. Line 1403 / 1409: `register_secret "$telegram_key"` and `register_secret "$discord_url"` are already correctly quoted — leave as-is (or normalize to `"${telegram_key}"` / `"${discord_url}"` for stylistic consistency).
+
+**Quirks to respect (D-05 shellcheck-clean policy):**
+- After the pass, `shellcheck modules/core.sh` must produce no new SC2086 / SC2068 / SC2027 findings in lines `:1387-1420`.
+- If any intentional word-split survives (none expected), use an inline `# shellcheck disable=SCXXXX` on the line above with a one-line explanation comment. **NEVER file-level** (CONVENTIONS.md:277).
+- Function declaration `function sendToNotify {` uses the parentheses-less form — preserve verbatim (it's the only function in `modules/core.sh` using this exact form; do not "normalize" it to `function sendToNotify()` as part of the quoting pass).
+
+---
+
+### `modules/web.sh:2340` — `Brosck` → `brosck` 1-char fix (Plan 02-02 / FIX-01 / D-06)
+
+**Analog:** commit `f64383c2644d1daa8e3c8a59ed4ce68e63c4b5b5` — the precedent local-install fix to `install.sh:325` (`gotools["mantra"]`).
+
+**Precedent diff** (`install.sh` from commit `f64383c2`):
+
+```diff
+- ["mantra"]="github.com/Brosck/mantra"
++ ["mantra"]="github.com/brosck/mantra"
+```
+
+**Currently confirmed lowercase in `install.sh:330`** (already merged):
+
+```bash
+ ["mantra"]="github.com/brosck/mantra"
+```
+
+**Block to FIX in `modules/web.sh:2336-2342`** (1-character change at line 2340):
+
+```bash
+ if [[ -s "js/js_livelinks.txt" ]]; then
+ if [[ $AXIOM != true ]]; then
+ cat js/js_livelinks.txt | mantra -ua \"$HEADER\" -s | anew -q js/js_secrets.txt 2>>"$LOGFILE" >/dev/null || true
+ else
+ axiom-exec "go install github.com/Brosck/mantra@latest" 2>>"$LOGFILE" >/dev/null # ← change Brosck to brosck
+ run_command axiom-scan js/js_livelinks.txt -m mantra -ua "$HEADER" -s -o js/js_secrets.txt "$AXIOM_EXTRA_ARGS" &>/dev/null
+ fi
+```
+
+**Target (post-fix):**
+
+```bash
+ axiom-exec "go install github.com/brosck/mantra@latest" 2>>"$LOGFILE" >/dev/null
+```
+
+**Quirks to respect:**
+- Line 2341 (`"$AXIOM_EXTRA_ARGS"`) is fixed separately by D-08 in the same plan (02-03). Plan 02-02's mantra fix touches only the `B`→`b` on line 2340.
+- Single-commit-per-logical-change: per CONTEXT.md the mantra fix is bundled with the sendToNotify pass in Plan 02-02. Whether to keep it as one commit or split is a planner call — established repo pattern is single logical change per commit; both fixes are part of "Plan 02-02 hardening pass" so one commit is the canonical outcome.
+
+---
+
+### `reconftw.sh:~503-512` — INSERT global `AXIOM_EXTRA_ARGS_ARR` parse (Plan 02-03 / D-07)
+
+**Analog:** `modules/web.sh:150-155` (existing `webprobe_full` local-pattern, to be removed by D-09) AND `modules/vulns.sh:258` (simpler one-line `read -r -a` precedent).
+
+**Existing IFS-juggling pattern at `modules/web.sh:150-155`** (the pattern to mirror at global scope):
+
+```bash
+ if [[ $AXIOM == true ]] && [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then
+ local _ifs="$IFS"
+ IFS=' '
+ read -r -a axiom_extra_args <<<"$AXIOM_EXTRA_ARGS"
+ IFS="$_ifs"
+ fi
+```
+
+**Simpler precedent at `modules/vulns.sh:258`** (single-line `read -r -a` from string):
+
+```bash
+ read -r -a params <<<"$query"
+```
+
+**Existing target region in `reconftw.sh:497-513`** (where the insert lands):
+
+```bash
+. "${SCRIPTPATH}"/reconftw.cfg || {
+ _print_error "Error importing reconftw.cfg"
+ exit 1
+}
+
+# Source optional secrets file (gitignored, for API keys and tokens)
+[[ -f "${SCRIPTPATH}/secrets.cfg" ]] && . "${SCRIPTPATH}/secrets.cfg"
+
+if [[ -s $CUSTOM_CONFIG ]]; then
+ # shellcheck source=/home/six2dez/Tools/reconftw/custom_config.cfg
+ . "${CUSTOM_CONFIG}" || {
+ _print_error "Error importing custom config"
+ exit 1
+ }
+fi
+
+# Re-apply CLI overrides after config load (config defaults should not clobber CLI flags)
+```
+
+**Insert this block** (canonical placement: after `CUSTOM_CONFIG` source completes on line 511, before the `CLI_*` re-apply on line 513 — anywhere between `secrets.cfg` source at 503 and the dispatch case at ~590 works per CONTEXT.md Claude's Discretion):
+
+```bash
+# Global parse of AXIOM_EXTRA_ARGS once after config load — single source of truth.
+# Consumed via "${AXIOM_EXTRA_ARGS_ARR[@]}" in modules/subdomains.sh and modules/web.sh.
+# Empty/unset env → empty array → expands to nothing at the call sites.
+declare -a AXIOM_EXTRA_ARGS_ARR=()
+if [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then
+ read -r -a AXIOM_EXTRA_ARGS_ARR <<<"${AXIOM_EXTRA_ARGS}"
+fi
+```
+
+**Quirks to respect:**
+- `reconftw.sh` ships `IFS=$'\n\t'` (top of file, per CONVENTIONS.md:11). `read -r -a` with `<<<` here-string respects the current `IFS`. **Either** restore IFS to `' '` for the parse like `modules/web.sh:151-154` does, **OR** rely on the fact that `<<<"$VAR"` word-splits on any `IFS` character (including `\n` and `\t`) which still produces the expected token list for space-separated values like `"--rate-limit 100 --threads 50"`. The simpler form (without IFS juggling) is acceptable because: (a) the top-level `IFS=$'\n\t'` is set but the `<<<` here-string still tokenises on whitespace including spaces, (b) the global parse runs **once** and is read-only thereafter, (c) `modules/vulns.sh:258` and lib/parallel.sh use the simple form. Recommend planner default to the IFS-aware form (mirroring `modules/web.sh:150-155`) for safety in case a future config value uses tabs.
+
+ Defensive variant (recommended):
+
+ ```bash
+ declare -a AXIOM_EXTRA_ARGS_ARR=()
+ if [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then
+ _axiom_ifs_saved="$IFS"
+ IFS=' '
+ read -r -a AXIOM_EXTRA_ARGS_ARR <<<"${AXIOM_EXTRA_ARGS}"
+ IFS="$_axiom_ifs_saved"
+ unset _axiom_ifs_saved
+ fi
+ ```
+
+- `set -u` is NOT used by reconftw (CONVENTIONS.md:11 lists `set +e`; CONVENTIONS.md:11 — no `set -u`). Expanding `"${AXIOM_EXTRA_ARGS_ARR[@]}"` when the array is empty is safe and expands to zero arguments.
+- `AXIOM_EXTRA_ARGS_ARR` is `UPPER_SNAKE_CASE` matching `AXIOM_EXTRA_ARGS`, `AXIOM`, `AXIOM_FLEET_COUNT` (CONVENTIONS.md:60-63).
+- Insertion lives BEFORE the `CLI_*` re-apply block intentionally — if a future CLI flag wants to override `AXIOM_EXTRA_ARGS`, the array would need to be re-parsed after the override. None today; revisit if added.
+
+---
+
+### `modules/subdomains.sh` (21 sites) — migrate `$AXIOM_EXTRA_ARGS` / `"$AXIOM_EXTRA_ARGS"` to `"${AXIOM_EXTRA_ARGS_ARR[@]}"` (Plan 02-03 / D-08)
+
+**Analog (array-expansion-in-axiom-scan-call surrounding context):** `modules/web.sh:179-202` (`axiom_cmd=(...)` + `axiom_extra_args[@]` append pattern — the cleanest existing example). Same module-style array+append usage that mirrors the target post-migration shape.
+
+**Existing same-module array expansion** (`modules/subdomains.sh:1300`, `:2227` — array-in-pipe and `run_command` array):
+
+```bash
+ if ! cat "${webinfo_files[@]}" 2>>"$LOGFILE" \
+```
+
+```bash
+ run_command "${cloud_enum_cmd[@]}" >>"$LOGFILE" 2>>"$LOGFILE" || cloud_enum_rc=$?
+```
+
+**Surrounding context for one site (typical pattern in 21-site list)** — `modules/subdomains.sh:665-674`:
+
+```bash
+ # Resolve subdomains using axiom-scan
+ if [[ -s ".tmp/subs_no_resolved.txt" ]]; then
+ run_command axiom-scan .tmp/subs_no_resolved.txt -m puredns-resolve \
+ -r ${AXIOM_RESOLVERS_PATH} \
+ --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
+ --wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" \
+ --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
+ -o .tmp/subdomains_tmp.txt $AXIOM_EXTRA_ARGS \
+ 2>>"$LOGFILE" >/dev/null
+ fi
+```
+
+**Target shape (per-site mechanical substitution):**
+
+```bash
+ run_command axiom-scan .tmp/subs_no_resolved.txt -m puredns-resolve \
+ -r ${AXIOM_RESOLVERS_PATH} \
+ --resolvers-trusted ${AXIOM_RESOLVERS_TRUSTED_PATH} \
+ --wildcard-tests "$PUREDNS_WILDCARDTEST_LIMIT" \
+ --wildcard-batch "$PUREDNS_WILDCARDBATCH_LIMIT" \
+ -o .tmp/subdomains_tmp.txt "${AXIOM_EXTRA_ARGS_ARR[@]}" \
+ 2>>"$LOGFILE" >/dev/null
+```
+
+**Authoritative 21-site checklist** (from `grep -nE 'AXIOM_EXTRA_ARGS' modules/subdomains.sh` — 20 axiom-scan call sites + 1 to verify is not a comment):
+
+| Line | Current form | Replace with |
+|------|--------------|--------------|
+| 672 | `$AXIOM_EXTRA_ARGS \` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" \` |
+| 737 | `$AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 745 | `$AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 768 | `$AXIOM_EXTRA_ARGS \` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" \` |
+| 962 | `"$AXIOM_EXTRA_ARGS" \` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" \` |
+| 1100 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 1107 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 1233 | `$AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 1366 | `$AXIOM_EXTRA_ARGS \` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" \` |
+| 1570 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 1587 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 1666 | `$AXIOM_EXTRA_ARGS \` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" \` |
+| 1742 | `$AXIOM_EXTRA_ARGS \` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" \` |
+| 1825 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 1838 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 1905 | `$AXIOM_EXTRA_ARGS \` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" \` |
+| 1926 | `$AXIOM_EXTRA_ARGS \` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" \` |
+| 1944 | `$AXIOM_EXTRA_ARGS \` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" \` |
+| 1990 | `$AXIOM_EXTRA_ARGS \` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" \` |
+| 2068 | `$AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 2197 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+
+**Note: CONTEXT.md lists 20 lines for subdomains.sh ("plus any duplicates revealed by grep"). The fresh grep above shows line 2197 as a 21st site that the CONTEXT.md author flagged with "plus any duplicates"** — executor MUST include line 2197.
+
+**Quirks to respect:**
+- Line continuations (`\`) and trailing redirections (`2>>"$LOGFILE" >/dev/null`) on the same physical line must be preserved exactly — the substitution is the token only, not the surrounding whitespace or continuation.
+- Of the 21 sites, ~11 use bare `$AXIOM_EXTRA_ARGS` (word-split intent) and ~10 use `"$AXIOM_EXTRA_ARGS"` (single-token bug). Both become the same `"${AXIOM_EXTRA_ARGS_ARR[@]}"` per CONTEXT.md D-08.
+- After substitution: run `grep -nE 'AXIOM_EXTRA_ARGS([^_]|$)' modules/subdomains.sh` — must return 0 hits except for the new `AXIOM_EXTRA_ARGS_ARR` references (D-10a verification).
+
+---
+
+### `modules/web.sh` (17 sites) — same migration as subdomains (Plan 02-03 / D-08)
+
+**Analog:** same pattern as `modules/subdomains.sh` migration. The clean axiom-call-without-locals invocation analog **after** D-09 removes the local block exists already at `modules/subdomains.sh:1825` post-migration: `run_command axiom-scan ... "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null`.
+
+**Authoritative 17-site checklist** (from `grep -nE 'AXIOM_EXTRA_ARGS' modules/web.sh` — excludes the 4 mentions in lines 144-155 / 199-200 which are handled by D-09):
+
+| Line | Current form | Replace with |
+|------|--------------|--------------|
+| 340 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 431 | `$AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 506 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 786 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 1008 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 1152 | `"$AXIOM_EXTRA_ARGS"` (no trailing redirect on same line) | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+| 1537 | `"$AXIOM_EXTRA_ARGS"` (run_with_heartbeat trailing) | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+| 1988 | `"$AXIOM_EXTRA_ARGS"` (run_with_heartbeat) | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+| 1990 | `"$AXIOM_EXTRA_ARGS"` (run_with_heartbeat) | `"${AXIOM_EXTRA_ARGS_ARR[@]}"` |
+| 2257 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 2280 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 2341 | `"$AXIOM_EXTRA_ARGS" &>/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" &>/dev/null` |
+| 2479 | `"$AXIOM_EXTRA_ARGS" 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 2925 | `$AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+| 2927 | `$AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null` | `"${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` |
+
+**Note: CONTEXT.md lists "17 sites in web.sh"; the fresh grep above shows 15 axiom-scan call-site lines + 2 occurrences inside the `webprobe_full` local block at lines 150 and 153. The 2 webprobe_full occurrences are removed entirely by D-09, and a new `"${AXIOM_EXTRA_ARGS_ARR[@]}"` replaces the `"${axiom_extra_args[@]}"` expansion at line 200. So the executor reconciliation is: 15 call-site substitutions + 1 substitution at line 200 (the array-expansion in the `axiom_cmd` append) + entire block-delete at 150-155 = the "17 sites" from CONTEXT.md. Cross-check at executor-time.**
+
+**Quirks to respect:**
+- Lines 1152, 1537, 1988, 1990 do NOT have a trailing `2>>"$LOGFILE"` on the same line — they end with `"$AXIOM_EXTRA_ARGS"` at line end (or follow `run_with_heartbeat "label"` argv form). Substitute the token only.
+- Line 2341 uses `&>/dev/null` (bash combined-redirect), not `2>>"$LOGFILE" >/dev/null` — preserve verbatim.
+- After substitution: run `grep -nE 'AXIOM_EXTRA_ARGS([^_]|$)' modules/web.sh` — must return 0 hits (D-10a).
+
+---
+
+### `modules/web.sh:144-155, 199-202` — REMOVE local `axiom_extra_args=()` block + replace expansion (Plan 02-03 / D-09)
+
+**Analog (the clean post-removal shape):** any `run_command axiom-scan ... "${AXIOM_EXTRA_ARGS_ARR[@]}" 2>>"$LOGFILE" >/dev/null` site after migration (e.g., the post-D-08 `modules/subdomains.sh:1825`).
+
+**Currently the most complex axiom-call wrapper in the codebase** (the block to dismantle, `modules/web.sh:144-202`):
+
+```bash
+ local probe_out=".tmp/web_full_info_probe.txt"
+ local common_json_tmp=".tmp/web_full_info_common_current.txt"
+ local uncommon_json_tmp=".tmp/web_full_info_uncommon_current.txt"
+ local -a axiom_extra_args=() # ← DELETE this line
+
+ : >"$probe_out" 2>/dev/null || true
+ : >"$common_json_tmp" 2>/dev/null || true
+ : >"$uncommon_json_tmp" 2>/dev/null || true
+
+ if [[ $AXIOM == true ]] && [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then # ← DELETE block (151-155)
+ local _ifs="$IFS"
+ IFS=' '
+ read -r -a axiom_extra_args <<<"$AXIOM_EXTRA_ARGS"
+ IFS="$_ifs"
+ fi # ← end DELETE block
+
+ if [[ $AXIOM != true ]]; then
+ local -a httpx_cmd=(
+ ...
+ )
+ run_command "${httpx_cmd[@]}" <subdomains/subdomains.txt 2>>"$LOGFILE" >/dev/null
+ else
+ local -a axiom_cmd=(
+ axiom-scan
+ subdomains/subdomains.txt
+ -m httpx
+ ...
+ -o "$probe_out"
+ )
+ if [[ ${#axiom_extra_args[@]} -gt 0 ]]; then # ← REPLACE 199-201
+ axiom_cmd+=("${axiom_extra_args[@]}")
+ fi
+ run_command "${axiom_cmd[@]}" 2>>"$LOGFILE" >/dev/null
+ fi
+```
+
+**Target shape (post-D-09):**
+
+```bash
+ local probe_out=".tmp/web_full_info_probe.txt"
+ local common_json_tmp=".tmp/web_full_info_common_current.txt"
+ local uncommon_json_tmp=".tmp/web_full_info_uncommon_current.txt"
+
+ : >"$probe_out" 2>/dev/null || true
+ : >"$common_json_tmp" 2>/dev/null || true
+ : >"$uncommon_json_tmp" 2>/dev/null || true
+
+ if [[ $AXIOM != true ]]; then
+ local -a httpx_cmd=(
+ ...
+ )
+ run_command "${httpx_cmd[@]}" <subdomains/subdomains.txt 2>>"$LOGFILE" >/dev/null
+ else
+ local -a axiom_cmd=(
+ axiom-scan
+ subdomains/subdomains.txt
+ -m httpx
+ ...
+ -o "$probe_out"
+ )
+ if [[ ${#AXIOM_EXTRA_ARGS_ARR[@]} -gt 0 ]]; then
+ axiom_cmd+=("${AXIOM_EXTRA_ARGS_ARR[@]}")
+ fi
+ run_command "${axiom_cmd[@]}" 2>>"$LOGFILE" >/dev/null
+ fi
+```
+
+**Per-line change inventory** (executor checklist):
+1. Line 144: DELETE ` local -a axiom_extra_args=()`
+2. Lines 150-155 inclusive: DELETE the 6-line `if/then/read/fi` block.
+3. Line 199: REPLACE `if [[ ${#axiom_extra_args[@]} -gt 0 ]]; then` → `if [[ ${#AXIOM_EXTRA_ARGS_ARR[@]} -gt 0 ]]; then`
+4. Line 200: REPLACE `axiom_cmd+=("${axiom_extra_args[@]}")` → `axiom_cmd+=("${AXIOM_EXTRA_ARGS_ARR[@]}")`
+
+**Quirks to respect:**
+- The append pattern (`axiom_cmd+=(...)`) is preserved because it's the cleanest way to conditionally extend an argv array when the source array might be empty. Bash 4.3+ behaviour means `axiom_cmd+=("${AXIOM_EXTRA_ARGS_ARR[@]}")` with an empty source array is a no-op — the `if [[ ${#...[@]} -gt 0 ]]` guard is now redundant but harmless. Planner may choose to drop the guard for simplicity (recommended) OR keep it for defensive symmetry with the rest of the function. **Recommendation: drop the guard**, reducing the post-D-09 block to one less line.
+- After dismantling: `local -a` declarations remaining in this function (`httpx_cmd`, `axiom_cmd`) are untouched; only the `axiom_extra_args` local goes away.
+- The block lives inside `webprobe_full()` (declared circa line 80) — this is a function-local refactor; nothing else in `webprobe_full` needs touching.
+
+---
+
+### `install.sh:159-188` (`install_rust_uv`) — WIRE `verify_sha256` calls (Plan 02-03 / SEC-04 / D-11)
+
+**Analog (canonical env-var-driven SHA pin):** `install.sh:1240-1289` — the `download_sha256` associative-array pattern with `${VAR:-}` defaults.
+
+**Canonical precedent at `install.sh:1240-1290`:**
+
+```bash
+ declare -A downloads=(
+ ["notify_provider_config"]="..."
+ ["getjswords"]="..."
+ ...
+ )
+
+ # Map of optional pinned checksums (env-var driven). Add more entries here
+ # to extend integrity checks. Empty string means "no verification".
+ declare -A download_sha256=(
+ ["getjswords"]="${GETJSWORDS_SHA256:-}"
+ ["axiom_config"]="${AXIOM_CONFIG_SHA256:-}"
+ )
+
+ local dl_step=0
+ local total_dl=${#downloads[@]}
+ for key in "${!downloads[@]}"; do
+ ((++dl_step))
+ url="${downloads[$key]% *}"
+ destination="${downloads[$key]#* }"
+
+ # Skip download if provider-config.yaml already exists
+ if [[ $key == "notify_provider_config" && -f $destination ]]; then
+ msg_warn "[$dl_step/$total_dl] $key skipped (already exists)"
+ continue
+ fi
+
+ # Ensure destination directory exists
+ mkdir -p "$(dirname "$destination")" 2>/dev/null || true
+
+ if with_spinner "[$dl_step/$total_dl] Fetching $key" retry 3 3 q_to 120 wget -q -O "$destination" "$url"; then
+ # Optional integrity check (active only when a SHA is pinned).
+ local _expected="${download_sha256[$key]:-}"
+ if [[ -n "$_expected" ]]; then
+ if verify_sha256 "$destination" "$_expected"; then
+ msg_ok "[$dl_step/$total_dl] $key fetched (sha256 verified)"
+ else
+ msg_err "[$dl_step/$total_dl] $key sha256 mismatch for $url; refusing to install"
+ rm -f "$destination"
+ continue
+ fi
+ else
+ msg_ok "[$dl_step/$total_dl] $key fetched"
+ fi
+ else
+ msg_err "[$dl_step/$total_dl] Failed to download $key from $url"
+ continue
+ fi
+ done
+```
+
+**`verify_sha256` helper signature** (`install.sh:82-102` — already defined, already used by D-11's analog):
+
+```bash
+verify_sha256() {
+ local file="$1"
+ local expected="$2"
+ local actual=""
+
+ [[ -n "$expected" ]] || return 0 # nothing to verify
+ [[ -s "$file" ]] || return 1
+
+ if command -v sha256sum >/dev/null 2>&1; then
+ actual=$(sha256sum "$file" | awk '{print $1}')
+ elif command -v shasum >/dev/null 2>&1; then
+ actual=$(shasum -a 256 "$file" | awk '{print $1}')
+ else
+ return 0 # no hashing tool available; skip (don't block install)
+ fi
+
+ [[ -n "$actual" && "$actual" == "$expected" ]]
+}
+```
+
+**Current `install_rust_uv()` body** (`install.sh:159-188`):
+
+```bash
+install_rust_uv() {
+ local _tmpfile
+ # Install rustup via downloaded script (verify before executing)
+ _tmpfile=$(mktemp "${TMPDIR:-/tmp}/rustup_install.XXXXXX")
+ if curl -sSf https://sh.rustup.rs -o "$_tmpfile" 2>/dev/null; then
+ sh "$_tmpfile" -y >/dev/null 2>&1
+ else
+ msg_warn "[!] Failed to download rustup installer"
+ fi
+ rm -f "$_tmpfile"
+
+ # shellcheck source=/dev/null
+ source "${HOME}/.cargo/env" 2>/dev/null || true
+ cargo install smugglex &>/dev/null
+
+ # Install uv via downloaded script (verify before executing)
+ _tmpfile=$(mktemp "${TMPDIR:-/tmp}/uv_install.XXXXXX")
+ if curl -LsSf https://astral.sh/uv/install.sh -o "$_tmpfile" 2>/dev/null; then
+ sh "$_tmpfile" &>/dev/null
+ else
+ msg_warn "[!] Failed to download uv installer"
+ fi
+ rm -f "$_tmpfile"
+
+ # shellcheck source=/dev/null
+ source "${HOME}/.local/bin/env" 2>/dev/null || export PATH="${HOME}/.local/bin:$PATH"
+ uv tool update-shell &>/dev/null || true
+ # Install shodan CLI via uv
+ uv tool install shodan --force &>/dev/null || uv tool upgrade shodan &>/dev/null || true
+}
+```
+
+**Target shape (post-D-11):**
+
+```bash
+install_rust_uv() {
+ local _tmpfile
+ local _expected
+ # Install rustup via downloaded script (verify before executing)
+ _tmpfile=$(mktemp "${TMPDIR:-/tmp}/rustup_install.XXXXXX")
+ if curl -sSf https://sh.rustup.rs -o "$_tmpfile" 2>/dev/null; then
+ _expected="${RUSTUP_INSTALLER_SHA256:-}"
+ if [[ -n "$_expected" ]]; then
+ if verify_sha256 "$_tmpfile" "$_expected"; then
+ msg_ok "[!] rustup installer sha256 verified"
+ sh "$_tmpfile" -y >/dev/null 2>&1
+ else
+ msg_err "[!] rustup installer sha256 mismatch; refusing to execute"
+ rm -f "$_tmpfile"
+ return 1
+ fi
+ else
+ sh "$_tmpfile" -y >/dev/null 2>&1
+ fi
+ else
+ msg_warn "[!] Failed to download rustup installer"
+ fi
+ rm -f "$_tmpfile"
+
+ # shellcheck source=/dev/null
+ source "${HOME}/.cargo/env" 2>/dev/null || true
+ cargo install smugglex &>/dev/null
+
+ # Install uv via downloaded script (verify before executing)
+ _tmpfile=$(mktemp "${TMPDIR:-/tmp}/uv_install.XXXXXX")
+ if curl -LsSf https://astral.sh/uv/install.sh -o "$_tmpfile" 2>/dev/null; then
+ _expected="${UV_INSTALLER_SHA256:-}"
+ if [[ -n "$_expected" ]]; then
+ if verify_sha256 "$_tmpfile" "$_expected"; then
+ msg_ok "[!] uv installer sha256 verified"
+ sh "$_tmpfile" &>/dev/null
+ else
+ msg_err "[!] uv installer sha256 mismatch; refusing to execute"
+ rm -f "$_tmpfile"
+ return 1
+ fi
+ else
+ sh "$_tmpfile" &>/dev/null
+ fi
+ else
+ msg_warn "[!] Failed to download uv installer"
+ fi
+ rm -f "$_tmpfile"
+
+ # shellcheck source=/dev/null
+ source "${HOME}/.local/bin/env" 2>/dev/null || export PATH="${HOME}/.local/bin:$PATH"
+ uv tool update-shell &>/dev/null || true
+ # Install shodan CLI via uv
+ uv tool install shodan --force &>/dev/null || uv tool upgrade shodan &>/dev/null || true
+}
+```
+
+**Documentation block to update at `install.sh:1228-1239`** (extend the GETJSWORDS / AXIOM_CONFIG example):
+
+```bash
+ # You can pin any entry by exporting an expected SHA-256 before running
+ # install.sh:
+ # export GETJSWORDS_SHA256=<64 hex chars>
+ # export AXIOM_CONFIG_SHA256=<64 hex chars>
+ # export RUSTUP_INSTALLER_SHA256=<64 hex chars> # rustup-init.sh from https://sh.rustup.rs
+ # export UV_INSTALLER_SHA256=<64 hex chars> # uv installer from https://astral.sh/uv/install.sh
+ # If set, each download is verified with `verify_sha256` and the install
+ # aborts on mismatch. If unset the previous upstream-trusting behaviour is
+ # preserved for backwards compatibility.
+```
+
+**Quirks to respect:**
+- `verify_sha256` returns 0 when no hash tool is available (`install.sh:98`: `return 0 # no hashing tool available; skip (don't block install)`). This is intentional skip-don't-block semantics — preserves install on systems without `sha256sum`/`shasum`. The new env-var path inherits this behaviour automatically.
+- `verify_sha256` returns 0 when `$expected` is empty (`install.sh:90`: `[[ -n "$expected" ]] || return 0`). The wrapping `if [[ -n "$_expected" ]]; then` is for the OK-msg path only; you could simplify by always calling `verify_sha256` and treating success as "either matched or skipped". Recommended structure (above) keeps the OK message explicit when verification was active, matching the `download_sha256` analog.
+- `local _expected` must be declared once at the top of the function (after `local _tmpfile`) — bash will complain about re-`local` declarations only with `set -u`, which isn't enabled, but stylistic consistency matters.
+- The `return 1` on mismatch ABORTS `install_rust_uv` but does NOT abort `install.sh` overall, because `install.sh` line 191 sets `trap … ERR` to log-and-continue. Per CONTEXT.md D-11 "aborts with a clear error message before executing it" — this means abort the bootstrapping, NOT the whole install. The `return 1` from `install_rust_uv` propagates up and the calling `install_apt`/`install_yum`/etc. will continue with other tools.
+- `msg_ok` / `msg_warn` / `msg_err` are already-defined UI helpers (`install.sh:193+` "Minimal UI helpers (classic style)").
+
+---
+
+### `tools.lock` (new file, repo root) — Go-tool version pins (Plan 02-03 / D-12)
+
+**Analog:** No existing manifest in the repo (verified: no `*.lock`, `requirements.txt`, `package.json` at repo root). Format spec is verbatim from CONTEXT.md D-12.
+
+**File path:** `/Users/six2dez/Tools/reconftw/tools.lock`
+
+**Format (CONTEXT.md D-12 verbatim):**
+
+```text
+# tools.lock — pinned Go tool versions for stability-critical tools.
+# Format: <binary>=<go-module>@<version>
+# - Comment lines start with '#'
+# - Blank lines tolerated
+# - Tools not listed here fall through to `go install <module>@latest` in install.sh
+# - Update by running `go install <module>@latest` once and recording the resolved tag
+
+nuclei=github.com/projectdiscovery/nuclei/v3/cmd/[email protected]
+httpx=github.com/projectdiscovery/httpx/cmd/[email protected]
+ffuf=github.com/ffuf/ffuf/[email protected]
+puredns=github.com/d3mondev/puredns/[email protected]
+subfinder=github.com/projectdiscovery/subfinder/v2/cmd/[email protected]
+```
+
+**Quirks to respect:**
+- **Version tags above are illustrative.** Per CONTEXT.md D-12 "Versions chosen by the planner via `go install ...@latest` once, recording the resolved tag." Executor must resolve actual `@latest` tags at execution time (e.g., `go list -m -versions github.com/projectdiscovery/nuclei/v3/cmd/nuclei` or watch `go install -v` output).
+- Module paths MUST match the corresponding `gotools[name]` value in `install.sh:300-328` exactly — `nuclei` → `github.com/projectdiscovery/nuclei/v3/cmd/nuclei`, `httpx` → `github.com/projectdiscovery/httpx/cmd/httpx`, `ffuf` → `github.com/ffuf/ffuf/v2`, `puredns` → `github.com/d3mondev/puredns/v2`, `subfinder` → `github.com/projectdiscovery/subfinder/v2/cmd/subfinder`.
+- Scope cap (D-13): exactly 5 entries. Do NOT add additional tools. Commit `71653984` explicitly removed wholesale pinning.
+- File ends with a trailing newline (standard text file).
+- Plain-text format chosen for `awk`/`sed` consumption and human-friendliness. Trailing whitespace per line is acceptable but discouraged (executor should `sed 's/[[:space:]]*$//'` if needed).
+
+---
+
+### `install.sh:489-521` — Read `tools.lock` before iterating (Plan 02-03 / D-12)
+
+**Analog:** `install.sh:1258-1290` (the `download_sha256` map iteration — env-var-driven branch + fallback default).
+
+**Existing Go install loop** (`install.sh:489-521`):
+
+```bash
+# Function to install Go tools
+function install_tools() {
+ header "Installing Golang tools (${#gotools[@]})"
+
+ # Force module-mode resolution so vendored or GOPATH-mode environments
+ # don't break go install for tools whose modules use SIV (e.g. /v2, /v3).
+ export GOFLAGS="-mod=mod"
+ export GO111MODULE="on"
+
+ local go_step=0
+ local failed_tools=()
+ local total_go=${#gotools[@]}
+ local go_ok=0 go_skip=0 go_fail=0
+ for gotool in "${!gotools[@]}"; do
+ ((++go_step))
+ # Always run go install so already-present binaries also get updated.
+ # argv form (not bash -lc) so arr values are data, not shell syntax.
+ if q go install -v "${gotools[$gotool]}@latest"; then
+ ((++go_ok))
+ msg_ok "[$go_step/$total_go] ${gotool} installed"
+ else
+ # If the binary is already present, the upgrade failed but the tool still works.
+ # Treat this as a warning rather than a hard failure.
+ if command -v "$gotool" >/dev/null 2>&1; then
+ ((++go_skip))
+ msg_warn "[$go_step/$total_go] ${gotool} upgrade failed (existing binary kept)"
+ else
+ failed_tools+=("$gotool")
+ ((++go_fail))
+ double_check=true
+ msg_err "[$go_step/$total_go] ${gotool} failed"
+ fi
+ fi
+ done
+```
+
+**Target shape (post-D-12):**
+
+```bash
+# Function to install Go tools
+function install_tools() {
+ header "Installing Golang tools (${#gotools[@]})"
+
+ # Force module-mode resolution so vendored or GOPATH-mode environments
+ # don't break go install for tools whose modules use SIV (e.g. /v2, /v3).
+ export GOFLAGS="-mod=mod"
+ export GO111MODULE="on"
+
+ # Load optional tool pins from ./tools.lock (D-12 / SEC-04).
+ # Each line: <binary>=<module>@<version>. Comments (#) and blank lines ignored.
+ # If a tool listed here is also in $gotools, the lock entry wins; otherwise
+ # `go install @latest` is used. Errors loading tools.lock are non-fatal.
+ declare -A pinned_tools=()
+ local _lockfile="${SCRIPTPATH:-$(pwd)}/tools.lock"
+ if [[ -f "$_lockfile" ]]; then
+ while IFS='=' read -r _key _val; do
+ # Strip surrounding whitespace; skip blanks/comments
+ _key="${_key#"${_key%%[![:space:]]*}"}" # ltrim
+ _key="${_key%"${_key##*[![:space:]]}"}" # rtrim
+ [[ -z "$_key" || "$_key" == \#* ]] && continue
+ _val="${_val#"${_val%%[![:space:]]*}"}"
+ _val="${_val%"${_val##*[![:space:]]}"}"
+ [[ -z "$_val" ]] && continue
+ pinned_tools["$_key"]="$_val"
+ done < "$_lockfile"
+ msg_ok "Loaded ${#pinned_tools[@]} pin(s) from tools.lock"
+ fi
+
+ local go_step=0
+ local failed_tools=()
+ local total_go=${#gotools[@]}
+ local go_ok=0 go_skip=0 go_fail=0
+ for gotool in "${!gotools[@]}"; do
+ ((++go_step))
+ # Pinned version wins; otherwise fall through to @latest.
+ local _module_at_version
+ if [[ -n "${pinned_tools[$gotool]:-}" ]]; then
+ _module_at_version="${pinned_tools[$gotool]}"
+ else
+ _module_at_version="${gotools[$gotool]}@latest"
+ fi
+ if q go install -v "$_module_at_version"; then
+ ((++go_ok))
+ msg_ok "[$go_step/$total_go] ${gotool} installed"
+ else
+ # If the binary is already present, the upgrade failed but the tool still works.
+ # Treat this as a warning rather than a hard failure.
+ if command -v "$gotool" >/dev/null 2>&1; then
+ ((++go_skip))
+ msg_warn "[$go_step/$total_go] ${gotool} upgrade failed (existing binary kept)"
+ else
+ failed_tools+=("$gotool")
+ ((++go_fail))
+ double_check=true
+ msg_err "[$go_step/$total_go] ${gotool} failed"
+ fi
+ fi
+ done
+```
+
+**Quirks to respect:**
+- The lockfile path uses `SCRIPTPATH:-$(pwd)` because `install.sh` is normally invoked from the repo root but `SCRIPTPATH` may not be set in standalone install invocations. CONTEXT.md D-12 specifies "plain-text `tools.lock` file in the repo root" — `SCRIPTPATH` resolution in `install.sh` predates this work; verify path resolution at execution time.
+- The `pinned_tools["$_key"]="$_val"` already INCLUDES the `@version` suffix from the lock value (per CONTEXT.md format: `nuclei=github.com/.../[email protected]`). So `_module_at_version="${pinned_tools[$gotool]}"` directly contains the full `<module>@<version>` string — do NOT append `@latest`.
+- The fallback for unpinned tools concatenates `@latest` exactly as the pre-D-12 loop did: `"${gotools[$gotool]}@latest"`.
+- Whitespace stripping uses Bash parameter-expansion idioms (no `sed`/`tr` dependency) — `_key="${_key#"${_key%%[![:space:]]*}"}"` etc. is the canonical pure-Bash ltrim/rtrim.
+- Comment / blank line handling: `[[ -z "$_key" || "$_key" == \#* ]] && continue` covers `# comment`, empty lines, and whitespace-only lines.
+- If `tools.lock` has a malformed line (missing `=` separator), `_val` is empty after the `read -r`, and the `[[ -z "$_val" ]] && continue` skips it. Graceful failure mode.
+- Manifest scope cap is enforced by the file itself (5 entries) — install.sh does not enforce a cap; it iterates `gotools` keys (50+) and looks up each in `pinned_tools`. So if `tools.lock` grows beyond 5 entries (against D-13), all entries still apply. The cap is policy, not mechanism.
+
+---
+
+## Shared Patterns
+
+### UPPER_SNAKE_CASE globals
+**Source:** `.planning/codebase/CONVENTIONS.md:60-63`
+**Apply to:** `AXIOM_EXTRA_ARGS_ARR` (D-07)
+**Existing siblings to slot alongside:** `AXIOM`, `AXIOM_EXTRA_ARGS`, `AXIOM_FLEET_COUNT`, `OUTPUT_VERBOSITY`, `PARALLEL_MODE` — all defined globally and read from any module without local shadowing.
+
+### `function name()` declaration form
+**Source:** `.planning/codebase/CONVENTIONS.md:43-49`
+**Apply to:** any new function added by Plan 02-03 (none currently planned; `verify_sha256` and `install_rust_uv` already exist and use the `name() { ... }` form, which is the established install.sh style — preserve it).
+
+### Inline shellcheck disables only
+**Source:** `.planning/codebase/CONVENTIONS.md:277`
+**Apply to:** D-05 (`sendToNotify` quoting pass)
+**Pattern:**
+
+```bash
+# shellcheck disable=SC2086 # word-split intentional for ARGS list
+some_cmd $ARGS
+```
+
+NEVER file-level. Place the disable comment on the line ABOVE the offending expansion with a one-line explanation.
+
+### `read -r -a` from a here-string idiom
+**Source:** `modules/web.sh:150-155`, `modules/vulns.sh:258`, `modules/web.sh:740`, `modules/web.sh:754`, `modules/web.sh:810`
+**Apply to:** D-07 (global `AXIOM_EXTRA_ARGS_ARR` parse)
+**Canonical excerpt** (`modules/web.sh:150-155`):
+
+```bash
+if [[ -n "${AXIOM_EXTRA_ARGS:-}" ]]; then
+ local _ifs="$IFS"
+ IFS=' '
+ read -r -a axiom_extra_args <<<"$AXIOM_EXTRA_ARGS"
+ IFS="$_ifs"
+fi
+```
+
+The global version (D-07) replaces `local _ifs` with `_axiom_ifs_saved` to make scope clear at top-level.
+
+### Env-var-driven optional verification
+**Source:** `install.sh:1240-1289` (`download_sha256` map pattern)
+**Apply to:** D-11 (`RUSTUP_INSTALLER_SHA256`, `UV_INSTALLER_SHA256`)
+**Semantics:** Empty env var = skip (don't block install). Set env var = verify, abort on mismatch. Behaviour-preserving for existing users; opt-in pinning for security-conscious users / CI.
+
+### Single-commit-per-logical-change
+**Source:** `.planning/PROJECT.md` §"Recent trajectory"; Phase 1 execution log
+**Apply to:** Plans 02-01, 02-02, 02-03
+**Application:**
+- Plan 02-01 = 1 commit (`safe_count` removal + bats deletes + doc updates), OR 2 commits (code + docs). Either is acceptable per CONTEXT.md Claude's Discretion.
+- Plan 02-02 = 1 commit (sendToNotify quoting + mantra path fix — both in `modules/`, both Plan 02-02 hardening).
+- Plan 02-03 = 3 commits (global parse + 38-site migration, install_rust_uv SHA wiring + comment block update, tools.lock manifest + install.sh consumer) — OR 1 large commit; planner judgment. Recommend 3 commits for review-ability since the array refactor touches 2 files + reconftw.sh, and tools.lock + install.sh consumer is logically separate from rustup/uv SHA wiring.
+
+### `_print_status`, `msg_ok`, `msg_warn`, `msg_err` UI helpers
+**Source:** `lib/common.sh:213-249` (`print_task` / `_print_status`); `install.sh` "Minimal UI helpers (classic style)" block circa line 193
+**Apply to:** D-04 (`sendToNotify` keeps `_print_status` / `_print_msg`), D-11 (`install_rust_uv` keeps `msg_ok` / `msg_warn` / `msg_err`)
+**Note:** `modules/core.sh` uses `_print_status` / `_print_msg`; `install.sh` uses `msg_ok` / `msg_warn` / `msg_err`. Do NOT cross-pollinate — each file's UI vocabulary is established.
+
+## No Analog Found
+
+| File | Role | Reason | Mitigation |
+|------|------|--------|------------|
+| `tools.lock` (new file) | new-file manifest | No existing `*.lock` or `requirements.txt`-style manifest in the repo. The closest pattern is the `download_sha256` associative-array declared in-line in `install.sh:1251-1254`, but it lives inside a function rather than as a separate file. | Follow CONTEXT.md D-12 spec verbatim. Plain-text key=value, `#` comments, blank lines tolerated. |
+
+## Metadata
+
+**Analog search scope:** `lib/common.sh`, `modules/core.sh`, `modules/web.sh`, `modules/subdomains.sh`, `modules/vulns.sh`, `modules/axiom.sh`, `modules/modes.sh`, `modules/utils.sh`, `lib/parallel.sh`, `lib/ui.sh`, `lib/validation.sh`, `reconftw.sh`, `install.sh`, `tests/unit/test_common.bats`, `tests/integration/test_full_flow.bats`, `CHANGELOG.md`, `CLAUDE.md`, `.planning/codebase/*`
+**Files scanned:** 19 source files + 5 doc files
+**Pattern extraction date:** 2026-05-13
+**Tooling required by executor:** `shellcheck` (pre-commit hook), `shfmt` (pre-commit hook), `bats-core` (test deletion verification), `go` (for resolving `@latest` tags during tools.lock authoring)