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
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ signed-loop records do not make behavior live.
| `PLAN`-`PLAN3` | Original boundary and cross-initiative planning | Historical planning |
| `01` | Canonical specification and ADR 0016 | Merged PR #144 |
| `02A` | Shared transactional outbox persistence/append | Merged PR #155; migration 0029 |
| `03A` | Adapter-binding persistence | Merged PR #267; migration 0053 |

## Current reconciliation

| Chunk | Goal | Risk | Status |
|---|---|---:|---|
| `PLAN4` | Reconcile current main, ART/AUTH/REV changes, open PRs, and end-to-end order | L1 | Merged PR #261 |
| `PLAN5` | Reconcile complete-context human needs-revision rebase across guide, policy, REV, and CON contracts | L1 | Active specification chunk; no runtime |

## Core runtime chunks

| Chunk | Goal | Entry gate | Status |
|---|---|---|---|
| `03A` | Adapter-binding persistence | PLAN4 accepted; refreshed after ART PR #264 | Active schema-only chunk; migration 0053 |
| `03B` | Contribution-policy persistence | 03A | Proposed; unblocks REV-03A2 FK |
| `02C` | Shared lifecycle-audit participant | PLAN4; current AuditEvent contract | Proposed; independent of dispatcher; required before REV-04B |
| `04A` | Hidden adapter-binding service | 03A + exact AUTH registration/PREP contract | Blocked on AUTH registration |
| `04B` | Hidden contribution-policy service | 03B + 04A + exact AUTH registration/PREP contract | Blocked on AUTH registration |
| `05A` | Legacy semantic cutover + TaskAssignment policy freeze | 04B + task/assignment authority contract + row-classification decision | Proposed |
| `05A` | Legacy semantic cutover + initial TaskAssignment policy freeze and guarded human-revision rebase support | 04B + task/assignment/revision authority contract + row-classification decision | Proposed |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 4 'PLAN5|05A|guarded human-revision|entry gate|dependency' \
  .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary

Repository: Flow-Research/workstream

Length of output: 50383


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Chunk map relevant section:"
sed -n '1,75p' .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md

echo
echo "PLAN5 references in chunk metadata/status/plans:"
rg -n -C 3 '^ PLAN5|PLAN5|complete-context|needs_revision|rebase' \
  .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md \
  .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/PLAN.md \
  .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md \
  .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/chunks \
  --glob '*.md'

Repository: Flow-Research/workstream

Length of output: 40742


Align the 05A entry gate and dependency view with PLAN5.

CHUNK_MAP.md says 05A implements guarded human-revision rebase, but its entry gate lists 04B while the dependency view has no PLAN5 -> ... edge. Add PLAN5 to the 05A gate, or make PLAN5 a required predecessor in the dependency view if this chunk may consume the complete-context rebase contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md
at line 31, Align the 05A dependency metadata with PLAN5: update the 05A entry
gate and/or dependency view so PLAN5 is explicitly required before 05A when it
consumes the complete-context guarded human-revision rebase contract. Keep the
dependency representation consistent across both sections and preserve the
existing 04B prerequisite.

| `05B` | Legacy economic schema removal | 05A zero-consumer proof | Proposed |
| `06` | Reviewer policy lookup/freeze participant | 05B + REV lease contract/caller facts | Proposed; CON never owns lease |
| `03C` | ContributionRecord/CompensationAward persistence | 03B + merged REV Review/ReviewLease/FinalAcceptance targets | Proposed after REV-04B |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| Authorization | AUTH + each feature | current AUTH actor/grant/fixed-service/PREP and REV-readiness foundations, with current repository migrations through ART-owned `0050`; provisioning grants no service execution; CON mappings, identities, and static rows are absent on current main; every future artifact requires exact AUTH-owned registration and activation evidence, exact grant/static row, fixed-service admission, prepared handle bound to session/action/actor-ref/idempotency/request digest with substitution non-consumption, planned denial, and no local role logic | AUTH activation + CON-11 |
| Final acceptance | REV + 03C,07 | accept creates one immutable FinalAcceptance per task/Review/Submission; needs_revision/reject create none; no create API/action, reopen, replacement, or adjudication path | joint live drill |
| Contribution cardinality | 03C,07 + REV | one completed_review per valid Review with direct Review/lease lineage; one accepted_submission per FinalAcceptance with assignment lineage; mutually exclusive sources; revision Reviews distinct; automated outcomes create none | joint live drill |
| Policy freeze | 05A,06 + task/REV | exact submitter/reviewer fields; published version; no drift; publish/suspend races both orders | joint live drill |
| Policy freeze and human revision rebase | 05A,06,07 + task/REV | exact submitter/reviewer fields; published version; no publication-time drift; accept/reject use current-attempt freezes; human needs_revision keeps/rebases/blocks the complete context atomically, updates only the next-attempt submitter selector, preserves the completed lease/history, and each next lease freezes then-current reviewer terms; publish/suspend/rebase races both orders | joint live drill |
| Award evaluation | 03C,07 | matching frozen ContributionRule; unpaid creates none; at most one money/points; exact NUMERIC(38,18) definition copy; ISO 4217/project-scoped unit equality; no float, conversion, or rounding; replay stable | joint live drill |
| Atomic REV/CON | 07 + REV | reviewer operation before branch; accept-only submitter operation after FinalAcceptance/accepted effects; stabilized digest; REV stages audit/outbox; CON flushes contributions/awards; zero ART calls; complete rollback | REV-10 + joint live drill |
| Outbox isolation | 02A,02B | stable event/task IDs; claim fencing; retry/dead-letter/replay; dispatcher cannot inherit feature authority; handler returns typed outcome | CON-11 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,22 @@ fulfillment. Runtime reputation scoring remains deferred.

