Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1ce026f
wrapper: default to -Thick 3 for triple-click target
github-actions[bot] Oct 18, 2025
e4ac1e6
emitter: violet bars above/below one-line when -Thick>=2
github-actions[bot] Oct 18, 2025
dc1d8c0
wrapper: request triple-thick violet one-line (-Thick 3)
github-actions[bot] Oct 18, 2025
93a3411
emitter: draw violet bars above/below for Thick>=2/3
github-actions[bot] Oct 18, 2025
1a299b6
wrapper: always request triple-thick violet (-Thick 3)
github-actions[bot] Oct 18, 2025
62592d3
handshake: generate HANDSHAKE.md from CoCache intent
github-actions[bot] Oct 18, 2025
605529c
docs: link to CoSuite 101 training
github-actions[bot] Oct 18, 2025
5729baa
handshake: include Training from CoCache intent
github-actions[bot] Oct 18, 2025
caef85f
handshake: inject Training section before write
github-actions[bot] Oct 18, 2025
eeb6c38
handshake: resolve training.json relative to repos.json (+verbose)
github-actions[bot] Oct 18, 2025
10d2c10
handshake: clean helper; training relative to repos.json (+verbose)
github-actions[bot] Oct 18, 2025
0e6f58a
handshake: stable tail (no pipeline) + formatted verbose
github-actions[bot] Oct 18, 2025
268c982
handshake: make Write-Verbose a fresh statement (parser-safe)
github-actions[bot] Oct 18, 2025
77b6329
handshake: force Write-Verbose to start a new statement
github-actions[bot] Oct 18, 2025
491cd68
handshake: temporarily comment Write-Verbose for parser sanity
github-actions[bot] Oct 18, 2025
41bb379
status: CoSync (CDI 15% AMBER)
github-actions[bot] Oct 21, 2025
05cc951
status: CoSync (CDI 15% AMBER)
github-actions[bot] Oct 22, 2025
204cafc
cosync(policy): guard status/ & README for non-opted-in repos
github-actions[bot] Oct 22, 2025
369b00a
cosync: opt-in marker
github-actions[bot] Oct 22, 2025
3d42cdb
CoPrime: breadcrumb + latest pointers
github-actions[bot] Oct 25, 2025
887e3c6
CoPrime: breadcrumb + latest pointers
github-actions[bot] Oct 25, 2025
aa553da
docs(bpoe): pointer to CoCache canonical BPOE
github-actions[bot] Oct 28, 2025
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
Empty file added .cosync-allow
Empty file.
9 changes: 9 additions & 0 deletions .githooks/pre-commit.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$ErrorActionPreference="Stop"
$root = (git rev-parse --show-toplevel).Trim()
$optin = (Test-Path (Join-Path $root ".cosync-allow")) -or (Test-Path (Join-Path $root ".cosync.ok"))
$staged = & git diff --cached --name-only --diff-filter=ACMR
if(-not $optin -and ($staged | Where-Object { $_ -like "status/*" -or $_ -eq "README.md" })){
Write-Error "CoSync: repo is not opted-in but status/ or README changes are staged."
exit 1
}
exit 0
2 changes: 2 additions & 0 deletions COPRIME_BREADCRUMB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# CoPrime Breadcrumb
- Timestamp: 2025-10-25T00-41-29
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CoAgent
# CoAgent

Vendor-independent **BPOE middleware**: mandatory offloading (CoCache/CoTemp), heartbeat/guard with [OE:<glyph>], and multi-AI adapter.
**Scaffold only** — source-of-truth lives (for now) in:
Expand Down Expand Up @@ -73,3 +73,11 @@ Migration PRs will lift code/docs here; nothing moved yet.
- **Status panel:** https://rickballard.github.io/CoAgent/status.html (reads \status.json\)
- **Guardrails:** see \.coagent/guardrails/\ and smoke workflow.

## ▶ CoSuite Training
New to the stack? See **CoSuite 101** in CoCivium:
https://github.com/rickballard/CoCivium/tree/main/docs/training/CoSuite101
<!-- BEGIN: STATUS -->
### Operational Status
CoDrift Index: n/a% (n/a)
<!-- END: STATUS -->

21 changes: 21 additions & 0 deletions docs/HANDOFFS/HANDSHAKE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# HANDSHAKE

**Source:** CoCache · `docs/intent/repos.json`
**Updated:** 10/18/2025 11:08:55

