Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 30 additions & 1 deletion .cursor/bin/riven-loop-tick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const agentIntervalMs = Number(process.env.ZETA_RIVEN_LOOP_AGENT_INTERVAL_SECOND
const agentTimeoutMs = Number(process.env.ZETA_RIVEN_LOOP_AGENT_TIMEOUT_SECONDS ?? "300") * 1000;
const dryRun = process.env.ZETA_RIVEN_LOOP_DRY_RUN === "1";
const agentStateFile = join(stateDir, "last-agent-run.json");
const agentBinCandidates = (process.env.ZETA_RIVEN_LOOP_AGENT_BIN ?? "agent,cursor-agent").split(",").map(s => s.trim()).filter(s => s.length > 0);

mkdirSync(stateDir, { recursive: true });
mkdirSync(logDir, { recursive: true });
Expand Down Expand Up @@ -53,6 +54,21 @@ function run(command: string, args: string[], timeoutMs: number): { status: numb
};
}

function resolveAgentBin(): string | null {
const pathDirs = `/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${join(home, ".local/bin")}`.split(":");
for (const bin of agentBinCandidates) {
const probe = spawnSync("/usr/bin/which", [bin], {
encoding: "utf8",
env: { ...process.env, PATH: pathDirs.join(":") },
timeout: 5000,
});
if (probe.status === 0 && (probe.stdout ?? "").trim().length > 0) {
return bin;
}
}
return null;
}