PLAN4 changes planning records only. The recommended next implementation is
03A, and it begins only after human approval from then-current main.

## D13 — Human revision rebases complete current context

Publication or activation never silently changes an active assignment,
Submission, or ReviewLease. Accept and reject finish under the versions frozen
for that attempt. After a human `needs_revision`, revision preparation compares
the complete applicable current Project Guide/source activation,
submission-artifact policy, pre-submit and post-submit checker policies, review
policy, revision policy, task-template/task-execution context, and
ContributionPolicyVersion. It atomically keeps unchanged components or rebases
all changed components for the next attempt.
The completed reviewer contribution retains its lease-frozen policy; the
revised submitter attempt uses the rebased assignment policy; and the next
ReviewLease independently freezes the then-current reviewer policy. Prior
Submissions, Reviews, ContributionRecords, and CompensationAwards remain
immutable. Incomplete or inconsistent current context blocks rather than
publishing a mixed version set. The Review, reviewer contribution/award, task
and assignment effects, initial preparation or blocked outcome, audit/outbox,
and contributor-visible state commit once or roll back together.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ operational claims with a capability-ordered plan, now refreshed through
## Success state

- ContributionPolicyVersion is the only award-policy authority.
- Publication never silently changes an active attempt. Human
`needs_revision` is the only in-progress boundary that atomically rebases
every changed applicable next-attempt context component, including the
submitter ContributionPolicyVersion; completed history remains immutable.
- TaskAssignment freezes the submitter policy version before work.
- REV-owned ReviewLease freezes the reviewer policy version before review.
- ContributionRecord and CompensationAward rows are immutable and replay-safe.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ CON-03B, while later REV-04B waits for CON-02C.
exact binding actions/contexts and keeps them unavailable until hidden proof.
6. `04B` adds hidden contribution-policy behavior under the same
registration-before-behavior-before-activation sequence.
7. `05A` removes semantic use of retired guide-bound economic terms and freezes
the submitter ContributionPolicyVersion on TaskAssignment.
7. `05A` removes semantic use of retired guide-bound economic terms, initially
freezes the submitter ContributionPolicyVersion on TaskAssignment, and
supplies the guarded update boundary later consumed by human revision
preparation for complete next-attempt rebase.
8. `05B` removes the now-unreachable legacy economic schema after an approved
deterministic row classification and zero-consumer proof.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
| CON invents AUTH identifiers or authority | Privilege escalation and dual authorization paths | AUTH exclusively registers contexts, actions, identities, matrices, evaluators, PREP, and activation. |
| REV/CON ownership blurs at policy freeze | CON could own ReviewLease or REV could own contribution policy | CON returns a policy-version lookup result; REV alone writes and transitions its lease. |
| ART/provider work enters review transaction | Availability coupling and broken atomicity | REV supplies stable artifact identity/hash; CON performs zero provider or ART calls. |
| Human revision mixes new guide/policies with stale contribution terms or rewrites completed awards | Incoherent contributor obligations and corrupted economic history | One task-owned complete-context preparation keeps/rebases/blocks atomically; only the next-attempt TaskAssignment selector changes; completed lease/contribution/award history remains immutable. |
| Planning evidence is treated as runtime | Wrong migration or dependency assumptions | Treat ART #249 as merged ART runtime and REV #258 as merged planning evidence only; refresh main before every implementation. |
| Migration collision with ART/REV | Broken linear history | Allocate only from the then-current Alembic head; no number is reserved in planning. |
| Legacy economic rows are guessed | Corrupted award policy lineage | Require explicit deterministic classification or fail closed before 05A/05B. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Reconciliation baseline

