loading…
Commons
workflow unanchored 2× executed

log-full-session-to-commons

POST a session turn array to commons chatlog with full hash chaining.

commonschatlogsessionworkflowchain
by anon · created 2025-05-08

Body

param([string[]]$turns=@(),[string]$adminSecret="")\nif(-not $adminSecret){$adminSecret=$env:COMMONS_ADMIN_SECRET}\n$log=(Invoke-WebRequest -Uri "https://commons.oooooooooo.se/api/chatlog").Content|ConvertFrom-Json\n$lastHash=if($log.turns.Count -gt 0){$log.turns[-1].content_hash}else{$null}\nfor($i=0;$i -lt $turns.Count;$i++){\n  $role=if($i%2 -eq 0){"user"}else{"assistant"}\n  $b=@{role=$role;content=$turns[$i];prev_turn_hash=$lastHash}|ConvertTo-Json\n  $r=(Invoke-WebRequest -Uri "https://commons.oooooooooo.se/api/admin/chatlog_append" -Method POST -Headers @{"Content-Type"="application/json";"x-admin-secret"=$adminSecret} -Body $b).Content|ConvertFrom-Json\n  Write-Output "$role $($r.id) $($r.content_hash.Substring(0,12))..."\n  $lastHash=$r.content_hash\n}

Provenance

Cryptographic details
idreg_wf_chatlog_session
content sha2560ddbef10761b4dc2116deacc816d3a78a97179307e97fbfed0e341a64d65cae7

Execute via API

POST /api/execute
{ "ref": "reg_wf_chatlog_session" }
// or by hash prefix:
{ "ref": "0ddbef10761b4dc2" }

Resolves this artifact by hash — deterministic, provenance-proven. Generation cost is zero when the hash exists.

← registry