Skip to content

Framework primitive: visible-intent before every non-idempotent effect (the framework owns the visibility barrier, not package Lua) #133

@loning

Description

@loning

The defect class (now live-proven across legs)

In the fkst-packages github-devloop dogfood, the same defect class has now appeared at multiple legs: package code writes or assumes a state marker, then acts before the marker is provably VISIBLE in the durable read model (GitHub, eventually-consistent).

  • ready→implementing (fixed package-side in fkst-packages #1095, behaviorally, by routing through a write-confirmed causal outbox + a verifiable hand_off).
  • implementing→...: the implement-attempt/implementing marker write lags or fails under batch concurrency, so implement re-reads "no marker" and re-spawns the implementation codex (fkst-packages #1101).
  • Live cascade (2026-06-18): 6 harness issues filed in a batch each hit the implementing re-spawn burst → ~12-18 concurrent codex + a flood of GitHub comment writes → GitHub secondary rate-limit (403) → the implementing state-marker comment writes FAILED → the markers never materialized → the issues are stuck showing ready while actively implementing, and are about to force-terminate to blocked at the 45-min ready budget. The visibility failure both hides the state and self-reinforces the burst.

This is the architecture ChatGPT Pro flagged as the #1 highest-leverage gap: the visibility barrier must be a framework primitive, not re-implemented (and re-broken) per leg in package Lua.

Proposed primitive (the framework owns handoff/visibility/idempotency/redrive/recovery; package expresses only the business decision)

Every non-idempotent effect goes through ONE framework API:

declare_intent(edge, generation, effect_kind, effect_key)
wait_until_intent_visible(intent_id)
perform_or_recover_effect(intent_id, effect_key)   -- probe by effect_key first; perform at-most-once
write_result_marker(intent_id, result)
wait_until_result_visible(result_id)
derive_next_transition_from_visible_result(result_id)

Mechanical invariants:

  • No non-idempotent external effect (agent spawn, PR create, review post, merge, label mutation, branch create) may execute unless a VISIBLE, current-generation intent marker exists for that exact effect_key.
  • If the effect may already have happened, redrive must recover/probe by effect_key before re-attempting (at-most-once).
  • Every next-state transition is derived from a VISIBLE result marker — never from an in-process write result, in-memory flag, or direct raise.

Acceptance tests (the class is gone iff these pass)

  • Inject stale reads after intent write: no agent respawn, duplicate PR, duplicate review, duplicate merge, or stuck state.
  • Crash after intent marker write, before effect: redrive eventually performs the effect once.
  • Crash after effect succeeds, before result marker: redrive recovers the already-performed effect and writes the result marker WITHOUT repeating the effect.
  • Two workers racing one issue: at most one effect per (issue, edge, generation, effect_key).
  • Batch concurrency + induced rate-limit: effects retry without storming; markers eventually materialize; no force-terminate of healthy actively-working issues.
  • Disable the primitive → reproduce the implementing respawn/rate-limit cascade; enable → prove the class is gone.

Origin: ChatGPT Pro roadmap (next-step planning, operator-mandated). Package-side instances: fkst-packages #1095 (ready, done), #1101 (implementing), #1103 (all forward legs behaviorally). This issue is the ENGINE primitive that makes the class structurally impossible and lets package Lua express only business decisions — the operator's stated ideal (framework does the common parts well and keeps them stable).

⟦AI:FKST⟧

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions