Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6ee9285
chore: add Set-StrictMode and $ErrorActionPreference to .ps1 entry-po…
EnmaJim May 20, 2026
c7c5b21
chore: add -Encoding utf8NoBOM to Set-Content/Add-Content/Out-File calls
EnmaJim May 20, 2026
40631ae
refactor(atlassian-download): replace Write-Warning with Write-BotLog
EnmaJim May 20, 2026
310baa5
refactor(ui/server): log port-probe cleanup errors via Write-BotLog
EnmaJim May 20, 2026
1e44ac2
refactor: log empty-catch suppressions via Write-BotLog
EnmaJim May 20, 2026
d5ccc1a
refactor(InboxWatcher): log worker-log append errors via Write-BotLog
EnmaJim May 20, 2026
7a6671c
test: add error-handling and file-encoding enforcement gates
EnmaJim May 20, 2026
bbf7ca6
fix: stop Set-StrictMode leak when dot-sourcing helper scripts
EnmaJim May 21, 2026
97b5a26
fix(runtime): guard optional property reads in workflow exec path
EnmaJim May 21, 2026
7f63920
test: add regression guards for strict-mode dot-source leak
EnmaJim May 21, 2026
9316143
fix(claude-cli): surface exit code and stderr on stdin write failure
EnmaJim May 21, 2026
91318fe
fix(workflow): regenerate Claude session ID per retry attempt
EnmaJim May 21, 2026
3ec2de4
fix(workflow): clean session artefacts per retry and log session id
EnmaJim May 21, 2026
f89106a
fix(mcp): guard optional JSON-RPC fields under strict mode
EnmaJim May 21, 2026
da3216a
fix(strict-mode): init vars to avoid unset reads on early throw
EnmaJim May 21, 2026
97968bf
refactor: initialize local variables before try blocks
EnmaJim May 21, 2026
e6b2fee
style: remove extra empty lines after set-strictmode
EnmaJim May 21, 2026
9d48149
fix: safeguard object property access under strict mode
EnmaJim May 21, 2026
a9009b8
fix: cast dynamic values to string before method calls
EnmaJim May 21, 2026
3dcfa75
test: support dictionary task shapes in manifest tests
EnmaJim May 21, 2026
b265481
fix: ensure strict mode 3.0 compatibility across tools and tests
EnmaJim May 22, 2026
9f5fab5
fix: resolve ps strict mode issues and background stderr drain
EnmaJim May 22, 2026
29ce8bf
test: fix response dictionary validation in session-get-stats tests
EnmaJim May 22, 2026
b9dbd43
fix(worktree): suppress git command output leaking into pipelines
EnmaJim May 22, 2026
da8d4ec
style: collapse extra blank lines from strict-mode audit
EnmaJim May 22, 2026
3401bf1
style: tighten blank lines inside strict-mode directive block
EnmaJim May 22, 2026
a91611f
style: drop redundant strict-mode leak-guard comments
EnmaJim May 22, 2026
516f9ca
style: drop comments added without modifying a prior comment
EnmaJim May 22, 2026
bed32f8
fix(test): make session-retry mock cross-platform on windows
EnmaJim May 25, 2026
bbeb12f
fix(test): use POSIX [[:space:]] in dot-source git grep for macos
EnmaJim May 25, 2026
d59b156
fix(ui): invalidate workflows cache when processes dir changes
EnmaJim May 25, 2026
91094ad
Merge branch 'main' of github.com:andresharpe/dotbot into chore/issue…
EnmaJim May 27, 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
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Force LF for unix shell shims (macOS rejects CRLF shebangs)
tests/claude text eol=lf

*.ps1 text eol=lf
*.psm1 text eol=lf
*.psd1 text eol=lf
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- dotbot:framework-protection -->
## dotbot framework files (READ-ONLY)

NEVER modify files under `.bot/` except `.bot/workspace/`.

Framework files under `.bot/core/`, `.bot/hooks/`, `.bot/recipes/`, and `.bot/settings/*.default.json` are managed by dotbot. Direct edits are rejected by a pre-commit hook and detected by verification hooks. To update framework files, run `dotbot init --force`.
<!-- /dotbot:framework-protection -->
7 changes: 7 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- dotbot:framework-protection -->
## dotbot framework files (READ-ONLY)

NEVER modify files under `.bot/` except `.bot/workspace/`.

