Project rumination chronology as relative time
This commit is contained in:
parent
c07faaaabc
commit
332c0b4d55
9 changed files with 458 additions and 76 deletions
368
scripts/lib/void-rumination-context-projection.ps1
Normal file
368
scripts/lib/void-rumination-context-projection.ps1
Normal file
|
|
@ -0,0 +1,368 @@
|
|||
Set-StrictMode -Version Latest
|
||||
|
||||
function Convert-ToValueArray {
|
||||
param($Value)
|
||||
|
||||
if ($null -eq $Value) {
|
||||
return @()
|
||||
}
|
||||
|
||||
if ($Value -is [System.Array]) {
|
||||
return @($Value)
|
||||
}
|
||||
|
||||
return @($Value)
|
||||
}
|
||||
|
||||
function Get-ObjectPropertyValue {
|
||||
param(
|
||||
$Value,
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string] $Name
|
||||
)
|
||||
|
||||
if ($null -eq $Value) {
|
||||
return $null
|
||||
}
|
||||
|
||||
$property = $Value.PSObject.Properties[$Name]
|
||||
if ($null -eq $property) {
|
||||
return $null
|
||||
}
|
||||
return $property.Value
|
||||
}
|
||||
|
||||
function Get-ObjectPropertyString {
|
||||
param(
|
||||
$Value,
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string] $Name
|
||||
)
|
||||
|
||||
$value = Get-ObjectPropertyValue -Value $Value -Name $Name
|
||||
if ($null -eq $value) {
|
||||
return $null
|
||||
}
|
||||
|
||||
$text = [string]$value
|
||||
if ([string]::IsNullOrWhiteSpace($text)) {
|
||||
return $null
|
||||
}
|
||||
return $text
|
||||
}
|
||||
|
||||
function Format-RelativeTime {
|
||||
param(
|
||||
[string] $Value,
|
||||
[Parameter(Mandatory = $true)]
|
||||
[DateTime] $Now
|
||||
)
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($Value)) {
|
||||
return $null
|
||||
}
|
||||
|
||||
$timestamp = [DateTime]::MinValue
|
||||
if (-not [DateTime]::TryParse($Value, [Globalization.CultureInfo]::InvariantCulture, [Globalization.DateTimeStyles]::AssumeUniversal, [ref]$timestamp)) {
|
||||
return $null
|
||||
}
|
||||
|
||||
$timestampUtc = $timestamp.ToUniversalTime()
|
||||
$delta = $timestampUtc - $Now.ToUniversalTime()
|
||||
$future = $delta.TotalSeconds -gt 0
|
||||
$seconds = [Math]::Abs($delta.TotalSeconds)
|
||||
|
||||
if ($seconds -lt 45) {
|
||||
return "just now"
|
||||
}
|
||||
|
||||
if ($seconds -lt 5400) {
|
||||
$minutes = [Math]::Max(1, [int][Math]::Round($seconds / 60))
|
||||
$unit = if ($minutes -eq 1) { "minute" } else { "minutes" }
|
||||
$phrase = "$minutes $unit"
|
||||
} elseif ($seconds -lt 129600) {
|
||||
$hours = [Math]::Max(1, [int][Math]::Round($seconds / 3600))
|
||||
$unit = if ($hours -eq 1) { "hour" } else { "hours" }
|
||||
$phrase = "$hours $unit"
|
||||
} elseif ($seconds -lt 1814400) {
|
||||
$days = [Math]::Max(1, [int][Math]::Round($seconds / 86400))
|
||||
$unit = if ($days -eq 1) { "day" } else { "days" }
|
||||
$phrase = "$days $unit"
|
||||
} elseif ($seconds -lt 6048000) {
|
||||
$weeks = [Math]::Max(1, [int][Math]::Round($seconds / 604800))
|
||||
$unit = if ($weeks -eq 1) { "week" } else { "weeks" }
|
||||
$phrase = "$weeks $unit"
|
||||
} elseif ($seconds -lt 47304000) {
|
||||
$months = [Math]::Max(1, [int][Math]::Round($seconds / 2592000))
|
||||
$unit = if ($months -eq 1) { "month" } else { "months" }
|
||||
$phrase = "$months $unit"
|
||||
} else {
|
||||
$years = [Math]::Max(1, [int][Math]::Round($seconds / 31536000))
|
||||
$unit = if ($years -eq 1) { "year" } else { "years" }
|
||||
$phrase = "$years $unit"
|
||||
}
|
||||
|
||||
if ($future) {
|
||||
return "in $phrase"
|
||||
}
|
||||
return "$phrase ago"
|
||||
}
|
||||
|
||||
function Project-RelativeTimestamp {
|
||||
param(
|
||||
$Value,
|
||||
[string] $Name,
|
||||
[DateTime] $Now
|
||||
)
|
||||
|
||||
return Format-RelativeTime -Value (Get-ObjectPropertyString -Value $Value -Name $Name) -Now $Now
|
||||
}
|
||||
|
||||
function Project-RecentHistoryForRumination {
|
||||
param($History, [DateTime] $Now)
|
||||
|
||||
$messages = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $History -Name "messages"))
|
||||
return @{
|
||||
source = "discord_history"
|
||||
messageCount = [int]$messages.Count
|
||||
messages = @(
|
||||
$messages | ForEach-Object {
|
||||
@{
|
||||
id = Get-ObjectPropertyString -Value $_ -Name "id"
|
||||
authorId = Get-ObjectPropertyString -Value $_ -Name "authorId"
|
||||
authorName = Get-ObjectPropertyString -Value $_ -Name "authorName"
|
||||
isBot = [bool](Get-ObjectPropertyValue -Value $_ -Name "isBot")
|
||||
when = Project-RelativeTimestamp -Value $_ -Name "timestamp" -Now $Now
|
||||
content = Get-ObjectPropertyString -Value $_ -Name "content"
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function Project-OpenCasesForRumination {
|
||||
param($Cases, [DateTime] $Now)
|
||||
|
||||
return @(
|
||||
@(Convert-ToValueArray -Value $Cases) | ForEach-Object {
|
||||
@{
|
||||
sourceMessageId = Get-ObjectPropertyString -Value $_ -Name "sourceMessageId"
|
||||
status = Get-ObjectPropertyString -Value $_ -Name "status"
|
||||
summary = Get-ObjectPropertyString -Value $_ -Name "summary"
|
||||
authorName = Get-ObjectPropertyString -Value $_ -Name "authorName"
|
||||
channelId = Get-ObjectPropertyString -Value $_ -Name "channelId"
|
||||
messageUrl = Get-ObjectPropertyString -Value $_ -Name "messageUrl"
|
||||
whyItMatters = Get-ObjectPropertyString -Value $_ -Name "whyItMatters"
|
||||
created = Project-RelativeTimestamp -Value $_ -Name "createdAt" -Now $Now
|
||||
lastTouched = Project-RelativeTimestamp -Value $_ -Name "lastTouchedAt" -Now $Now
|
||||
resolved = Project-RelativeTimestamp -Value $_ -Name "resolvedAt" -Now $Now
|
||||
tags = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $_ -Name "tags"))
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function Project-SpeechReceiptsForRumination {
|
||||
param($Receipts, [DateTime] $Now)
|
||||
|
||||
return @(
|
||||
@(Convert-ToValueArray -Value $Receipts) | ForEach-Object {
|
||||
@{
|
||||
receiptKey = Get-ObjectPropertyString -Value $_ -Name "receiptKey"
|
||||
sent = Project-RelativeTimestamp -Value $_ -Name "sentAt" -Now $Now
|
||||
mode = Get-ObjectPropertyString -Value $_ -Name "mode"
|
||||
transport = Get-ObjectPropertyString -Value $_ -Name "transport"
|
||||
channelId = Get-ObjectPropertyString -Value $_ -Name "channelId"
|
||||
replyToMessageId = Get-ObjectPropertyString -Value $_ -Name "replyToMessageId"
|
||||
preview = Get-ObjectPropertyString -Value $_ -Name "preview"
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function Project-MemoriesForRumination {
|
||||
param($Memories, [DateTime] $Now)
|
||||
|
||||
return @(
|
||||
@(Convert-ToValueArray -Value $Memories) | ForEach-Object {
|
||||
@{
|
||||
memoryId = Get-ObjectPropertyString -Value $_ -Name "memoryId"
|
||||
kind = Get-ObjectPropertyString -Value $_ -Name "kind"
|
||||
target = Get-ObjectPropertyValue -Value $_ -Name "target"
|
||||
summary = Get-ObjectPropertyString -Value $_ -Name "summary"
|
||||
claim = Get-ObjectPropertyString -Value $_ -Name "claim"
|
||||
question = Get-ObjectPropertyString -Value $_ -Name "question"
|
||||
tension = Get-ObjectPropertyString -Value $_ -Name "tension"
|
||||
actionImplication = Get-ObjectPropertyString -Value $_ -Name "actionImplication"
|
||||
created = Project-RelativeTimestamp -Value $_ -Name "createdAt" -Now $Now
|
||||
updated = Project-RelativeTimestamp -Value $_ -Name "updatedAt" -Now $Now
|
||||
retired = Project-RelativeTimestamp -Value $_ -Name "retiredAt" -Now $Now
|
||||
evidenceRefs = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $_ -Name "evidenceRefs"))
|
||||
tags = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $_ -Name "tags"))
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function Project-IncubationForRumination {
|
||||
param($Threads, [DateTime] $Now)
|
||||
|
||||
return @(
|
||||
@(Convert-ToValueArray -Value $Threads) | ForEach-Object {
|
||||
@{
|
||||
threadId = Get-ObjectPropertyString -Value $_ -Name "threadId"
|
||||
target = Get-ObjectPropertyValue -Value $_ -Name "target"
|
||||
topic = Get-ObjectPropertyString -Value $_ -Name "topic"
|
||||
summary = Get-ObjectPropertyString -Value $_ -Name "summary"
|
||||
supportMemoryIds = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $_ -Name "supportMemoryIds"))
|
||||
evidenceRefs = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $_ -Name "evidenceRefs"))
|
||||
maturation = Get-ObjectPropertyValue -Value $_ -Name "maturation"
|
||||
noveltyToRoom = Get-ObjectPropertyValue -Value $_ -Name "noveltyToRoom"
|
||||
noveltyToSelf = Get-ObjectPropertyValue -Value $_ -Name "noveltyToSelf"
|
||||
desireToSpeak = Get-ObjectPropertyValue -Value $_ -Name "desireToSpeak"
|
||||
saturationScore = Get-ObjectPropertyValue -Value $_ -Name "saturationScore"
|
||||
status = Get-ObjectPropertyString -Value $_ -Name "status"
|
||||
created = Project-RelativeTimestamp -Value $_ -Name "createdAt" -Now $Now
|
||||
updated = Project-RelativeTimestamp -Value $_ -Name "updatedAt" -Now $Now
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function Project-InterventionsForRumination {
|
||||
param($Interventions, [DateTime] $Now)
|
||||
|
||||
return @(
|
||||
@(Convert-ToValueArray -Value $Interventions) | ForEach-Object {
|
||||
@{
|
||||
interventionId = Get-ObjectPropertyString -Value $_ -Name "interventionId"
|
||||
kind = Get-ObjectPropertyString -Value $_ -Name "kind"
|
||||
status = Get-ObjectPropertyString -Value $_ -Name "status"
|
||||
target = Get-ObjectPropertyValue -Value $_ -Name "target"
|
||||
summary = Get-ObjectPropertyString -Value $_ -Name "summary"
|
||||
draft = Get-ObjectPropertyString -Value $_ -Name "draft"
|
||||
priority = Get-ObjectPropertyValue -Value $_ -Name "priority"
|
||||
mustEventuallyShare = Get-ObjectPropertyValue -Value $_ -Name "mustEventuallyShare"
|
||||
created = Project-RelativeTimestamp -Value $_ -Name "createdAt" -Now $Now
|
||||
updated = Project-RelativeTimestamp -Value $_ -Name "updatedAt" -Now $Now
|
||||
spoken = Project-RelativeTimestamp -Value $_ -Name "spokenAt" -Now $Now
|
||||
retired = Project-RelativeTimestamp -Value $_ -Name "retiredAt" -Now $Now
|
||||
tags = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $_ -Name "tags"))
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function Project-ScheduledRuntimeForRumination {
|
||||
param($Runtime, [DateTime] $Now)
|
||||
|
||||
$sleepCycle = Get-ObjectPropertyValue -Value $Runtime -Name "sleepCycle"
|
||||
$speakingPressure = Get-ObjectPropertyValue -Value $Runtime -Name "speakingPressure"
|
||||
$lastRuns = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $Runtime -Name "lastRuns"))
|
||||
|
||||
return @{
|
||||
sleepCycle = @{
|
||||
isNapping = [bool](Get-ObjectPropertyValue -Value $sleepCycle -Name "isNapping")
|
||||
currentNapStarted = Project-RelativeTimestamp -Value $sleepCycle -Name "currentNapStartedAt" -Now $Now
|
||||
currentNapEnds = Project-RelativeTimestamp -Value $sleepCycle -Name "currentNapEndsAt" -Now $Now
|
||||
nextNapStarts = Project-RelativeTimestamp -Value $sleepCycle -Name "nextNapStartsAt" -Now $Now
|
||||
activeDreamThemes = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $sleepCycle -Name "activeDreamThemes"))
|
||||
}
|
||||
speakingPressure = @{
|
||||
needToSpeak = Get-ObjectPropertyValue -Value $speakingPressure -Name "needToSpeak"
|
||||
confessionPressure = Get-ObjectPropertyValue -Value $speakingPressure -Name "confessionPressure"
|
||||
noveltyPressure = Get-ObjectPropertyValue -Value $speakingPressure -Name "noveltyPressure"
|
||||
recentSpeechDamping = Get-ObjectPropertyValue -Value $speakingPressure -Name "recentSpeechDamping"
|
||||
lastSpoke = Project-RelativeTimestamp -Value $speakingPressure -Name "lastSpokeAt" -Now $Now
|
||||
lastHerald = Project-RelativeTimestamp -Value $speakingPressure -Name "lastHeraldAt" -Now $Now
|
||||
}
|
||||
lastRuns = @(
|
||||
$lastRuns | ForEach-Object {
|
||||
@{
|
||||
runner = Get-ObjectPropertyString -Value $_ -Name "runner"
|
||||
ran = Project-RelativeTimestamp -Value $_ -Name "ranAt" -Now $Now
|
||||
summary = Get-ObjectPropertyString -Value $_ -Name "summary"
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function Project-CursorForRumination {
|
||||
param($Cursor, [DateTime] $Now)
|
||||
|
||||
return @{
|
||||
lastReviewedMessageId = Get-ObjectPropertyString -Value $Cursor -Name "lastReviewedMessageId"
|
||||
lastReviewed = Project-RelativeTimestamp -Value $Cursor -Name "lastReviewedTimestamp" -Now $Now
|
||||
}
|
||||
}
|
||||
|
||||
function Project-RepoCommitForRumination {
|
||||
param($Commit, [DateTime] $Now)
|
||||
|
||||
if ($null -eq $Commit) {
|
||||
return $null
|
||||
}
|
||||
|
||||
$hash = Get-ObjectPropertyString -Value $Commit -Name "hash"
|
||||
return @{
|
||||
hash = if ($hash -and $hash.Length -gt 12) { $hash.Substring(0, 12) } else { $hash }
|
||||
committed = Project-RelativeTimestamp -Value $Commit -Name "committedAt" -Now $Now
|
||||
author = Get-ObjectPropertyString -Value $Commit -Name "author"
|
||||
subject = Get-ObjectPropertyString -Value $Commit -Name "subject"
|
||||
diffstat = Get-ObjectPropertyValue -Value $Commit -Name "diffstat"
|
||||
changedPaths = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $Commit -Name "changedPaths"))
|
||||
}
|
||||
}
|
||||
|
||||
function Select-RuminationRepoActivity {
|
||||
param($RepoActivity, [DateTime] $Now)
|
||||
|
||||
if ($null -eq $RepoActivity) {
|
||||
return $null
|
||||
}
|
||||
|
||||
$status = Get-ObjectPropertyString -Value $RepoActivity -Name "status"
|
||||
if ($status -eq "failed") {
|
||||
return @{
|
||||
status = "failed"
|
||||
error = Get-ObjectPropertyString -Value $RepoActivity -Name "error"
|
||||
}
|
||||
}
|
||||
|
||||
$repos = @(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $RepoActivity -Name "repos"))
|
||||
$freshRepos = @(
|
||||
$repos |
|
||||
Where-Object {
|
||||
$recent = Get-ObjectPropertyValue -Value $_ -Name "recentCommitCount"
|
||||
$repoStatus = Get-ObjectPropertyString -Value $_ -Name "status"
|
||||
$null -ne $recent -and $repoStatus -eq "ok" -and [int]$recent -gt 0
|
||||
} |
|
||||
Select-Object -First 8
|
||||
)
|
||||
$projectedRepos = @(
|
||||
$freshRepos | ForEach-Object {
|
||||
@{
|
||||
repoName = Get-ObjectPropertyString -Value $_ -Name "repoName"
|
||||
branch = Get-ObjectPropertyString -Value $_ -Name "branch"
|
||||
status = Get-ObjectPropertyString -Value $_ -Name "status"
|
||||
recentCommitCount = Get-ObjectPropertyValue -Value $_ -Name "recentCommitCount"
|
||||
windowRecentCommitCount = Get-ObjectPropertyValue -Value $_ -Name "windowRecentCommitCount"
|
||||
suppressedRecentCommitCount = Get-ObjectPropertyValue -Value $_ -Name "suppressedRecentCommitCount"
|
||||
latestCommit = Project-RepoCommitForRumination -Commit (Get-ObjectPropertyValue -Value $_ -Name "latestCommit") -Now $Now
|
||||
commits = @(
|
||||
@(Convert-ToValueArray -Value (Get-ObjectPropertyValue -Value $_ -Name "commits")) | ForEach-Object {
|
||||
Project-RepoCommitForRumination -Commit $_ -Now $Now
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
return @{
|
||||
generated = Project-RelativeTimestamp -Value $RepoActivity -Name "generatedAt" -Now $Now
|
||||
cursorMode = Get-ObjectPropertyString -Value $RepoActivity -Name "cursorMode"
|
||||
summary = if ($projectedRepos.Count -gt 0) { "New tracked repo commits crossed the saved repo-activity cursor." } else { "No new tracked repo commits crossed the saved repo-activity cursor." }
|
||||
freshRepos = $projectedRepos
|
||||
}
|
||||
}
|
||||
|
|
@ -21,11 +21,14 @@ $operationOutputPath = Join-Path $statusDir "moderation-rumination-operations.js
|
|||
$contextPath = Join-Path $statusDir "moderation-rumination-context.json"
|
||||
$lockPath = Join-Path $statusDir "moderation-rumination.lock"
|
||||
$promptTemplatePath = Join-Path $repoRoot "prompts\void-moderator-rumination.md"
|
||||
$contextProjectionScriptPath = Join-Path $repoRoot "scripts\lib\void-rumination-context-projection.ps1"
|
||||
$recentHistoryScriptPath = Join-Path $repoRoot "scripts\export-recent-discord-history.mjs"
|
||||
$repoActivityScriptPath = Join-Path $repoRoot "scripts\export-recent-repo-activity.mjs"
|
||||
$selfStateScriptPath = Join-Path $repoRoot "scripts\void-self-state.mjs"
|
||||
$startedAtUtc = [DateTime]::UtcNow
|
||||
|
||||
. $contextProjectionScriptPath
|
||||
|
||||
function Write-JsonFile {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
|
|
@ -268,29 +271,6 @@ function Convert-ToOperationArray {
|
|||
return @($Value)
|
||||
}
|
||||
|
||||
function Get-ObjectPropertyString {
|
||||
param(
|
||||
$Value,
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string] $Name
|
||||
)
|
||||
|
||||
if ($null -eq $Value) {
|
||||
return $null
|
||||
}
|
||||
|
||||
$property = $Value.PSObject.Properties[$Name]
|
||||
if ($null -eq $property -or $null -eq $property.Value) {
|
||||
return $null
|
||||
}
|
||||
|
||||
$text = [string]$property.Value
|
||||
if ([string]::IsNullOrWhiteSpace($text)) {
|
||||
return $null
|
||||
}
|
||||
return $text
|
||||
}
|
||||
|
||||
function Convert-LastSpeechToReceiptOperation {
|
||||
param($Speech)
|
||||
|
||||
|
|
@ -339,33 +319,6 @@ function Convert-LastSpeechToReceiptOperation {
|
|||
}
|
||||
}
|
||||
|
||||
function Select-RuminationRepoActivity {
|
||||
param($RepoActivity)
|
||||
|
||||
if ($null -eq $RepoActivity) {
|
||||
return $null
|
||||
}
|
||||
|
||||
$reposProperty = $RepoActivity.PSObject.Properties["repos"]
|
||||
$repos = if ($null -ne $reposProperty -and $null -ne $reposProperty.Value) { @($reposProperty.Value) } else { @() }
|
||||
$freshRepos = @(
|
||||
$repos |
|
||||
Where-Object {
|
||||
$recent = $_.PSObject.Properties["recentCommitCount"]
|
||||
$status = $_.PSObject.Properties["status"]
|
||||
$null -ne $recent -and $null -ne $status -and [string]$status.Value -eq "ok" -and [int]$recent.Value -gt 0
|
||||
} |
|
||||
Select-Object -First 8
|
||||
)
|
||||
|
||||
return @{
|
||||
generatedAt = Get-ObjectPropertyString -Value $RepoActivity -Name "generatedAt"
|
||||
cursorMode = Get-ObjectPropertyString -Value $RepoActivity -Name "cursorMode"
|
||||
digest = Get-ObjectPropertyString -Value $RepoActivity -Name "digest"
|
||||
freshRepos = $freshRepos
|
||||
}
|
||||
}
|
||||
|
||||
trap {
|
||||
$finishedAtUtc = [DateTime]::UtcNow
|
||||
$failureMessage = $_.Exception.Message
|
||||
|
|
@ -413,7 +366,7 @@ if (Test-Path $operationOutputPath) {
|
|||
Remove-Item -LiteralPath $operationOutputPath -Force
|
||||
}
|
||||
|
||||
foreach ($requiredPath in @($recentHistoryScriptPath, $repoActivityScriptPath, $selfStateScriptPath)) {
|
||||
foreach ($requiredPath in @($contextProjectionScriptPath, $recentHistoryScriptPath, $repoActivityScriptPath, $selfStateScriptPath)) {
|
||||
if (-not (Test-Path $requiredPath)) {
|
||||
throw "Missing required helper at $requiredPath"
|
||||
}
|
||||
|
|
@ -473,26 +426,21 @@ try {
|
|||
}
|
||||
|
||||
Write-JsonFile -Path $contextPath -Data @{
|
||||
generatedAt = [DateTime]::UtcNow.ToString("o")
|
||||
generated = "now"
|
||||
stateFile = $stateFilePath
|
||||
noPost = [bool]$NoPost
|
||||
selfStateSummary = $typedContext.summary
|
||||
openCases = $typedState.moderationCursor.openCases
|
||||
speechReceipts = $typedState.speechReceipts.recentReceipts
|
||||
memories = $typedState.thoughtMemory.memories
|
||||
incubation = $typedState.thoughtMemory.incubation
|
||||
candidateInterventions = $typedState.candidateInterventions.interventions
|
||||
scheduledRuntime = $typedState.scheduledRuntime
|
||||
priorCursor = @{
|
||||
lastReviewedMessageId = Get-ObjectPropertyString -Value $priorCursor -Name "lastReviewedMessageId"
|
||||
lastReviewedTimestamp = Get-ObjectPropertyString -Value $priorCursor -Name "lastReviewedTimestamp"
|
||||
}
|
||||
observedCursor = @{
|
||||
lastReviewedMessageId = Get-ObjectPropertyString -Value $observedCursor -Name "lastReviewedMessageId"
|
||||
lastReviewedTimestamp = Get-ObjectPropertyString -Value $observedCursor -Name "lastReviewedTimestamp"
|
||||
}
|
||||
recentHistory = $history
|
||||
repoActivity = Select-RuminationRepoActivity -RepoActivity $repoActivity
|
||||
chronology = "Times in this prompt-facing context are relative phrases. Exact timestamps stay parent-owned for typed state and cursor bookkeeping."
|
||||
openCases = @(Project-OpenCasesForRumination -Cases $typedState.moderationCursor.openCases -Now $startedAtUtc)
|
||||
speechReceipts = @(Project-SpeechReceiptsForRumination -Receipts $typedState.speechReceipts.recentReceipts -Now $startedAtUtc)
|
||||
memories = @(Project-MemoriesForRumination -Memories $typedState.thoughtMemory.memories -Now $startedAtUtc)
|
||||
incubation = @(Project-IncubationForRumination -Threads $typedState.thoughtMemory.incubation -Now $startedAtUtc)
|
||||
candidateInterventions = @(Project-InterventionsForRumination -Interventions $typedState.candidateInterventions.interventions -Now $startedAtUtc)
|
||||
scheduledRuntime = Project-ScheduledRuntimeForRumination -Runtime $typedState.scheduledRuntime -Now $startedAtUtc
|
||||
priorCursor = Project-CursorForRumination -Cursor $priorCursor -Now $startedAtUtc
|
||||
observedCursor = Project-CursorForRumination -Cursor $observedCursor -Now $startedAtUtc
|
||||
recentHistory = Project-RecentHistoryForRumination -History $history -Now $startedAtUtc
|
||||
repoActivity = Select-RuminationRepoActivity -RepoActivity $repoActivity -Now $startedAtUtc
|
||||
}
|
||||
|
||||
$stateWriteBefore = if (Test-Path $stateFilePath) { (Get-Item $stateFilePath).LastWriteTimeUtc } else { [DateTime]::MinValue }
|
||||
|
|
|
|||
Loading…
Reference in a new issue