## Repos
- CoAgent (agent/product) — C:\Users\Chris\Documents\GitHub\CoAgent
- CoAgent__mvp3_resume-20250923-111953Z (unknown) — C:\Users\Chris\Documents\GitHub\CoAgent__mvp3_resume-20250923-111953Z
- CoCache (index/canon) — C:\Users\Chris\Documents\GitHub\CoCache
- CoCivium (ethos/civium) — C:\Users\Chris\Documents\GitHub\CoCivium
- CoCivium-outreach (unknown) — C:\Users\Chris\Documents\GitHub\CoCivium-outreach
- CoCivium-website (unknown) — C:\Users\Chris\Documents\GitHub\CoCivium-website
- CoCivium.clean (unknown) — C:\Users\Chris\Documents\GitHub\CoCivium.clean
- CoCore (unknown) — C:\Users\Chris\Documents\GitHub\CoCore
- CoLaminar (unknown) — C:\Users\Chris\Documents\GitHub\CoLaminar
- CoModules (unknown) — C:\Users\Chris\Documents\GitHub\CoModules
- CoPolitic (policy) — C:\Users\Chris\Documents\GitHub\CoPolitic
- CoRef (unknown) — C:\Users\Chris\Documents\GitHub\CoRef
- CoSteward (ops/steward) — C:\Users\Chris\Documents\GitHub\CoSteward

> Generated by CoAgent/scripts/Consume-CoCacheRepos.ps1
7 changes: 7 additions & 0 deletions docs/bpoe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# BPOE pointers

Canonical BPOE lives in **CoCache**:
- Public rules: CoCache/public/bpoe/BPOE_Rules.md
- Receipts: CoCache/public/bpoe/receipts/

_This repo does not host canonical BPOE._
90 changes: 90 additions & 0 deletions scripts/Consume-CoCacheRepos.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)][string]$CoCacheRepos,
[Parameter(Mandatory=$true)][string]$OutHandshake
)

$ErrorActionPreference = 'Stop'

if (!(Test-Path -LiteralPath $CoCacheRepos)) {
throw "repos.json not found: $CoCacheRepos"
}

$dir = Split-Path -Parent $OutHandshake
if (!(Test-Path -LiteralPath $dir)) {
New-Item -ItemType Directory -Force -Path $dir | Out-Null
}

# ---- Read CoCache repos (support object {repos,updated} OR raw array) ----
$j = Get-Content $CoCacheRepos -Raw | ConvertFrom-Json
$repos = @()
if ($j -is [System.Collections.IEnumerable] -and -not ($j -is [pscustomobject])) {
$repos = @($j)
} elseif ($j -is [pscustomobject] -and $j.PSObject.Properties['repos']) {
$repos = @($j.repos)
}
$updated = if (($j -is [pscustomobject]) -and $j.PSObject.Properties['updated']) {
$j.updated
} else {
Get-Date -Format o
}

# ---- Build lines ----
$lines = @()
$lines += '# HANDSHAKE'
$lines += ''
$lines += '**Source:** CoCache · `docs/intent/repos.json`'
$lines += "**Updated:** $updated"
$lines += ''
$lines += '## Repos'
if ($repos.Count) {
$lines += ($repos | ForEach-Object {
$n = $_.name; $r = $_.role; $p = $_.path
if ([string]::IsNullOrWhiteSpace($n)) { $n = '(unnamed)' }
if ([string]::IsNullOrWhiteSpace($r)) { $r = 'unknown' }
if ([string]::IsNullOrWhiteSpace($p)) { $p = '(no path)' }
"- $n ($r) — $p"
})
} else {
$lines += '- (none found)'
}

# ---- Training (optional; resolved relative to repos.json) ----
$trainingPath = Join-Path (Split-Path -Parent $CoCacheRepos) 'training.json'
; Write-Verbose ("Training: path={0} exists={1}" -f $trainingPath, (Test-Path -LiteralPath $trainingPath))

if (Test-Path -LiteralPath $trainingPath) {
try {
$tj = Get-Content $trainingPath -Raw | ConvertFrom-Json
$tItems = @()
if ($tj -is [System.Collections.IEnumerable] -and -not ($tj -is [pscustomobject])) { $tItems = @($tj) }
elseif ($tj -is [pscustomobject]) { $tItems = @($tj) }

if ($tItems.Count) {
$lines += ''
$lines += '## Training'
$lines += ($tItems | ForEach-Object {
$id = $_.id; $title = $_.title; $path = $_.path
if ([string]::IsNullOrWhiteSpace($id)) { $id = '(id)' }
if ([string]::IsNullOrWhiteSpace($title)) { $title = '(title)' }
if ([string]::IsNullOrWhiteSpace($path)) { $path = '(path)' }
"- [$title]($path) — `$id`"
})
}
} catch {
$lines += ''
$lines += '## Training'
$lines += '- (failed to parse training.json)'
}
}

$lines += ''
$lines += '> Generated by CoAgent/scripts/Consume-CoCacheRepos.ps1'

$linesText = $lines -join [Environment]::NewLine
Set-Content -Encoding UTF8 -Path $OutHandshake -Value $linesText
; Write-Verbose ("Wrote {0}" -f $OutHandshake)




85 changes: 85 additions & 0 deletions scripts/Emit-CoPongReceipt.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
[CmdletBinding()]
param(
[string]$SessionId,
[string]$CycleId,
[int]$Attempt = 1,
[string]$Status = 'ready',
[string]$RepoName = 'CoRepo',
[string]$Branch = 'main',
[string]$Prev = '-',
[string]$NewSha = '',
[string]$LinesUp = '',
[string]$LinesDown = '',
[ValidateSet('violet','orange')] [string]$Theme = 'violet',
[switch]$OneLine
)