Framework files under `.bot/core/`, `.bot/hooks/`, `.bot/recipes/`, and `.bot/settings/*.default.json` are managed by dotbot. Direct edits are rejected by a pre-commit hook and detected by verification hooks. To update framework files, run `dotbot init --force`.
<!-- /dotbot:framework-protection -->
2 changes: 2 additions & 0 deletions core/go.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ param(
[switch]$Headless
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# Get directories
Expand Down Expand Up @@ -69,6 +70,7 @@ $uiPortFile = Join-Path $controlDir "ui-port"
if (Test-Path $uiPortFile) {
$existingPort = (Get-Content $uiPortFile -Raw).Trim()
if ($existingPort -match '^\d+$') {
$url = $null
try {
$resp = Invoke-WebRequest -Uri "http://localhost:$existingPort/api/info" -TimeoutSec 2 -ErrorAction Stop
if ($resp.StatusCode -eq 200) {
Expand Down
4 changes: 4 additions & 0 deletions core/hooks/dev/Start-Dev.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env pwsh

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# ═══════════════════════════════════════════════════════════════
# FRAMEWORK FILE — DO NOT MODIFY IN TARGET PROJECTS
# Managed by dotbot. Overwritten on 'dotbot init --force'.
Expand Down
4 changes: 4 additions & 0 deletions core/hooks/dev/Stop-Dev.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env pwsh

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# ═══════════════════════════════════════════════════════════════
# FRAMEWORK FILE — DO NOT MODIFY IN TARGET PROJECTS
# Managed by dotbot. Overwritten on 'dotbot init --force'.
Expand Down
4 changes: 4 additions & 0 deletions core/hooks/scripts/commit-bot-state.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env pwsh

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# ═══════════════════════════════════════════════════════════════
# FRAMEWORK FILE — DO NOT MODIFY IN TARGET PROJECTS
# Managed by dotbot. Overwritten on 'dotbot init --force'.
Expand Down
4 changes: 4 additions & 0 deletions core/hooks/scripts/steering.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ param(
[string]$Priority = 'normal'
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# Import theme for consistent output
$themePath = Join-Path $PSScriptRoot "../../core/runtime/modules/DotBotTheme.psm1"
if (Test-Path $themePath) {
Expand All @@ -62,6 +65,7 @@ function Get-RunningProcesses {
if (Test-Path $processesDir) {
$procFiles = Get-ChildItem -Path $processesDir -Filter "*.json" -File -ErrorAction SilentlyContinue
foreach ($pf in $procFiles) {
$proc = $null
try {
$proc = Get-Content $pf.FullName -Raw | ConvertFrom-Json
if ($proc.status -eq 'running') {
Expand Down
3 changes: 3 additions & 0 deletions core/hooks/verify/00-privacy-scan.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ param(
[switch]$StagedOnly
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# Scan repo for sensitive data before commit
$issues = @()
$details = @{
Expand Down
3 changes: 3 additions & 0 deletions core/hooks/verify/01-git-clean.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ param(
[string]$Category
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# Check for uncommitted changes outside .bot/
$issues = @()
$warnings = @()
Expand Down
3 changes: 3 additions & 0 deletions core/hooks/verify/02-git-pushed.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ param(
[string]$Category
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# Check for unpushed commits
$issues = @()
$details = @{}
Expand Down
3 changes: 3 additions & 0 deletions core/hooks/verify/03-check-md-refs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ param(
[string]$RepoRoot
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# Validate .bot/recipes/, .bot/workflows/.../recipes/, and .bot/core/ path
# references in markdown, JSON, and YAML source files against the actual
# source tree.
Expand Down
3 changes: 3 additions & 0 deletions core/hooks/verify/04-framework-integrity.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ param(
[string]$Category
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# Framework integrity verify hook.
# Detects modifications to .bot/ files that should only change via
# `dotbot init --force`. Combines a SHA256 manifest check (catches
Expand Down
2 changes: 2 additions & 0 deletions core/init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
[CmdletBinding()]
param()

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# Get script and project directories
Expand All @@ -42,6 +43,7 @@ $providerDirs = @(
$providerConfigs = @{}
if (Test-Path $ProvidersDir) {
Get-ChildItem $ProvidersDir -Filter "*.json" | ForEach-Object {
$config = $null
try {
$config = Get-Content $_.FullName -Raw | ConvertFrom-Json
$providerConfigs[$config.name] = $config
Expand Down
3 changes: 3 additions & 0 deletions core/mcp/Resolve-ProjectRoot.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ function Resolve-DotbotProjectRoot {
[string]$StartPath
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

if (-not (Test-Path -LiteralPath $StartPath)) {
return $null
}
Expand Down
13 changes: 11 additions & 2 deletions core/mcp/dotbot-mcp-helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
.DESCRIPTION
Shared utility functions for JSON-RPC communication and date parsing
#>


function Write-JsonRpcResponse {
param(
[Parameter(Mandatory)]
[object]$Response
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

try {
$json = $Response | ConvertTo-Json -Depth 100 -Compress
Expand Down Expand Up @@ -42,6 +43,10 @@ function Write-JsonRpcError {

[object]$Data = $null
)


Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

$error = @{
jsonrpc = '2.0'
Expand All @@ -64,6 +69,10 @@ function Get-DateFromString {
[string]$DateString,
[string]$Format = $null
)


Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

if ([string]::IsNullOrWhiteSpace($DateString)) {
return [DateTime]::Now
Expand Down
31 changes: 20 additions & 11 deletions core/mcp/dotbot-mcp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[CmdletBinding()]
param()

Set-StrictMode -Version 3.0
$ErrorActionPreference = 'Stop'
$InformationPreference = 'SilentlyContinue'
$ProgressPreference = 'SilentlyContinue'
Expand Down Expand Up @@ -93,10 +94,11 @@ foreach ($toolDirItem in $toolDirs) {
$metadataPath = Join-Path $toolDir "metadata.yaml"

if ((Test-Path $scriptPath) -and (Test-Path $metadataPath)) {
$toolMetadata = $null
try {
# Load tool script
. $scriptPath

# Load tool metadata
$toolMetadata = Get-Content $metadataPath -Raw | ConvertFrom-Yaml

Expand Down Expand Up @@ -125,6 +127,7 @@ if (Test-Path $workflowsDir) {
$scriptPath = Join-Path $toolDir "script.ps1"
$metadataPath = Join-Path $toolDir "metadata.yaml"
if ((Test-Path $scriptPath) -and (Test-Path $metadataPath)) {
$toolMetadata = $null
try {
. $scriptPath
$toolMetadata = Get-Content $metadataPath -Raw | ConvertFrom-Yaml
Expand Down Expand Up @@ -221,6 +224,7 @@ function Invoke-CallTool {
throw "Unknown tool: $Name"
}

$result = $null
try {
# Convert tool name to function name: get_current_datetime -> Invoke-GetCurrentDateTime
# ToUpperInvariant ensures Turkish/Azerbaijani locales don't fold "i" -> "İ".
Expand Down Expand Up @@ -258,6 +262,9 @@ function Start-McpServerLoop {
[Console]::Error.WriteLine("Loaded $($tools.Count) tools")

while ($true) {
$id = $null
$params = @{}
$toolName = $null
try {
$line = [Console]::ReadLine()

Expand All @@ -266,22 +273,24 @@ function Start-McpServerLoop {
}

$request = $line | ConvertFrom-Json -AsHashtable

$method = $request.method
$id = $request.id
$params = if ($request.params) { $request.params } else { @{} }

# Handle notifications (no id) separately

# Use ContainsKey/bracket access so optional JSON-RPC fields do not
# trigger PropertyNotFoundStrict under Set-StrictMode -Version 3.0.
$method = if ($request.ContainsKey('method')) { $request['method'] } else { $null }
$id = if ($request.ContainsKey('id')) { $request['id'] } else { $null }
$params = if ($request.ContainsKey('params')) { $request['params'] } else { @{} }

if ($null -eq $id -and $method -like 'notifications/*') {
# Notifications don't require a response
continue
}

$result = switch ($method) {
'initialize' { Invoke-Initialize -Params $params }
'tools/list' { Invoke-ListTools }
'tools/call' {
Invoke-CallTool -Name $params.name -Arguments $(if ($params.arguments) { $params.arguments } else { @{} })
'tools/call' {
$toolName = if ($params.ContainsKey('name')) { $params['name'] } else { $null }
$toolArgs = if ($params.ContainsKey('arguments')) { $params['arguments'] } else { @{} }
Invoke-CallTool -Name $toolName -Arguments $toolArgs
}
default {
if ($null -ne $id) {
Expand Down
7 changes: 6 additions & 1 deletion core/mcp/modules/Extract-CommitInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.EXAMPLE
Get-TaskCommitInfo -TaskId "7b012fb8" -MaxCommits 100
#>

function Get-TaskCommitInfo {
[CmdletBinding()]
param(
Expand All @@ -36,6 +35,9 @@ function Get-TaskCommitInfo {
[string]$ProjectRoot = $PWD
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

# Extract short task ID (first 8 characters)
$shortTaskId = $TaskId.Substring(0, [Math]::Min(8, $TaskId.Length))

Expand Down Expand Up @@ -120,6 +122,9 @@ function Get-CommitFileChanges {
[string]$CommitSha
)

Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

$created = @()
$deleted = @()
$modified = @()
Expand Down
1 change: 1 addition & 0 deletions core/mcp/modules/FrameworkIntegrity.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ function Invoke-FrameworkIntegrityGate {
[string]$TaskId
)

$integrity = $null
Push-Location $ProjectRoot
try {
$integrity = Test-FrameworkIntegrity
Expand Down
Loading
Loading