Skip to content

feat(schedule): establish four-level work-item hierarchy domain - #515

Open
seonghobae wants to merge 17 commits into
developfrom
feat/work-item-hierarchy-domain-287
Open

feat(schedule): establish four-level work-item hierarchy domain#515
seonghobae wants to merge 17 commits into
developfrom
feat/work-item-hierarchy-domain-287

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Buyer outcome

Refs #287. This bounded root slice establishes the executable, framework-neutral Phase → Activity → Task → Duty hierarchy boundary needed before ScopeWeave can safely expose a fourth planning level. It preserves legacy three-level plans and customer-supplied fields without synthesizing customer work.

Exact current scope

  • protected live base: develop@2c328875e00e86537df3e965170be80532571cad;
  • exact contributor head: 36c11dd0bf907569184d7d73172b675d21bd0ff1;
  • exact head tree: e57b5a991fd244583094dd3994c97d1cfd94631e;
  • current shape: Ready and mechanically mergeable with six changed hierarchy/evidence paths;
  • current stacked successor: feat(schedule): derive auditable schedule outcomes #517 feat/schedule-outcome-domain-287@73ce4227d761c79a9fcad39b0455fec4b35b6274, whose PR base resolves to this exact parent head;
  • a fresh current-head review-thread sweep returns zero unresolved threads; and
  • no qualifying independent current-head APPROVED review is present.

The branch previously absorbed protected-base movement non-destructively and preserves the bounded hierarchy delta plus protected behavior. Any future base/head movement invalidates revision-sensitive evidence until refetched.

TDD and data-integrity evidence

  • RED 29ef935f9356c59b88eda2d1c648acb78848781b introduced the focused test while server/work_item_hierarchy.mjs was absent, producing ERR_MODULE_NOT_FOUND before implementation.
  • bcc5f70200dc3d2a45fcb6acf0dd427485a93c32 added the initial validator/projection; 8299740f9417dcfaa9a9642f73936ab4e02a3f5c wired it into canonical unit and c8 coverage; ba26b89260ba8ac5142fc7c2ea76c0bb4f475036 added the initial evidence record.
  • CodeRabbit identified a valid persisted-field collision: derived kind and sourceIndex could overwrite customer fields. Regression commit 458cc39ba0a7a6f66bf35ea8d0533c6c4554fddb changed the contract first.
  • 8f4981060d3c35776657d2fb90c12e7594daaa7b fixed the causal defect by returning immutable wrappers { record, kind, sourceIndex }, keeping customer fields in the immutable nested record while preserving parent normalization and level derivation.
  • da31ed0cce6970d54544af6391d3bbbd968565a7 directly asserts immutability; f9cdca28d1e2c276b61019a98453a82de1420c20 corrected migration-like wording to projection.
  • Both CodeRabbit actionable findings are resolved and outdated. The OpenCode CHANGES_REQUESTED review targets predecessor head 2f082ebaead953788b968c3d01b792c501fdc538, where the branch was conflicting; that causal condition has been repaired, the review is dismissed/stale, and it is not approval evidence for the current head.
  • Devin's current-line cycle-detection observation was verified as informational: findCycleIds correctly excludes tail nodes leading into a cycle. That thread is now resolved and does not establish approval.

Behavior contract

  • validates Phase → Activity → Task → Duty relationships independent of input ordering;
  • keeps existing three-level plans three-level and never synthesizes a Duty;
  • preserves IDs, relationships, source ordering, and customer fields, including names that collide with projection metadata;
  • fails closed on malformed containers, non-string or blank/unsafe IDs, duplicates, missing parents, invalid parent depth, cycles, and depth outside 1–4;
  • normalizes only absent root-parent representation in the projected record; and
  • includes a realistic 10,000-record portfolio regression without a flaky wall-clock assertion.

Current exact-head evidence

For exact contributor head 36c11dd0bf907569184d7d73172b675d21bd0ff1, the associated pull-request workflow generation is terminal GitHub-success at the run level:

  • Server Tests 32508691240;
  • SAST Semgrep 32508691555;
  • Security Scan 32508691488;
  • Dependency Review 32508691332;
  • Fuzz 32508691249; and
  • OSV Scanner 32508691843.