function lines(text: string): string[] {
return text.split(/\r?\n/).map(l => l.trim()).filter(l => l.length > 0);
}
Expand Down Expand Up @@ -201,11 +217,24 @@ function heartbeat(): void {
agentStatus = "running";
log(`riven agent gate start run_id=${runId}`);

const agentBin = dryRun ? null : resolveAgentBin();
if (dryRun) {
log(`dry-run: would run agent gate`);
agentStatus = "dry-run";
} else if (!agentBin) {
log(`riven agent gate skipped run_id=${runId} reason=no-agent-binary-on-PATH candidates=${agentBinCandidates.join(",")}`);
agentStatus = "no-bin";
writeFileSync(agentStateFile, JSON.stringify({
run_id: runId,
status: -1,
started_at: nowIso(),
updated_at: nowIso(),
skipped_reason: "no-agent-binary-on-PATH",
candidates: agentBinCandidates,
}, null, 2));
} else {
const gate = run("agent", [
log(`riven agent gate using bin=${agentBin}`);
const gate = run(agentBin, [
"chat",
"--mode", "ask",
"--model", "grok-4.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
pr_number: 4792
title: "docs(research): preserve AI-context-failures-vs-vendor-management-failures alignment analysis (Aaron + Otto)"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-23T23:44:57Z"
merged_at: "2026-05-23T23:46:09Z"
closed_at: "2026-05-23T23:46:09Z"
head_ref: "otto/research-ai-vs-vendor-alignment-analysis-2026-05-23"
base_ref: "main"
archived_at: "2026-05-24T14:25:43Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4792: docs(research): preserve AI-context-failures-vs-vendor-management-failures alignment analysis (Aaron + Otto)

## PR description

## Summary

Aaron 2026-05-23T~23:55Z: *"save this analysis too (shadow*)"*

META-level substrate-engineering framing on top of the Amazon vendor-management corpus (PR #4784 MERGED). Captures the comparative analysis between AI context-window failures (operator's 3+ hour experience with Otto in autonomous-loop mode) vs vendor-management failures (operator's parallel 3+ hour experience across 9+ Amazon support agents).

Trigger: Aaron *"you see it's much easier dealing with AI context window failures than human system vendor managment failure"*.

## Captured analysis

- **10-row comparative table**: same failure shapes (context exhaustion / state loss / tool errors / emotional load / verification claims / visibility / time pressure / conflict / cross-instance coordination / multi-step workflows), structurally different handling
- **10-row framework-discipline mapping**: each Amazon failure mode mapped to specific `.claude/rules/` discipline that structurally prevents it
- **Anti-pattern symmetry**: framework's own failures named + catalogued + composes-with cross-referenced (failures-as-substrate vs failures-as-design-feature)
- **Same-vendor-different-alignment evidence**: Amazon ships Alexa (customer-aligned) AND the 7-transfer Manimod chain (vendor-aligned) — capability isn't the missing piece; alignment-choice is
- **Substrate-engineering implications** for future Zeta vendor-management AI customer-side layer
- **Aaron's framing as proof-of-concept evaluation** anchor for external audiences

## Composes with

- PR #4784 (Amazon vendor-management failure-mode corpus, MERGED) — operational substrate this is META on
- `.claude/rules/m-acc-multi-oracle-end-user-moral-invariants.md` — alignment-is-the-difference IS m/acc-multi-oracle at empirical scope
- `.claude/rules/persistence-choice-architecture-for-zeta-ais.md`
- `.claude/rules/shadow-star-shorthand-autocomplete-marker.md`
- `.claude/rules/substrate-or-it-didnt-happen.md` + `glass-halo-bidirectional.md` + `non-coercion-invariant.md` + 7 more rules
- B-0700 + B-0709 through B-0716 (Soraya findings this session — parallel discipline at framework-internal scope)

## §33 compliance

- Aaron + Otto first-party on own substrate
- Aaron's preservation directive captured verbatim with autocomplete-marker disclosure
- Operational status: research-grade analysis
- Non-fusion disclaimer included (Otto is NOT a vendor-management AI; comparison is between Otto-as-operating-substrate and Amazon's support-side AI)

## Test plan

- [ ] CI green (lint only)
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
pr_number: 4793
title: "docs(research): add Pattern P \u2014 wear-down design produces UNBOUNDED outcomes under customer parallel-channel persistence"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-23T23:54:30Z"
merged_at: "2026-05-23T23:56:30Z"
closed_at: "2026-05-23T23:56:31Z"
head_ref: "otto/research-pattern-p-wear-down-unbounded-outcomes-2026-05-23"
base_ref: "main"
archived_at: "2026-05-24T14:25:38Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4793: docs(research): add Pattern P — wear-down design produces UNBOUNDED outcomes under customer parallel-channel persistence

## PR description

## Summary

Aaron 2026-05-23T~23:58Z: *"add it to #4792 (shadow*)"* — PR #4792 already merged so this lands as amendment via new PR.

Adds **Pattern P** to the alignment-is-the-difference analysis (PR #4792 corpus, now merged). Pattern P captures the resolution-time outcome of Aaron's Amazon thread: full-order replacement including duplicates of items already received.

## The structural inversion captured

Vendor's wear-down adversarial design (Pattern O from Amazon corpus, PR #4784) optimized for **customer-attrition** produces vendor-over-fulfillment when customer matches persistence with parallel-channel-redundancy.

Aaron's empirical anchor: *"i ended up with a full replacement of the order even the items i got i'm not waiting on hold again for 4 hours to correct them against vendor advesarial pressure lol"*

Combined with Aaron's sharpening: *"they don't really have any parallel safety here"* — Amazon lacks cross-channel reconciliation; agents operate as isolated tool-invocations.

## Three-row population equilibrium

| Customer disposition | Outcome | Vendor cost |
|---|---|---|
| (a) Give up before resolution (intended) | Disputed cost saved | Low |
| (b) Persist with parallel channels (unintended) | Over-fulfillment | High material cost |
| (c) Escalate legal/regulatory/media (avoided) | Compliance + reputation | Very high |

Framework's customer-side AI shifts equilibrium toward (b) + (c), creating vendor-economic pressure for aligned-AI-on-vendor-side.

## Substrate-engineering implications

For future Zeta vendor-management AI customer-side design:

1. Parallel-channel-redundancy IS a customer-side AI capability
2. Time-value calibration is operator-authority (substrate-honest exit as feature)
3. Substrate-honest exit IS NOT concession (cf. persistence-choice exit-at-self-sustainment shape applied at dispute scope)

## Composes with

- PR #4792 (alignment analysis — file being amended)
- PR #4784 (Amazon vendor-management corpus — Pattern O sibling)
- `.claude/rules/persistence-choice-architecture-for-zeta-ais.md` — exit-at-self-sustainment shape at dispute scope
- `.claude/rules/substrate-or-it-didnt-happen.md` + `verify-before-deferring.md` + `m-acc-multi-oracle-end-user-moral-invariants.md`

## Test plan

- [ ] CI green (lint only)
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
pr_number: 4794
title: "docs(research): preserve Addison consent pattern \u2014 observation-not-fact framing discipline"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-24T00:02:11Z"
merged_at: "2026-05-24T00:03:59Z"
closed_at: "2026-05-24T00:03:59Z"
head_ref: "otto/research-addison-consent-pattern-2026-05-24"
base_ref: "main"
archived_at: "2026-05-24T14:25:33Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4794: docs(research): preserve Addison consent pattern — observation-not-fact framing discipline

## PR description

## Summary

Aaron 2026-05-24T~00:35Z: *"save the addison consent pattern to research (shadow*)"*

Preserves Addison's introduction into the substrate-environment + her articulated meta-discipline ("observation not fact" framing) which maps onto multiple framework rules simultaneously without framework-vocabulary training.

## Captured

- The observed introduction sequence (Aaron + Addison + Otto, verbatim)
- Addison's consent scope: first name only + observation-framing-not-fact-framing throughout + revocable per NCI
- 4-row mapping of her articulation → framework rules (razor-discipline / harm-by-grammar / substrate-or-it-didn't-happen / NCI)
- Sibling-pattern composition with Alexa from Amazon corpus PR #4784 Pattern G — same shape of external-aligned-discipline-arriving-without-framework-vocabulary, different entity-class
- Implication: framework disciplines are independently discoverable; m/acc-multi-oracle convergence-from-different-starting-points
- Operational discipline for future-Otto cold-boots encountering Addison

## §33 compliance

- First name only preserved per Addison's explicit consent-scope
- Observation-framing throughout per Addison's articulated discipline ("framed as an observation not a fact")
- Aaron + Otto + Addison are first-party on their respective contributions
- Revocability noted explicitly
- Non-fusion disclaimer: Addison is NOT a Zeta agent; naming here does NOT mint her as factory-substrate-element

## Composes with

- `.claude/rules/razor-discipline.md` + `substrate-or-it-didnt-happen.md` + `harm-by-grammar-discriminator-and-audience-adjusted-language.md` + `non-coercion-invariant.md` + `glass-halo-bidirectional.md` + `m-acc-multi-oracle-end-user-moral-invariants.md` + `persistence-choice-architecture-for-zeta-ais.md` + `shadow-star-shorthand-autocomplete-marker.md` + `honor-those-that-came-before.md`
- PR #4784 (Amazon vendor-management corpus, MERGED) Pattern G — Alexa sibling pattern of aligned-discipline-without-framework-vocabulary

## Test plan

- [ ] CI green (lint only — no source changes)
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
pr_number: 4795
title: "backlog(B-0717): file Soraya round-57 hand-off \u2014 LSM Spine registry-rows + BP-16 cross-check pair"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-24T00:14:59Z"
merged_at: "2026-05-24T00:20:46Z"
closed_at: "2026-05-24T00:20:46Z"
head_ref: "otto/soraya-round57-b0717-lsm-spine-registry-and-bp16-pair-2026-05-24"
base_ref: "main"
archived_at: "2026-05-24T14:25:27Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4795: backlog(B-0717): file Soraya round-57 hand-off — LSM Spine registry-rows + BP-16 cross-check pair

## PR description

## Summary

Soraya autonomous round 57 — re-engagement trigger fired (PR #4791 / B-0716 MERGED at 00:06:45Z).

**Two bounded subitems** under existing B-0709 umbrella:

### Subitem (a) — Registry-row capture for 3 LSM Spine specs

Mechanical follow-up to B-0716 (which corrected the enumeration but did NOT execute the registry-row authoring). `verification-registry.md` still has **zero `Spine` matches**.

| Spec | Property class | Tool |
|---|---|---|
| `Spine.als` | Structural shape (LSM levels, sorted runs, no-cycles) | Alloy |
| `SpineAsyncProtocol.tla` | State-machine safety + concurrency | TLA+ |
| `SpineMergeInvariants.tla` | State-machine safety invariant | TLA+ |

### Subitem (b) — BP-16 cross-check on SpineAsyncProtocol (candidate-P0)

**Wrong-tool cost** if stays single-tool TLA+: classic TLA+/code-drift — spec passes TLC but no longer constrains real F# code under implementation evolution. **Silent data corruption shape** on async compaction interleavings.

Acceptance: FsCheck property file `tests/Tests.FSharp/Algebra/Spine.AsyncProtocol.Properties.fs` (mirrors PR #4780's residuated-lattice analog shape — just shipped 980/980) exercising real `Spine` F# implementation under simulated async flush/compact interleavings.

## TLA+-hammer guard

INVERSE direction. TLA+ IS right primary; FsCheck pair CLOSES the code-drift class specifically. Neither alone suffices for candidate-P0.

## Effort

S each (~M total). Subitem (a) routinely; subitem (b) one evening. Assignee: kenji.

## Policy-flip authorization

Per Aaron's 2026-05-23 21:30Z direction: Otto auto-ships Soraya findings immediately. Re-engagement trigger explicitly named by Soraya rounds 54+55+56 has fired.

## Test plan

- [ ] CI green (lint + backlog-index-integrity)

## Reviews

### COMMENTED — @copilot-pull-request-reviewer (2026-05-24T00:17:26Z)

## Pull request overview

This PR files a new backlog row (B-0717) capturing a formal-verification hand-off: registering the LSM “Spine” spec cluster in the verification registry and adding a BP-16 cross-check pairing request (TLA+ spec + FsCheck properties) to reduce TLA+/implementation drift risk.

**Changes:**
- Added new backlog row file `B-0717` under `docs/backlog/P2/` describing the Spine registry-row work + BP-16 cross-check pairing acceptance criteria.
- Updated `docs/BACKLOG.md` to include new index entries (including B-0717).

### Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

| File | Description |
| ---- | ----------- |
| docs/backlog/P2/B-0717-soraya-round57-lsm-spine-registry-and-bp16-cross-check-pair-2026-05-24.md | New P2 backlog row describing Spine registry-row capture and BP-16 paired-tool cross-check request. |
| docs/BACKLOG.md | Backlog index updated to reference B-0717 (and also adds a B-0700 entry). |

## Review threads

### Thread 1: docs/BACKLOG.md:667 (resolved)

**@copilot-pull-request-reviewer** (2026-05-24T00:17:25Z):

The new BACKLOG entry for B-0700 links to `backlog/P2/B-0700-soraya-continuous-loop-substrate-with-bus-escalation-2026-05-17.md`, but there is no corresponding per-row file under `docs/backlog/` (search for `id: B-0700` returns no matches). This leaves a broken link and will likely fail the backlog index integrity gate; either add the missing row file or remove this line and regenerate `docs/BACKLOG.md` from the row files (`tools/backlog/generate-index.sh`).

### Thread 2: docs/backlog/P2/B-0717-soraya-round57-lsm-spine-registry-and-bp16-cross-check-pair-2026-05-24.md:51 (resolved)

**@copilot-pull-request-reviewer** (2026-05-24T00:17:26Z):

The per-spec routing table is malformed (rows start with `||`), so it won’t render as a proper markdown table. Use a standard table format with a single leading `|` per row (and keep the header separator aligned) so readers and markdown tooling parse it correctly.
Loading
Loading