Skip to content

Commit 24f677c

Browse files
authored
Merge pull request #270 from Flow-Research/codex/ws-con-001-plan5-revision-rebase
docs(contribution): reconcile revision policy rebase
2 parents 5f2baf9 + 80ecef4 commit 24f677c

46 files changed

Lines changed: 611 additions & 199 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,24 @@ signed-loop records do not make behavior live.
1111
| `PLAN`-`PLAN3` | Original boundary and cross-initiative planning | Historical planning |
1212
| `01` | Canonical specification and ADR 0016 | Merged PR #144 |
1313
| `02A` | Shared transactional outbox persistence/append | Merged PR #155; migration 0029 |
14+
| `03A` | Adapter-binding persistence | Merged PR #267; migration 0053 |
1415

1516
## Current reconciliation
1617

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

2123
## Core runtime chunks
2224

2325
| Chunk | Goal | Entry gate | Status |
2426
|---|---|---|---|
25-
| `03A` | Adapter-binding persistence | PLAN4 accepted; refreshed after ART PR #264 | Active schema-only chunk; migration 0053 |
2627
| `03B` | Contribution-policy persistence | 03A | Proposed; unblocks REV-03A2 FK |
2728
| `02C` | Shared lifecycle-audit participant | PLAN4; current AuditEvent contract | Proposed; independent of dispatcher; required before REV-04B |
2829
| `04A` | Hidden adapter-binding service | 03A + exact AUTH registration/PREP contract | Blocked on AUTH registration |
2930
| `04B` | Hidden contribution-policy service | 03B + 04A + exact AUTH registration/PREP contract | Blocked on AUTH registration |
30-
| `05A` | Legacy semantic cutover + TaskAssignment policy freeze | 04B + task/assignment authority contract + row-classification decision | Proposed |
31+
| `05A` | Legacy semantic cutover + initial TaskAssignment policy freeze and guarded human-revision rebase support | 04B + task/assignment/revision authority contract + row-classification decision | Proposed |
3132
| `05B` | Legacy economic schema removal | 05A zero-consumer proof | Proposed |
3233
| `06` | Reviewer policy lookup/freeze participant | 05B + REV lease contract/caller facts | Proposed; CON never owns lease |
3334
| `03C` | ContributionRecord/CompensationAward persistence | 03B + merged REV Review/ReviewLease/FinalAcceptance targets | Proposed after REV-04B |

‎.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CONFORMANCE_MATRIX.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| 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 |
99
| 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 |
1010
| 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 |
11-
| Policy freeze | 05A,06 + task/REV | exact submitter/reviewer fields; published version; no drift; publish/suspend races both orders | joint live drill |
11+
| 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 |
1212
| 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 |
1313
| 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 |
1414
| 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 |

‎.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/DECISIONS.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,22 @@ fulfillment. Runtime reputation scoring remains deferred.
7272

7373
PLAN4 changes planning records only. The recommended next implementation is
7474
03A, and it begins only after human approval from then-current main.
75+
76+
## D13 — Human revision rebases complete current context
77+
78+
Publication or activation never silently changes an active assignment,
79+
Submission, or ReviewLease. Accept and reject finish under the versions frozen
80+
for that attempt. After a human `needs_revision`, revision preparation compares
81+
the complete applicable current Project Guide/source activation,
82+
submission-artifact policy, pre-submit and post-submit checker policies, review
83+
policy, revision policy, task-template/task-execution context, and
84+
ContributionPolicyVersion. It atomically keeps unchanged components or rebases
85+
all changed components for the next attempt.
86+
The completed reviewer contribution retains its lease-frozen policy; the
87+
revised submitter attempt uses the rebased assignment policy; and the next
88+
ReviewLease independently freezes the then-current reviewer policy. Prior
89+
Submissions, Reviews, ContributionRecords, and CompensationAwards remain
90+
immutable. Incomplete or inconsistent current context blocks rather than
91+
publishing a mixed version set. The Review, reviewer contribution/award, task
92+
and assignment effects, initial preparation or blocked outcome, audit/outbox,
93+
and contributor-visible state commit once or roll back together.

‎.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/INTENT.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ operational claims with a capability-ordered plan, now refreshed through
3131
## Success state
3232

3333
- ContributionPolicyVersion is the only award-policy authority.
34+
- Publication never silently changes an active attempt. Human
35+
`needs_revision` is the only in-progress boundary that atomically rebases
36+
every changed applicable next-attempt context component, including the
37+
submitter ContributionPolicyVersion; completed history remains immutable.
3438
- TaskAssignment freezes the submitter policy version before work.
3539
- REV-owned ReviewLease freezes the reviewer policy version before review.
3640
- ContributionRecord and CompensationAward rows are immutable and replay-safe.

‎.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/PLAN.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ CON-03B, while later REV-04B waits for CON-02C.
4141
exact binding actions/contexts and keeps them unavailable until hidden proof.
4242
6. `04B` adds hidden contribution-policy behavior under the same
4343
registration-before-behavior-before-activation sequence.
44-
7. `05A` removes semantic use of retired guide-bound economic terms and freezes
45-
the submitter ContributionPolicyVersion on TaskAssignment.
44+
7. `05A` removes semantic use of retired guide-bound economic terms, initially
45+
freezes the submitter ContributionPolicyVersion on TaskAssignment, and
46+
supplies the guarded update boundary later consumed by human revision
47+
preparation for complete next-attempt rebase.
4648
8. `05B` removes the now-unreachable legacy economic schema after an approved
4749
deterministic row classification and zero-consumer proof.
4850

‎.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/RISKS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
| CON invents AUTH identifiers or authority | Privilege escalation and dual authorization paths | AUTH exclusively registers contexts, actions, identities, matrices, evaluators, PREP, and activation. |
88
| 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. |
99
| ART/provider work enters review transaction | Availability coupling and broken atomicity | REV supplies stable artifact identity/hash; CON performs zero provider or ART calls. |
10+
| 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. |
1011
| 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. |
1112
| Migration collision with ART/REV | Broken linear history | Allocate only from the then-current Alembic head; no number is reserved in planning. |
1213
| Legacy economic rows are guessed | Corrupted award policy lineage | Require explicit deterministic classification or fail closed before 05A/05B. |

‎.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/SOURCE_MANIFEST.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Reconciliation baseline
44

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

‎.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## Current baseline
44

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

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

5758
## Current blockers
5859

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

7071
## Immediate next action
7172

72-
Finish CON-03A schema evidence and review, publish it without the user-owned PDF
73-
deletion, and stop at its PR checkpoint. Binding creation remains deferred to
74-
04A after AUTH approves the exact adapter identity/capability contract; do not
75-
start 03B or another CON chunk automatically.
73+
Finish PLAN5 canonical reconciliation and stop at its PR checkpoint. It changes
74+
no runtime. After human merge approval, 03B remains the next proposed runtime
75+
chunk; binding creation remains deferred to 04A after AUTH approves the exact
76+
adapter identity/capability contract.

‎.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/chunks/WS-CON-001-05A-legacy-economic-terms-cutover-and-task-freeze.md‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

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

1012
## Risk
1113

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

4143
## Acceptance criteria
4244

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

‎.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/chunks/WS-CON-001-06-review-lease-contribution-policy-freeze.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

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

910
## Risk
1011

0 commit comments

Comments
 (0)