These statuses are associated evidence, not sufficient authorization by themselves. ScopeWeave #523 owns repository-native exact-contributor Server Tests/coverage checkout integrity, while ContextualWisdomLab/.github#1222 owns organization-reusable SAST/Security exact-head checkout integrity. Until those control repairs are protected-shipped and downstream canaries prove the actual tested/scanned checkout identity, synthetic/predecessor/status-only evidence remains non-authorizing.

Standards and integration boundary

docs/doctoring/work-item-hierarchy.md records active-PR versus shipped truth, repair chronology, rollback/integration boundaries, and APA 7 references. ISO 21511:2018 is treated as the current published WBS standard; ISO/DIS 21511 Edition 2 is research context rather than final normative authority. PMI's 2019 WBS practice standard supports life-cycle-neutral decomposition. ScopeWeave's exact four labels are a product decision, not an ISO or PMI mandate.

This PR does not close #287. Later bounded integration must wire the domain into editor validation and labels, import/export, persistence/API contracts, analytics traversal, browser E2E, migration and rollback acceptance. Schema ownership remains separate from #433/#500.

Merge gate

Do not merge or enable auto-merge until the unchanged current head remains reconciled to freshly resolved protected develop, repository-native and centrally owned exact-head evidence controls are protected-shipped and regenerated, every applicable CI/browser/owned statement-branch-function-line coverage/docstring/CodeQL/SAST/security/dependency/supply-chain/package/provenance/required-workflow gate is substantively terminal-passing, valid unresolved current-head defects are zero, and the live pull-request rule is satisfied by one qualifying independent current-head approval under active ruleset 18156473. That ruleset does not require latest-push approval. Do not self-approve or transfer predecessor/model evidence.

Refs #287


Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Phase → Activity → Task → Duty 4단계 계층의 검증기와 투영 함수를 추가했습니다. 레거시 3단계 ID와 입력 순서를 보존합니다. 오류 검증, 순환 탐지, 규모 테스트, 문서 및 커버리지 계약을 추가했습니다.

Changes

Work-item 계층 도메인

Layer / File(s) Summary
계층 계약 및 검증
server/work_item_hierarchy.mjs
공개 계층 레벨을 추가했습니다. 레코드 형식, ID, 깊이, 부모 관계, 중복, 안전하지 않은 키와 순환 참조를 검증합니다.
검증 결과 기반 투영
server/work_item_hierarchy.mjs
유효한 레코드를 원본 순서와 필드를 유지하는 불변 객체로 투영합니다. parentId, kind, sourceIndex를 추가합니다.
테스트 및 계약 검증
tests/unit/work-item-hierarchy.test.mjs, tests/unit/coverage-script-contract.test.mjs, package.json, docs/doctoring/work-item-hierarchy.md, CHANGELOG.md
4단계 및 레거시 3단계 동작, 오류 처리, 10,000개 항목 규모, 커버리지 실행과 도메인 계약을 검증하고 기록합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🟡 Moderate · up to ba26b

The hierarchy projection can silently overwrite caller-provided kind and sourceIndex values, conflicting with the stated preservation contract and risking incorrect data for consumers. Merge should wait for this bounded correctness issue to be fixed or explicitly accepted.

Sequence Diagram(s)

sequenceDiagram
  participant 호출자
  participant validateWorkItemHierarchy
  participant projectWorkItemHierarchy
  호출자->>validateWorkItemHierarchy: Work-item 레코드 배열 전달
  validateWorkItemHierarchy-->>projectWorkItemHierarchy: 검증 결과와 오류 코드 반환
  projectWorkItemHierarchy-->>호출자: 정규화된 계층 객체 또는 예외 반환
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 Phase → Activity → Task → Duty 4단계 작업 항목 계층을 구축하는 PR의 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/work-item-hierarchy-domain-287

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as resolved.

@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copy link
Copy Markdown
Contributor Author

@opencode-agent review