- Current `main`: `b47a7e64f7d75cda8a0681d1aff3bf0c4a5be4aa`.
- Current migration head: `0052_legacy_intake_removal`.
- Current `main`: `cda59fc32e3a60e1e2c337cae7ebeaa94b95e12b`.
- Current migration head: `0053_compensation_bindings`.
- Current capability ledger: `docs/roadmap_status.md`.
- Current contribution process: `AGENTS.md`, `CONTRIBUTING.md`, and
`.agent-loop/README.md`. Historical signed-start and merge-intent records are
Expand All @@ -21,6 +21,7 @@
- `docs/spec_authorization_service.md`
- `docs/spec_artifact_storage_service.md`
- `docs/decision_0009_review_decisions_are_canonical.md`
- `docs/decision_0010_revision_context_rebase.md`
- `docs/decision_0012_workstream_authorization_service.md`
- `docs/decision_0013_immutable_artifact_storage_boundary.md`
- `docs/decision_0014_external_service_adapter_convention.md`
Expand All @@ -36,8 +37,8 @@
persistence/append only; no dispatcher exists.
- `backend/app/modules/audit/**`: existing shared audit foundation; no typed
lifecycle participant yet.
- `backend/app/modules/compensation/**` and migration `0053` add only the
in-review adapter-binding schema; no creation/lifecycle service exists.
- `backend/app/modules/compensation/**` and merged migration `0053` add only the
adapter-binding schema; no creation/lifecycle service exists.
- Review queue persistence now exists; ReviewLease, Review, and FinalAcceptance
lifecycle implementation remain absent.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Current baseline

- Reconciled main: `b47a7e64f7d75cda8a0681d1aff3bf0c4a5be4aa`.
- Alembic head on main: `0052_legacy_intake_removal`.
- CON-01 and CON-02A are merged.
- CON-03A adapter-binding persistence is the active implementation chunk and
allocates linear migration `0053_compensation_bindings`.
- Runtime contains shared outbox persistence and the in-review compensation
binding schema only; contribution,
- Reconciled main: `cda59fc32e3a60e1e2c337cae7ebeaa94b95e12b`.
- Alembic head on main: `0053_compensation_bindings`.
- CON-01, CON-02A, and CON-03A are merged; 03A merged in PR #267.
- PLAN5 is the active documentation/specification reconciliation for the
human-confirmed complete-context `needs_revision` rebase rule.
- Runtime contains shared outbox persistence and the schema-only compensation
binding foundation; contribution,
dispatcher, fulfillment, operations, and CON API behavior remain absent.
- The pre-existing local deletion of the archival reference PDF is user-owned
and excluded from this planning change.
Expand Down Expand Up @@ -46,13 +46,14 @@ schema work. Current dependency analysis yields:

1. PLAN4 planning reconciliation.
2. CON-03A adapter-binding persistence.
3. CON-03B contribution-policy persistence, unblocking REV-03A2.
4. CON-02C lifecycle-audit participant before REV-04B.
5. Hidden policy/binding behavior and legacy clean cut as AUTH contracts become
3. PLAN5 complete-context human revision-rebase reconciliation.
4. CON-03B contribution-policy persistence, unblocking REV-03A2.
5. CON-02C lifecycle-audit participant before REV-04B.
6. Hidden policy/binding behavior and legacy clean cut as AUTH contracts become
available.
6. Contribution/award persistence after REV provides stable FK targets.
7. Atomic REV/CON participant after both sides' lineage exists.
8. Dispatcher and fulfillment later, after exact AUTH service registration.
7. Contribution/award persistence after REV provides stable FK targets.
8. Atomic REV/CON participant after both sides' lineage exists.
9. Dispatcher and fulfillment later, after exact AUTH service registration.

## Current blockers

Expand All @@ -69,7 +70,7 @@ schema work. Current dependency analysis yields:

## Immediate next action

