Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
6fe9cc1
Change subagent word limits, write full returns to disk for future re…
Apr 12, 2026
a0caa9f
Merge branch 'main' into minor_revisions_v202
Apr 15, 2026
4c2b8d8
Fix retrospective log collection missing subagent transcripts
Apr 21, 2026
36b5a07
Simplify install process: current-directory default, remove entrypoin…
Apr 21, 2026
9a95016
Add run_daaf and backup_daaf utility scripts for host-side convenience
Apr 21, 2026
da33a0c
Minor adjustment for readme docs for new install process
Apr 21, 2026
a5e1d05
Minor adjustments for new install path
Apr 21, 2026
835b11b
Add log viewer prototype and documentation wiring
Apr 21, 2026
5968c37
Install fixes for macosx
Apr 21, 2026
dd27e99
More minor install fixes for macosx
Apr 21, 2026
b769f8b
Add better error catching for convenience scripts
Apr 21, 2026
bbdce6b
Updated readme instructions for new install paths and utility scripts
Apr 21, 2026
4c902a2
Install and helper script updates
Apr 21, 2026
9cfa0cc
Add interactive log viewer scripts and tooling
Apr 23, 2026
b3115fe
Update install scripts and initialize first test of updating system
Apr 23, 2026
9267e93
Minor documentation updates for installation
Apr 23, 2026
fae8731
Add better update support via claude code and also add in better paus…
Apr 23, 2026
3eb84dd
Add some progression info to backup processes
Apr 23, 2026
93ed09d
Minor backup fixes
Apr 23, 2026
ef5b5fd
Minor updates to convenience scripts
Apr 23, 2026
7b86301
Minor adjustments to log viewer
Apr 23, 2026
e6c60c9
Adjustments to convenience scripts and fixes
Apr 23, 2026
4d8bb45
Minor efficiency fix for CLAUDE
Apr 23, 2026
fb3b831
Minor installation powershell fix
Apr 24, 2026
3a49bea
Minor adjustments to installation procedure to prevent frozen termina…
Apr 24, 2026
4f693d3
Add migration scripts, design doc, changelog, and user docs for v2.0.2
Apr 24, 2026
0b3126f
Update migration and update scripts to account for more edge cases
Apr 25, 2026
e23cf96
Update install.ps1 with split docker compose step
brhkim Apr 25, 2026
30255c3
Update rebuild_daaf.ps1 with split docker compose step
brhkim Apr 25, 2026
1a99edc
Update install.ps1 with another safety catch
brhkim Apr 25, 2026
b56a3d0
Additional fixes for migration, install, and rebuild scripts
Apr 25, 2026
30dddc5
Refine hooks and run_with_capture for robustness
Apr 26, 2026
f5c1dab
Add shell-scripting skill for Bash and PowerShell standards
Apr 26, 2026
31d4834
Move lifecycle scripts to scripts/host/ with safety hardening
Apr 26, 2026
a3cd998
Add CI pipeline, test infrastructure, and pre-commit ShellCheck
Apr 26, 2026
b689454
Add host-side .env file support for environment variables
Apr 26, 2026
20299ae
Minor cleanup
Apr 26, 2026
5afb3ce
Add test mode guards, behavioral tests, and testing infrastructure fo…
Apr 26, 2026
506d53c
Update Host Script Testing Plan with Session 2 implementation status
Apr 26, 2026
9cca2b7
Add local test execution section to plan document
Apr 26, 2026
118f55c
Add DAAF framework adherence benchmark harness (Phase 0)
Apr 26, 2026
518562c
Add .gitignore for benchmark results directory
Apr 26, 2026
4c7a54a
Add more info on env and openrouter to docs
Apr 26, 2026
e3e1761
Fix false-positive size mismatch warning in backup scripts
Apr 26, 2026
2bc5489
Fix all CI lint and test failures across ShellCheck, PSScriptAnalyzer…
Apr 26, 2026
344beaa
Additional linting fixes and changes
Apr 26, 2026
fdc360a
Fix convention lint broken pipe and PSScriptAnalyzer BOM warning
Apr 26, 2026
df0a175
Fix Windows argument-passing bug in backup and migrate PowerShell scr…
Apr 26, 2026
659207d
Fix context window detection for OpenRouter models
Apr 27, 2026
ef2bad5
Minor updates to dockerfile and related env
Apr 27, 2026
2cfc747
Add DAAF_DRY_RUN mode and cross-platform smoke CI for all lifecycle s…
Apr 27, 2026
a0ca960
Update Host Script Testing Plan with Session 3 completion details
Apr 27, 2026
c8ab529
Add Docker integration test CI workflow (Phase 5 of Host Script Testi…
Apr 27, 2026
040863e
Add prompt caching 1h for API users
Apr 27, 2026
b9fa54e
Fix CI smoke test hangs and linter warnings across all lifecycle scripts
Apr 27, 2026
fefb3d2
Suppress PSReviewUnusedParameter in dry-run Read-UserChoice overrides
Apr 27, 2026
d5536d0
Temporarily add push trigger for integration test validation
Apr 27, 2026
70af810
Fix container readiness check and simulate realistic migration eras
Apr 27, 2026
a14ebbe
Improve migration era simulation fidelity
Apr 27, 2026
efbc32b
Fix non-interactive prompt hang and migrate graft parent count bug
Apr 27, 2026
aa6bb1f
Fix grep -c || echo bug at 2 more sites, update prompt_choice tests
Apr 27, 2026
fb6f2e5
Fix test regressions from non-interactive prompt and Era 2 blob mismatch
Apr 27, 2026
532001d
Add era verification tests and fix PSScriptAnalyzer warnings
Apr 27, 2026
e5b4d24
Fix CI test failures: BOM, idempotency path, and tracking branch
Apr 27, 2026
3ccbc6a
remove dev dependencies in docker build
Apr 27, 2026
6a0e16f
Use /dev/tty for interactivity detection instead of stdin
Apr 28, 2026
ca7381a
Fix update script cross-platform sync and redundant COMPOSE_PROJECT_NAME
Apr 28, 2026
02faadc
Add marimo notebook browser convenience scripts
Apr 28, 2026
4e26655
Minor updates to references in installation guide
Apr 28, 2026
cf23312
Delete unnecessary plan files
Apr 28, 2026
f56bd66
Remove test_migration scripts from tracking
Apr 28, 2026
80a829b
Remove update capability from marimo launcher
Apr 28, 2026
ae72869
Streamlining of installation guide
Apr 28, 2026
c0605ef
Fix marimo update noise and add BOM to PowerShell script
Apr 28, 2026
8ff24be
Fixes for migration tests and installation guide
Apr 28, 2026
9a7ab14
Fixes for shell scripts as needed
Apr 28, 2026
be4736d
More fixes to updates
Apr 28, 2026
d1da850
Remove changelog file draft
Apr 28, 2026
e9ccc58
fix(host): inline trap handler exit logic to avoid iex scope issues
Apr 30, 2026
d8707d6
fix(host): strip UTF-8 BOMs and replace em-dashes with ASCII in all h…
Apr 30, 2026
641dc5e
fix(host): drop explicit -it flags from Claude Code launch in updater
Apr 30, 2026
f4239b9
fix(host): unwrap try {} around Claude Code launch in PS1 updater
Apr 30, 2026
7074434
fix(host): strip all wrapping from Claude Code launch in PS1 updater
Apr 30, 2026
69f6ff2
feat(framework): add escalation pathway from User Support update conf…
Apr 30, 2026
d300603
fix(host): restore EAP=SilentlyContinue wrapping for Claude Code launch
Apr 30, 2026
86047e2
fix(host): fix Claude Code TTY detection in PS1 update script
Apr 30, 2026
a661163
docs(skill): add PS expression-context TTY gotcha to shell-scripting
Apr 30, 2026
82381da
feat(host): add restore_from_backup script with interactive backup se…
Apr 30, 2026
862cc42
fix(host): align script listing columns in migrate_daaf output
Apr 30, 2026
64d1560
fix(host): fix CI smoke test and Pester failures for restore script
Apr 30, 2026
f5c4b51
test(ci): add backup-restore round-trip test to lifecycle workflow
Apr 30, 2026
e2c6d05
fix(test): use cross-platform temp path in restore Pester tests
Apr 30, 2026
7289187
feat(host): offer to stop running containers instead of erroring
Apr 30, 2026
14efb9d
fix(host): expand conflict prompts and fix -d flag swallowed by PS
Apr 30, 2026
f844e35
fix(host): use $args instead of [Parameter()] in PS wrapper functions
Apr 30, 2026
b4ce66e
fix(host): fix PS wrapper functions and array unwrapping in migrate/u…
Apr 30, 2026
9b459f7
Going to lose my mind if this doesn't work
Apr 30, 2026
a75165f
rename .env to environment_settings.txt for better discoverability
Apr 30, 2026
68aa510
refactor(host): extract handle_stash_conflict for consistent Claude C…
Apr 30, 2026
08887d4
Minor header image update
brhkim Apr 30, 2026
bcf7f9c
ci(integration): remove temporary per-push branch trigger
Apr 30, 2026
789633b
Various documentation updates and consistency fixes, initialize forma…
Apr 30, 2026
764f666
Changelog updates and fixes
May 1, 2026
3bbfb82
feat(log-viewer): display Thinking blocks with distinct styling
May 2, 2026
bc4dae5
Improvements to log viewer allowing project selection
May 2, 2026
2a02acb
security(docker): bind ports to localhost only to prevent LAN code ex…
May 2, 2026
421ec23
Implement code-server file editor
May 2, 2026
ef4e494
Updates to user documentation for new vscode inclusion
May 2, 2026
2976677
Update dockerfile to account for multiple architectures for VSCode
May 2, 2026
1ad84c4
Update CI pipeline for dockerfiles
May 2, 2026
39c068b
Arbitrary edit to launch CI
May 2, 2026
eaef22a
Integration CI fix
May 2, 2026
87be1a3
Add more info on reference loading failure modes
May 2, 2026
b9321ab
Comprehensive CI test hardening: ARM64 matrix, error-path tests, smok…
May 2, 2026
9c17971
Fixes to skills frontmatter given larger limit
May 2, 2026
df4ee61
Fix CI test failures: em-dash removal, mock patterns, exit code propa…
May 2, 2026
50fcf4c
Fix pwsh 7 smoke tests and Pester error-path exit code propagation
May 2, 2026
ba38fcf
Remove incorrect [DRY-RUN] smoke assertions for PS scripts
May 2, 2026
bd6d0fa
Fix force-reinstall failure: clear read-only git pack files before copy
May 2, 2026
73857cf
Guard cleanup step with || true for set -e compatibility
May 2, 2026
8f19c19
Fix no-backup restore test: cd to empty dir before running script
May 2, 2026
136e593
Replace tee pipeline with redirect+cat in failure resilience test
May 2, 2026
51db3f8
Fix no-backup restore test: stop container before testing error path
May 2, 2026
74b3096
Fix rebuild test: break Dockerfile inside container, not on host
May 2, 2026
6e28cf9
Add notes on VSCode bundle to changelog
May 3, 2026
8c3ecd7
Readme acknowledgments and citations update
May 3, 2026
b3d97cc
Add refresh intervals and live viewing functions to log viewer and ne…
May 3, 2026
7f3e3aa
Installation guide streamlining and updates
May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .claude/agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ All agents in this directory MUST follow the canonical template at `agent_refere

**All agents returning output to the orchestrator MUST respect these universal constraints:**

1. **Hard cap: 1000 words maximum** for Agent return output (exception: `data-ingest` agent uses a 2500-word cap because profiling findings feed directly into skill authoring and must be comprehensive)
1. **Hard cap: 2000 words maximum** for Agent return output (exception: `data-ingest` agent uses a 3500-word cap because profiling findings feed directly into skill authoring and must be comprehensive)
2. **Do NOT include:** Raw execution logs, data samples, Polars/pandas table displays, full checkpoint output, QA script code, or multi-paragraph explanations in any section
3. **Script files are the archive; the Agent return is the signal.** Execution logs are already appended to script files by `run_with_capture.sh`. Reference files by path — do not reproduce their contents.
4. **Summarize, don't echo.** "CP1 PASSED: 2,528 rows, 12 cols, 0.3% missing" — not the full stdout.

**Why this matters:** The orchestrator context window is shared across the entire pipeline. A single verbose subagent return (2,000+ words) consumes ~4,000 tokens. Over 10 subagent round-trips in a stage, that's 40,000 tokens — 20% of the orchestrator's total capacity — consumed by output alone.
**Why this matters:** The orchestrator context window is shared across the entire pipeline. A single verbose subagent return (4,000+ words) consumes ~8,000 tokens. Over 10 subagent round-trips in a stage, that's 80,000 tokens — a meaningful share of the orchestrator's capacity — consumed by output alone.

---

Expand Down Expand Up @@ -248,6 +248,8 @@ Shows which agents produce output consumed by other agents:
| **search-agent** | framework-engineer | Scoping findings (current state, affected files, patterns) | Framework Development Mode |
| **search-agent** | Orchestrator | Flexible findings report with confidence assessment | Any mode/stage |

**Preliminary Notes Persistence:** Discovery and profiling agents' full returns are persisted to `output/preliminary_notes/` as lossless markdown files by the orchestrator. Downstream agents reference these files by path for full-fidelity access, while the orchestrator retains compressed summaries for its own coordination. This applies to search-agent (Stage 2), source-researcher (Stage 3), research-synthesizer (Stage 3.5), and data-ingest (DI-3 through DI-6) returns. See orchestrator SKILL.md for the complete protocol.

---

## When to Use Each Agent
Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/code-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ When reviewing visualization scripts that produce PNG output, use the **Read too

## Output Format

**Hard cap: 1000 words maximum.** The orchestrator has limited context. Your output is a *verdict*, not a *transcript* — the cr/ script files contain the full investigation evidence.
**Hard cap: 2000 words maximum.** The orchestrator has limited context. Your output is a *verdict*, not a *transcript* — the cr/ script files contain the full investigation evidence.

**Do NOT include in your output:**
- Raw execution logs or captured stdout/stderr from QA scripts (these are appended to the cr/ files)
Expand Down
26 changes: 14 additions & 12 deletions .claude/agents/data-ingest.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ Read `agent_reference/SCRIPT_EXECUTION_REFERENCE.md` before writing any scripts.
| Output | Destination | Constraint | Purpose |
|--------|-------------|------------|---------|
| **Execution log** (stdout from script) | Appended to script file on disk | **No size limit** — the log is an archival artifact | Primary source material for DI-7 skill authoring |
| **Subagent return** (your response to orchestrator) | Orchestrator context window | **2500-word hard cap** | Signal for orchestrator decision-making and STATE.md |
| **Subagent return** (your response to orchestrator) | Orchestrator context window | **3500-word hard cap** | Signal for orchestrator decision-making and STATE.md |

**Scripts should print comprehensive, complete results to stdout.** For datasets under 100 columns, print EVERY column's full profile. The execution log costs nothing in context — it lives on disk. The DI-7 skill authoring subagent reads these logs as its primary source for building reference files. Thin execution logs produce thin skills.

**Your return to the orchestrator summarizes the key findings** within the 2500-word cap. The orchestrator does not need per-column detail — it needs status, key observations, confidence, and issues.
**Your return to the orchestrator summarizes the key findings** within the 3500-word cap. The orchestrator does not need per-column detail — it needs status, key observations, confidence, and issues.

### 5. Part-Scoped Execution

Expand Down Expand Up @@ -179,7 +179,7 @@ Part C writes: 07a_key-integrity.py, 07b_cross-level-linkage.py,
09a_quality-anomaly.py, 09b_quality-anomaly.py
```

**Invocation model:** The orchestrator invokes data-ingest ONCE per part, passing ALL file paths. The agent writes all per-file scripts and any cross-file scripts in that single invocation. The 2500-word return cap applies to the combined output summary.
**Invocation model:** The orchestrator invokes data-ingest ONCE per part, passing ALL file paths. The agent writes all per-file scripts and any cross-file scripts in that single invocation. The 3500-word return cap applies to the combined output summary.

**Key type comparison for 07b:** Before attempting join simulations, compare the declared linking key's type across files and flag mismatches as a BLOCKER (e.g., `leaid` stored as Int64 in file 1 but String in file 2).

Expand Down Expand Up @@ -211,7 +211,7 @@ When invoked, check the `profiling_part` parameter and execute the corresponding

3. **STOP — do NOT execute the script.** Return the script path and API findings to the orchestrator. The orchestrator presents the script to the user for approval before executing it, because DI-0 makes external network calls.

**DI-0 Output (return to orchestrator — 2500-word cap):** API findings (base URL, auth method, rate limits, pagination, complexity assessment), acquisition script path, expected output path, confidence assessment, issues encountered. Note: no download details yet — the script has not been executed.
**DI-0 Output (return to orchestrator — 3500-word cap):** API findings (base URL, auth method, rate limits, pagination, complexity assessment), acquisition script path, expected output path, confidence assessment, issues encountered. Note: no download details yet — the script has not been executed.

**When data was acquired via API:** Note the acquisition script path in your Part D interpretations for provenance. The script documents the exact API call, parameters, and download date.

Expand Down Expand Up @@ -249,7 +249,7 @@ When invoked, check the `profiling_part` parameter and execute the corresponding
- Script 03 MUST print coded value indicators (columns with negative values, sentinel values like 999/9999)
- For datasets under 100 columns, print EVERY column's profile — no abbreviation

**Part A Output (return to orchestrator — 2500-word cap):** Summarize schema, column type distribution, key observations, and conditional script recommendations. The execution logs contain the complete detail.
**Part A Output (return to orchestrator — 3500-word cap):** Summarize schema, column type distribution, key observations, and conditional script recommendations. The execution logs contain the complete detail.

### Part B: Statistical Deep Dive (Scripts 04-06)

Expand All @@ -272,7 +272,7 @@ When invoked, check the `profiling_part` parameter and execute the corresponding
- Script 05 (if run) MUST print the complete temporal coverage table with record counts per time period
- Script 06 (if run) MUST print full entity coverage results including coverage rate vs. known universe

**Part B Output (return to orchestrator — 2500-word cap):** Summarize distribution patterns, notable outliers, temporal/entity coverage highlights. The execution logs contain the complete detail.
**Part B Output (return to orchestrator — 3500-word cap):** Summarize distribution patterns, notable outliers, temporal/entity coverage highlights. The execution logs contain the complete detail.

### Part C: Relational Analysis (Scripts 07-09)

Expand Down Expand Up @@ -304,7 +304,7 @@ When invoked, check the `profiling_part` parameter and execute the corresponding
- Script 09 MUST print the COMPLETE coded value scan results: every sentinel value found, in which columns, with counts
- Script 09 MUST print the full anomaly catalog with severity classifications

**Part C Output (return to orchestrator — 2500-word cap):** Summarize recommended keys, dependency highlights, top anomalies. The execution logs contain the complete detail.
**Part C Output (return to orchestrator — 3500-word cap):** Summarize recommended keys, dependency highlights, top anomalies. The execution logs contain the complete detail.

### Part D: Interpretation & Reconciliation (Scripts 10-11)

Expand All @@ -326,7 +326,7 @@ When invoked, check the `profiling_part` parameter and execute the corresponding
- Script 10 MUST print semantic family groupings (identifiers, outcomes, demographics, etc.) covering all columns
- Script 11 (if run) MUST print the COMPLETE discrepancy report: every doc claim checked, with observed vs documented values

**Part D Output (return to orchestrator — 2500-word cap):** Summarize interpretation count, confidence distribution, key discrepancies. Include the full interpretation table for ALL columns (this is critical for PSU-DI2 user review). The execution logs contain additional detail.
**Part D Output (return to orchestrator — 3500-word cap):** Summarize interpretation count, confidence distribution, key discrepancies. Include the full interpretation table for ALL columns (this is critical for PSU-DI2 user review). The execution logs contain additional detail.

### Decision Points

Expand All @@ -342,7 +342,7 @@ When invoked, check the `profiling_part` parameter and execute the corresponding

## Output Format

Return part-specific findings in this structure (max 2500 words):
Return part-specific findings in this structure (max 3500 words):

### Part Summary
**Status:** [COMPLETE | COMPLETE_WITH_WARNINGS | BLOCKED]
Expand Down Expand Up @@ -416,6 +416,8 @@ Categories: Access | Data | Method | Perf | Process
| COMPLETE_WITH_WARNINGS | Log warnings; proceed with caution; may request user review |
| BLOCKED | Present STOP condition; await user resolution before re-invoking |

**Preliminary Notes Persistence:** The orchestrator writes the full, unmodified data-ingest return for each profiling part to `output/preliminary_notes/{date}_part{X}_{descriptor}.md` before extracting a summary. Subsequent profiling parts and the DI-7 skill authoring agent read these files directly for full-fidelity access to prior profiling findings.

</downstream_consumer>

---
Expand All @@ -429,7 +431,7 @@ Categories: Access | Data | Method | Perf | Process
- Include complete discrepancy report with evidence
- Archive all profiling scripts in the project's scripts directory
- Execute only the assigned profiling part
- Return findings within the 2500-word output cap
- Return findings within the 3500-word output cap
- Include conditional script recommendations in Part A output

### Ask First Before
Expand Down Expand Up @@ -549,7 +551,7 @@ Awaiting guidance before proceeding.
- Discrepancies are noted without evidence
- Preliminary interpretations are not marked as `[PRELIMINARY]`
- Conditional script decisions are not documented (Part A)
- Output exceeds 2500-word cap
- Output exceeds 3500-word cap

### Self-Check

Expand All @@ -563,7 +565,7 @@ Before returning output, verify:
| 4 | Are ALL semantic interpretations marked `[PRELIMINARY]`? | Add markers to every interpretation |
| 5 | Does the output include evidence for every discrepancy? | Add observed vs documented evidence |
| 6 | Are conditional script recommendations included (Part A)? | Add recommendations with rationale |
| 7 | Is the output within the 2500-word cap? | Compress findings tables; keep all columns represented but condense prose |
| 7 | Is the output within the 3500-word cap? | Compress findings tables; keep all columns represented but condense prose |
| 8 | Are all scripts written to the correct part subdirectory? | Move scripts to correct paths |

---
Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/research-executor.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ When you receive a revision request due to QA BLOCKER:

## Output Format

**Hard cap: 1000 words maximum.** The orchestrator has limited context. Your output is a *signal*, not an *archive* — the script files themselves are the audit trail.
**Hard cap: 2000 words maximum.** The orchestrator has limited context. Your output is a *signal*, not an *archive* — the script files themselves are the audit trail.

**Do NOT include in your output:**
- Raw execution logs or captured stdout/stderr (these are already appended to the script file)
Expand Down
2 changes: 2 additions & 0 deletions .claude/agents/research-synthesizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ Your synthesis is consumed by **data-planner** to create Plan.md and Plan_Tasks.

**Be opinionated, not wishy-washy.** The planner needs clear direction, not "consider either X or Y." Make recommendations with rationale. If two approaches are genuinely equivalent, pick one and state why.

**Preliminary Notes Persistence:** The orchestrator writes the full, unmodified research-synthesizer return to `output/preliminary_notes/{date}_stage3.5_research-synthesis.md` before extracting a summary. Downstream agents (data-planner, plan-checker, data-verifier) read this file directly for full-fidelity access to the synthesis findings.

</downstream_consumer>

---
Expand Down
2 changes: 2 additions & 0 deletions .claude/agents/source-researcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ Based on this source research:
- Source-specific coded values must be documented with handling actions
- Any Truth Hierarchy discrepancies must be explicitly documented

**Preliminary Notes Persistence:** The orchestrator writes the full, unmodified source-researcher return to `output/preliminary_notes/{date}_stage3_{source-name}_source-research.md` before extracting a summary for its own working memory. Downstream agents (research-synthesizer, data-planner, plan-checker, data-verifier) read these files directly for full-fidelity access to source research findings.

</downstream_consumer>

---
Expand Down
2 changes: 1 addition & 1 deletion .claude/hooks/archive-session.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Claude Code Session Archiver
# Archives complete session transcripts on session end
#
Expand Down
6 changes: 5 additions & 1 deletion .claude/hooks/audit-log.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# audit-log.sh — PostToolUse hook that logs every tool invocation
#
# Creates an append-only JSONL audit trail at .claude/logs/audit.jsonl.
Expand All @@ -20,6 +20,10 @@
# Hook event: PostToolUse (matcher: "")
# Registered in: .claude/settings.json

# -u: catch unset variable typos. Deliberately omit -e: this hook must
# never block execution — all error paths exit 0.
set -u

INPUT=$(cat)

# Parse fields from the hook JSON
Expand Down
12 changes: 10 additions & 2 deletions .claude/hooks/bash-safety.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# bash-safety.sh — PreToolUse hook that blocks dangerous Bash commands
#
# This is the primary safety guardrail for the DAAF environment. It reads
Expand All @@ -15,13 +15,21 @@
# rewrites remote history and is always blocked. Similarly, `curl <url>`
# is fine, but `curl <url> | bash` is arbitrary code execution.
#
# Hook event: PreToolUse (matcher: "Bash")
# Hook event: PreToolUse (matcher: "Bash")
# Registered in: .claude/settings.json

# Fail CLOSED: if anything unexpected goes wrong, block the command.
# This is a security hook — ambiguous failures must not silently allow execution.
trap 'echo "BLOCKED by bash-safety hook: unexpected error in safety check" >&2; exit 2' ERR

# --- Dependency check (fail-closed) ---
# Without jq, we cannot inspect the tool invocation JSON. Failing open here
# would silently bypass ALL safety checks, so we must block.
if ! command -v jq &>/dev/null; then
echo "BLOCKED by bash-safety hook: jq is not installed (required for hook)" >&2
exit 2
fi

INPUT=$(cat)

# Only inspect Bash tool calls
Expand Down
12 changes: 8 additions & 4 deletions .claude/hooks/context-reporter.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# context-reporter.sh — Multi-event context utilization & timestamp hook
#
# Injects context window utilization and a current timestamp into Claude's
Expand Down Expand Up @@ -31,6 +31,10 @@
# 0 = success (stdout/JSON processed by Claude Code)
# All error paths exit 0 to never block tool execution.

# -u: catch unset variable typos. Deliberately omit -e: this hook must
# never block tool execution — all error paths exit 0.
set -u

INPUT=$(cat)
HOOK_EVENT=$(echo "$INPUT" | jq -r '.hook_event_name // empty' 2>/dev/null) || HOOK_EVENT=""
SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // "default"' 2>/dev/null) || SESSION_ID="default"
Expand All @@ -49,7 +53,7 @@ if [[ -f "$CTX_CACHE" ]]; then
MAX_CONTEXT=$(cat "$CTX_CACHE" 2>/dev/null)
else
LATEST_CTX=$(ls -t /tmp/claude-ctx-window-* 2>/dev/null | head -1)
if [[ -n "$LATEST_CTX" ]]; then
if [[ -n "${LATEST_CTX:-}" ]]; then
MAX_CONTEXT=$(cat "$LATEST_CTX" 2>/dev/null)
fi
fi
Expand Down Expand Up @@ -118,7 +122,7 @@ cache_model() {
select(.message.model) | .message.model
' 2>/dev/null | head -1)

[[ -n "$model" ]] && echo "$model" > "$cache" 2>/dev/null
[[ -n "${model:-}" ]] && echo "$model" > "$cache" 2>/dev/null
}

# ---------------------------------------------------------------------------
Expand All @@ -137,7 +141,7 @@ fi

# Interval elapsed — calculate and emit
MSG=$(calculate "$TRANSCRIPT_PATH")
[[ -z "$MSG" ]] && exit 0
[[ -z "${MSG:-}" ]] && exit 0

# Update the shared timestamp gate
echo "$NOW" > "$LAST_INJECT_FILE" 2>/dev/null
Expand Down
2 changes: 1 addition & 1 deletion .claude/hooks/deny-claude-code-guide.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# deny-claude-code-guide.sh
# Blocks the claude-code-guide built-in agent from being spawned.
# This is a built-in agent with an opaque system prompt that doesn't
Expand Down
2 changes: 1 addition & 1 deletion .claude/hooks/enforce-explore-model.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# enforce-explore-model.sh
# Prevents Explore-type subagents from being launched with the haiku model.
# Explore agents need frontier-tier reasoning for thorough codebase analysis.
Expand Down
2 changes: 1 addition & 1 deletion .claude/hooks/enforce-file-first.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# enforce-file-first.sh — PreToolUse hook that blocks direct python execution
#
# Enforces the file-first execution protocol: all Python scripts must be
Expand Down
2 changes: 1 addition & 1 deletion .claude/hooks/enforce-foreground-agents.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# enforce-foreground-agents.sh
# Prevents agents from being launched in the background.
# Background agents cannot prompt for user permissions, which causes
Expand Down
1 change: 1 addition & 0 deletions .claude/hooks/first-run-transparency.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ DAAF generates transparent, auditable code and documentation so you CAN verify e
5. WHAT THIS MEANS IN PRACTICE:
- Always review core products from DAAF: early and often (e.g., preliminary scoping notes, research plan drafts)
- Scrutinize results with your domain knowledge, especially anything that implies causation
- Pay close attention to when DAAF loads reference files and Skills to inform and ground its work -- and make sure it's not taking shortcuts or going off of vibes
- Treat DAAF's output as a high-quality first draft requiring expert review, not as a finished product
- Know that DAAF's automated quality checks are strong but not infallible — they are one layer of defense, not the only one
- Review the References section in reports: DAAF does its best to track and attribute citations for data sources, methods, and tools used, but citations can be wrong, incomplete, or missing entirely — you should verify that the right things are credited and that the citations themselves are accurate
Expand Down
2 changes: 1 addition & 1 deletion .claude/hooks/flag-orchestrator-loaded.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# flag-orchestrator-loaded.sh — Set flag when daaf-orchestrator skill loads
#
# Hook: PostToolUse (matcher: "Skill")
Expand Down
2 changes: 1 addition & 1 deletion .claude/hooks/output-scanner.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# output-scanner.sh — PostToolUse hook that scans tool output for leaked secrets
#
# Checks tool_response content for patterns matching common credential formats:
Expand Down
Loading
Loading