Please submit a formal review for exact current head b23639e81d100e2e20ff53d6667e456d381bc153 against protected develop@44e7903cf8891c65410f7fc6ca5144de3fdb5185. Re-evaluate only current source after the resolved predecessor findings: derived hierarchy metadata must not overwrite customer kind/sourceIndex, projected records remain immutable, Phase→Activity→Task→Duty validation is order-independent, legacy three-level plans remain three-level, no Duty is synthesized, and malformed/depth/cycle/parent errors fail closed. Current opencode-review check 95240669704 is terminal success; the only formal review is predecessor CodeRabbit COMMENTED. Review only; do not mutate, merge, weaken gates, or transfer predecessor findings.

Reconcile the hierarchy-domain root onto current protected develop, preserving #545 NVIDIA NIM/OpenCode configuration and released-note regressions while retaining the work-item hierarchy unit/coverage registrations.
seonghobae added a commit that referenced this pull request Aug 17, 2026
Rebuild the schedule-outcome child on the exact current #515 hierarchy head, preserving the parent OpenCode/NIM and release-note protections while retaining only the bounded outcome-domain source, tests, coverage registration, and documentation delta.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode reviewed the current-head mergeability evidence and changed-file flow before approval, then found merge conflicts on the affected path.

Findings

1. HIGH Merge Conflict Guidance - Resolve the PR branch against the latest base branch

  • Problem: GitHub reports mergeStateStatus DIRTY for this pull request.
  • Root cause: Branch feat/work-item-hierarchy-domain-287 cannot be merged cleanly into develop; the changed-file flow below shows which review/runtime path is blocked by the conflict.
  • Fix: Merge or rebase the latest develop into feat/work-item-hierarchy-domain-287, resolve conflict markers in the PR branch, rerun the focused checks, and push the same branch.
  • Repair commands:
gh pr checkout 515 --repo ContextualWisdomLab/scopeweave
git fetch origin develop
git merge --no-ff origin/develop  # or: git rebase origin/develop
git status --short
# resolve files, then git add <resolved-files>
# merge path: git commit
# rebase path: git rebase --continue
git push origin HEAD:feat/work-item-hierarchy-domain-287
# rebase path only: git push --force-with-lease origin HEAD:feat/work-item-hierarchy-domain-287
  • Regression test: Keep OpenCode approval gated on mergeability so model-output failures cannot approve a conflicted PR.

