feat(schedule): bind reason events to authoritative project versions - #548
feat(schedule): bind reason events to authoritative project versions#548seonghobae wants to merge 18 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…arent Rebuild the authoritative project-version transition child on exact current #519, preserving parent release-note/OpenCode/NIM and persistence evidence while carrying only the project-version adapter, tests, coverage wiring, and doctoring delta.
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| function countWorkItemIdentity(tasksJson, workItemId) { | ||
| let tasks; | ||
| try { | ||
| tasks = JSON.parse(tasksJson); | ||
| } catch { | ||
| throw new Error('project tasks_json is invalid'); | ||
| } | ||
| if (!Array.isArray(tasks)) { | ||
| throw new Error('project tasks_json is invalid'); | ||
| } | ||
| let count = 0; | ||
| for (const task of tasks) { | ||
| if (task && typeof task === 'object' && !Array.isArray(task) && task.id === workItemId) { | ||
| count += 1; | ||
| if (count > 1) { | ||
| throw new Error('project tasks_json contains duplicate work-item identity'); | ||
| } | ||
| } | ||
| } | ||
| return count; | ||
| } |
There was a problem hiding this comment.
📝 Info: Membership scan only checks top-level tasks
countWorkItemIdentity (server/schedule_reason_event_project_version.mjs:60-80) inspects only top-level entries of the parsed tasks_json array. This matches today's flat tasks array persisted in server/app.mjs:272-276. A future move to nested work items would make valid IDs unfindable, silently failing transitions closed.
Was this helpful? React with 👍 or 👎 to provide feedback.
Buyer / data-integrity objective
Refs #287. This stacked Draft binds already-authorized terminal schedule reason events to ScopeWeave's authoritative project-plan concurrency field on the same SQLite connection before reason-event and immutable audit evidence can commit. A stale plan, wrong tenant/project, missing or ambiguous work-item identity, malformed authority token, or rollback failure must fail closed without creating a parallel work-item version store.
Exact current stack
feat/schedule-reason-event-sqlite-287@92858d9dd4852c1771d034d69bc7428dcb355e16;feat/schedule-reason-project-version-287;22883d1667891080bc5c9fdc2c5e721edb7833c7;CHANGELOG.md,docs/doctoring/schedule-reason-project-version.md,package.json,server/schedule_reason_event_project_version.mjs,tests/unit/coverage-script-contract.test.mjs, andtests/unit/schedule-reason-project-version.test.mjs;Parent #519 moved after the previous child reconciliation. The parent-only movement from predecessor
2360d0cc...to current92858d9...changes onlyserver/schedule_outcome_domain.mjsandtests/unit/schedule-outcome-domain-edge.test.mjs, disjoint from this child's six-path semantic delta.22883d1...therefore non-destructively merged the exact live parent while preserving both the parent’s explicit-offset schedule evidence repair and this child’s project-version adapter. Fresh comparison proves the live parent is the exact merge base with no inherited parent deletion or weakening.Implemented contract
server/schedule_reason_event_project_version.mjs:project_version:<positive-safe-integer>tokens;projects.tasks_jsonsnapshot observed at the expected project version;Number.MAX_SAFE_INTEGER.When invoked by #519's repository inside its savepoint, the authoritative project-version transition rolls back together with reason-event/audit persistence. The integration regression deliberately triggers a duplicate immutable audit identity after a real project-version update and proves both the version and child event writes roll back.
TDD chronology
a11c99db7fe379a60fc01702bbca8bf45a1915a4registered the project-version contract while the production module was absent.63b67b17355c5beae41b5c14b83d214b12691a62added a whitespace-only work-item identity case and failedunit-and-apion that exact test head.dc8d1b88af48b8f00d4bf4412ed79cb6d9e8c23arejected blank identity before database lookup.22883d1667891080bc5c9fdc2c5e721edb7833c7is stack reconciliation only; it adds no unique project-version behavior beyond preserving both exact parent and child trees.Current exact-head evidence
Repository-native workflows for exact contributor head
22883d1667891080bc5c9fdc2c5e721edb7833c7are currently queued:32808630649;32808630768;32808631129.Queued, pending, skipped-required, cancelled, absent, neutral-required, failed, stale, predecessor, synthetic-only, status-only, author-only, or model-only evidence is non-passing. No SAST/Security/Fuzz exact-head evidence is currently established. ScopeWeave #523 owns repository-native exact-head Server Tests/coverage integrity;
ContextualWisdomLab/.github#1222owns reusable required SAST/Security exact-head checkout integrity. Do not churn this clean head merely to provoke a retry.Stack / integration boundary
This slice does not add a route/UI, new table, dependency, workflow, scanner suppression, branch-protection change, or competing work-item source of truth. Current child #597 owns the authenticated HTTP write slice and must remain reconciled to this exact parent while the stack is active.
Remain Draft. After #519/#518/#517/#515 reach protected
develop, reconcile only this bounded semantic delta onto the resulting fresh protected head and regenerate every then-applicable exact-head CI/browser/owned statement-branch-function-line coverage/docstring/CodeQL/SAST/security/dependency/supply-chain/package/provenance/recovery/review gate. Valid unresolved findings must be zero and a qualifying independent current-head/last-push approval must exist.Refs #287