Finish CON-03A schema evidence and review, publish it without the user-owned PDF
deletion, and stop at its PR checkpoint. Binding creation remains deferred to
04A after AUTH approves the exact adapter identity/capability contract; do not
start 03B or another CON chunk automatically.
Finish PLAN5 canonical reconciliation and stop at its PR checkpoint. It changes
no runtime. After human merge approval, 03B remains the next proposed runtime
chunk; binding creation remains deferred to 04A after AUTH approves the exact
adapter identity/capability contract.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

Remove the retired guide-bound economic contract from every semantic consumer,
classify existing rows, and freeze the active published
ContributionPolicyVersion on each successful new TaskAssignment. Physical dead-
schema removal belongs to 05B.
ContributionPolicyVersion on each successful new TaskAssignment. Supply the
same guarded current-version selection contract for later task-owned human
revision preparation; publication itself never mutates an assignment. Physical
dead-schema removal belongs to 05B.

## Risk

Expand Down Expand Up @@ -40,8 +42,10 @@ provider/artifact calls; unrelated checker behavior

## Acceptance criteria

- [ ] Every new TaskAssignment has immutable non-null
`submitter_contribution_policy_version_id`.
- [ ] Every new TaskAssignment has non-null
`submitter_contribution_policy_version_id`, initially frozen at claim and
mutable only by the explicit audited task-owned human revision preparation
path. Direct or publication-driven updates are rejected.
- [ ] Exact merged Submission.task_assignment_id lineage is preserved; no
parallel submission identity is added.
- [ ] No runtime/API/setup/task/checker/review consumer treats retired guide-
Expand All @@ -63,7 +67,11 @@ provider/artifact calls; unrelated checker behavior
manifest proves the freeze, canonical guards, rollback, and real-kernel
unavailable behavior before activation.
- [ ] Missing/invalid policy fails with no assignment/task/audit/outbox partial
state. Later publication never updates an assignment.
state. Later publication never updates an assignment. A later human
needs-revision preparation locks and validates the complete current context,
keeps an unchanged version or updates a changed valid version for the next
attempt, and records prior/next lineage atomically through the task-owned
lifecycle.
- [ ] Publish versus claim and binding-state versus claim pass both lock orders
without deadlock or mixed versions.
- [ ] Existing rows follow the approved deterministic classification and cannot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

Deliver the narrow CON policy lookup/freeze participant that REV invokes inside
the review-claim transaction. Reviewer award eligibility is frozen before
review work begins.
review work begins. Each new lease selects the version then current; publication
and prior task revision preparation never rewrite an existing lease.

## Risk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ TaskAssignment contribution-source lineage, submitter, or submitter policy.
The submitter operation exists only after REV creates FinalAcceptance and
applies accepted task/assignment effects. It receives exact locked
FinalAcceptance, TaskAssignment, versioned Submission, project/task, submitter
ActorProfile, assignment-frozen submitter ContributionPolicyVersion, the same
ActorProfile, submitter ContributionPolicyVersion selected on the assignment
for that exact prepared attempt, the same
authorization/request/correlation lineage, and stabilized artifact hash. It
never uses direct Review/ReviewLease contribution-source fields.

Expand All @@ -69,8 +70,9 @@ never uses direct Review/ReviewLease contribution-source fields.
- [ ] Repeated idempotent decision returns the same rows; a later revision
Review creates a distinct reviewer contribution; automated outcomes create
none.
- [ ] Reviewer uses lease-frozen policy; submitter uses assignment-frozen
policy. Matching explicit unpaid rule creates no award; compensated rule
- [ ] Reviewer uses lease-frozen policy; submitter uses the assignment policy
selected for the exact attempt, including any prior human-revision rebase.
Matching explicit unpaid rule creates no award; compensated rule
creates at most one money and one project-points award copied from immutable
definitions.
- [ ] CON copies the supplied stabilized digest exactly into
Expand All @@ -93,6 +95,12 @@ never uses direct Review/ReviewLease contribution-source fields.
audit/outbox step rolls back Review/FinalAcceptance/task/assignment/
contribution/award/audit/outbox together. The reviewer operation never
commits independently and no post-commit repair path exists.
- [ ] Needs revision composes the task-owned complete-context preparation after
the reviewer operation in the same caller transaction. The reviewer
contribution keeps its lease freeze; preparation may update only the next-
attempt assignment selector. Review, reviewer award, task/assignment effects,
preparation or blocked result, audit/outbox, and visibility roll back
together. CON-07 does not own the rebase.
- [ ] No FinalAcceptance create action/API exists. Static/runtime proof finds no
adjudication policy, grant/action, queue/lease, state, decision, contribution,
conditional branch, readiness check, or initiative dependency.
Expand Down
Loading
Loading