$ErrorActionPreference = 'Stop'; Set-StrictMode -Version Latest

# --- Resolve commit + branch if callers omitted them
try {
if (-not $NewSha) { $NewSha = (git rev-parse --short HEAD) }
if (-not $Branch) { $Branch = (git rev-parse --abbrev-ref HEAD) }
} catch { }

# --- Remote probe (accurate push/PR status)
try {
$localFull = (git rev-parse HEAD) ; $localShort = $localFull.Substring(0,7)
$remoteRef = "refs/heads/$Branch"
$remoteSha = (git ls-remote origin $remoteRef | Select-String '^\S+' | ForEach-Object { $_.Matches[0].Value })
if ([string]::IsNullOrWhiteSpace($remoteSha)) {
$RemoteStatus = 'needs-PR'
} elseif ($remoteSha.Substring(0,7) -eq $localShort) {
$RemoteStatus = 'pushed'
} else {
$counts = (git rev-list --left-right --count origin/$Branch...$Branch 2>$null) -split '\s+'
if ($counts.Count -ge 2 -and [int]$counts[1] -gt 0) { $RemoteStatus = 'ahead-unpushed' } else { $RemoteStatus = 'diverged' }
}
} catch { $RemoteStatus = 'unknown' }

# --- ANSI theme
$esc = [char]27
$supportsVT = $Host.Name -ne 'ConsoleHost' -or $PSStyle.OutputRendering -ne 'PlainText'
$color = if ($Theme -eq 'orange') { '38;5;208' } else { '38;5;135' }
$on = $supportsVT ? "$esc[$color" + "m" : ''
$off = $supportsVT ? "$esc[0m" : ''

# --- Outputs
$plain = @"
===== CoPONG RECEIPT BEGIN =====
session_id: $SessionId cycle_id: $CycleId attempt: $Attempt status: $Status
commit: prev $Prev -> new $NewSha repo: $RepoName branch: $Branch remote: $RemoteStatus
$LinesUp
$LinesDown
TTL: 3d
===== CoPONG RECEIPT END =====
"@.Trim()

if ($OneLine) {
$compact = ("# CoPONG:" +
" session_id=$SessionId" +
" cycle_id=$CycleId" +
" attempt=$Attempt" +
" status=$Status" +
" remote=$RemoteStatus" +
" commit_prev=$Prev" +
" commit_new=$NewSha" +
" repo=$RepoName" +
" branch=$Branch" +
" " + ($LinesUp -replace "`n",' ') +
" " + ($LinesDown -replace "`n",' ')
).Trim()
Write-Host ""
Write-Output $compact
Write-Host ""
} else {
Write-Host ""
Write-Host ($on + ('='*64)) -NoNewline; Write-Host $off
Write-Host ($on + " CoPONG RECEIPT ($SessionId/$CycleId $Status) ") -NoNewline; Write-Host $off
Write-Host ($on + ('='*64)) -NoNewline; Write-Host $off
Write-Host ""
$plain | Write-Output
Write-Host ""
}


32 changes: 32 additions & 0 deletions scripts/Emit-OneLineReceipt.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[CmdletBinding()]
param(
[string]$SessionId,
[string]$CycleId,
[int]$Attempt = 1,
[string]$Status = "ready",
[string]$RepoName = "CoRepo",
[string]$Branch = "main",
[string]$Prev = "-",
[string]$NewSha = "",
[string]$LinesUp = "",
[string]$LinesDown = ""
)
$ErrorActionPreference="Stop"; Set-StrictMode -Version Latest
$Here = Split-Path -Parent $MyInvocation.MyCommand.Path

# Try to enable ANSI (guarded)
try { . (Join-Path $Here "Set-CoAnsi.ps1") } catch {}

# Call the emitter in OneLine mode and capture its single plain line
$line = & (Join-Path $Here "Emit-CoPongReceipt.ps1") @PSBoundParameters -OneLine | Out-String
$line = $line.Trim()

# Color the single line here (violet); emit exactly one line, no headers
$esc = [char]27
$supports = ($Host.Name -ne 'ConsoleHost') -or ($PSStyle.OutputRendering -ne 'PlainText')
$on = $supports ? "$esc[38;5;135m" : ''
$off = $supports ? "$esc[0m" : ''
Write-Host ($on + $line + $off)



5 changes: 5 additions & 0 deletions scripts/Set-CoAnsi.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$ErrorActionPreference='Stop'; Set-StrictMode -Version Latest
try{
$supports = ($Host.Name -ne 'ConsoleHost') -or ($PSStyle.OutputRendering -ne 'PlainText')
if($supports){ $PSStyle.OutputRendering = 'ANSI' }
}catch{}
8 changes: 8 additions & 0 deletions status/codrift.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"generatedUtc": "2025-10-22T14:36:43.3194041Z",
"score": 15,
"status": "AMBER",
"components": {
"sample": 1
}
}