Merge Conflict Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["required checks"]
  Evidence --> S2["Docs: work-item-hierarchy.md"]
  S2 --> I2["operator or user guidance"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["docs review"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["targeted test run"]
Loading
  • Result: REQUEST_CHANGES
  • Reason: mergeStateStatus is DIRTY; mergeable is CONFLICTING.
  • Head SHA: 2f082ebaead953788b968c3d01b792c501fdc538
  • Workflow run: 32188796983
  • Workflow attempt: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["required checks"]
  Evidence --> S2["Docs: work-item-hierarchy.md"]
  S2 --> I2["operator or user guidance"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["docs review"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["targeted test run"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 2f082ebaead953788b968c3d01b792c501fdc538
  • Workflow run: 32188796983
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode reviewed the current-head mergeability evidence and changed-file flow before approval, then found merge conflicts on the affected path.

Findings

1. HIGH Merge Conflict Guidance - Resolve the PR branch against the latest base branch

  • Problem: GitHub reports mergeStateStatus DIRTY for this pull request.
  • Root cause: Branch feat/work-item-hierarchy-domain-287 cannot be merged cleanly into develop; the changed-file flow below shows which review/runtime path is blocked by the conflict.
  • Fix: Merge or rebase the latest develop into feat/work-item-hierarchy-domain-287, resolve conflict markers in the PR branch, rerun the focused checks, and push the same branch.
  • Repair commands:
gh pr checkout 515 --repo ContextualWisdomLab/scopeweave
git fetch origin develop
git merge --no-ff origin/develop  # or: git rebase origin/develop
git status --short
# resolve files, then git add <resolved-files>
# merge path: git commit
# rebase path: git rebase --continue
git push origin HEAD:feat/work-item-hierarchy-domain-287
# rebase path only: git push --force-with-lease origin HEAD:feat/work-item-hierarchy-domain-287
  • Regression test: Keep OpenCode approval gated on mergeability so model-output failures cannot approve a conflicted PR.

Merge Conflict Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["required checks"]
  Evidence --> S2["Docs: work-item-hierarchy.md"]
  S2 --> I2["operator or user guidance"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["docs review"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["targeted test run"]
Loading
  • Result: REQUEST_CHANGES
  • Reason: mergeStateStatus is DIRTY; mergeable is CONFLICTING.
  • Head SHA: 2f082ebaead953788b968c3d01b792c501fdc538
  • Workflow run: 32188796983
  • Workflow attempt: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["required checks"]
  Evidence --> S2["Docs: work-item-hierarchy.md"]
  S2 --> I2["operator or user guidance"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["docs review"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["targeted test run"]
Loading

Merge Conflict Guidance

  • Current merge state: DIRTY
  • Base branch: develop
  • Head branch: feat/work-item-hierarchy-domain-287
  • Fix direction: merge or rebase origin/develop into feat/work-item-hierarchy-domain-287, resolve conflict markers in the changed files, rerun the focused checks, then push the same branch.
  • Repair commands:
gh pr checkout 515 --repo ContextualWisdomLab/scopeweave
git fetch origin develop
git merge --no-ff origin/develop  # or: git rebase origin/develop
git status --short
# resolve files, then git add <resolved-files>
# merge path: git commit
# rebase path: git rebase --continue
git push origin HEAD:feat/work-item-hierarchy-domain-287
# rebase path only: git push --force-with-lease origin HEAD:feat/work-item-hierarchy-domain-287

Resolve PR #515 against protected develop@df0fa17bd5035af6455c889022c540b4f439e3d6 without rebasing or force-pushing. Preserve the six hierarchy-domain/evidence paths while retaining protected orchestrator attribution unit/API/coverage registrations from #496.
seonghobae added a commit that referenced this pull request Aug 19, 2026
Bring PR #517 onto current parent #5157e5278f without rebasing or force-pushing. A follow-up stack-preservation commit restores the current-parent shared package/changelog state while retaining the bounded schedule-outcome delta.
seonghobae added a commit that referenced this pull request Aug 19, 2026
Restore the current #515 hierarchy/orchestrator tree while retaining only the bounded schedule-outcome delta. Preserve tenant-bound orchestrator attribution source/tests/docs and combine package/changelog registrations without transferring stale parent content.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread server/work_item_hierarchy.mjs
@opencode-agent opencode-agent Bot added priority: medium Normal-priority or P2 work scope: product-gap Customer-visible product gap status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability labels Aug 22, 2026
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Caution

Review failed

An 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 주요 변경 사항인 Phase → Activity → Task → Duty 4단계 작업 항목 계층 도메인의 수립을 정확하고 간결하게 설명합니다.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae dismissed opencode-agent[bot]’s stale review August 25, 2026 15:54

Dismissed as predecessor-head evidence only. This review is anchored to 2f082ebaead953788b968c3d01b792c501fdc538, where GitHub reported the branch conflicting with develop. The live PR is now 36c11dd0bf907569184d7d73172b675d21bd0ff1 against protected develop@2c328875e00e86537df3e965170be80532571cad, is currently mergeable, and the current-head repository workflow generation completed its product checks. This dismissal is not an approval and does not satisfy the current independent-review/last-push requirement; neutral/non-exact/stale evidence remains non-authorizing.

Copy link
Copy Markdown
Contributor Author

@opencode-agent review

Review-only request for exact current head 36c11dd0bf907569184d7d73172b675d21bd0ff1 against protected develop@2c328875e00e86537df3e965170be80532571cad. Bind any verdict to this exact head and live base. Re-verify that derived hierarchy metadata cannot overwrite customer kind/sourceIndex, projected wrappers/records preserve the documented immutability contract, Phase→Activity→Task→Duty validation is order-independent, legacy three-level plans remain three-level without synthesizing Duty records, and malformed/depth/cycle/parent relationships fail closed. All current review threads are resolved; the prior OpenCode REQUEST_CHANGES targets conflicted predecessor head 2f082eba... and is dismissed/stale. Do not transfer predecessor-head, model-only, synthetic-merge, or status-only evidence into the current verdict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Normal-priority or P2 work scope: product-gap Customer-visible product gap status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

epic: decision-ready schedule intelligence and Waterfall↔Agile projection

1 participant