| 項目 | 內容 |
|---|---|
| 緣由 | Bug O 收尾 E2E 測試時 user 發現 3 個跟 Bug O scope 無關的 bug — 都集中在 docx import preview UI 的負責單位 / 參與人員 sections |
| Branch | feature/ssp-oscal-alignment(接續 H-N + Bug O arc,這是 H-N arc 第 11~13 個 follow-up) |
| 接手前必讀 | 本文件自包含 — 按 §0 順序讀本檔 + Bug O FIXED-SUMMARY 確認 Bug O 已收尾即可 |
| 預估時間 | 3-6 小時(3 個 bug,跨 BE + FE,需 trace + reproduce) |
docs/features/FR-028-2605-ssp-oscal-alignment/handoff/2026-05-25-bug-o-FIXED-SUMMARY.md — 確認 Bug O 已收尾(特別是 §5.1 知道你接手的是這 3 個 bug)~/Projects/Billows/Audit-Manager/compliance-manager-fe/src/components/grc/ssp-docx-import-v2/sections/PartiesSection.vue~/Projects/Billows/Audit-Manager/compliance-manager-fe/src/components/grc/ssp-docx-import-v2/sections/PartyLinkDialog.vue~/Projects/Billows/Audit-Manager/compliance-manager-fe/src/components/grc/ssp/SspPartiesTab.vue(如有)負責單位 / 參與人員 兩 tab 的對應元件app/oscal/service/ssp_docx_import_app_service.py _filter_parties_for_write (~line 996) + 後續 strategy.write_parties~/Projects/Billows/Audit-Manager/compliance-manager-fe/CLAUDE.md讀完後跑 §6 Pre-flight + §7 Verify Bug O close → §3 開工順位。
User-facing:
org_unit_id)推測 root cause:
User-facing:
推測 root cause:
User-facing:
推測 root cause (待 trace):
strategy.write_parties 但因為某個 condition fall through 沒寫_apply_v3_decisions 改動可能影響 parties write path(雖然 parties 不在 _V3_LIST_KEYS 內,但 confirm 流程改動可能 side effect)# 1. 找最近的 confirm import job
PGPASSWORD='jedi@123!' psql -h 192.168.50.188 -p 25432 -U cmmgr -d guidant_ai_dev -A -c "
SET app.is_super_admin='t';
SELECT id, source_uid, status, import_summary, updated_at
FROM oscal.ssp_docx_parse_jobs WHERE status='completed' ORDER BY id DESC LIMIT 3;
"
# 2. 看 import_summary 裡的 parties_written count
# 預期:若 BE 真寫,count > 0;若 0 → bug R 是 BE 沒寫
# 3. 對應 mf → template SSP → parties
PGPASSWORD='jedi@123!' psql -h 192.168.50.188 -p 25432 -U cmmgr -d guidant_ai_dev -A -c "
SET app.is_super_admin='t';
SELECT p.uid AS party_uid, p.name, p.party_type, p.created_at, p.created_user
FROM oscal.oscal_parties p
JOIN oscal.system_security_plans s ON s.id = p.ssp_id
JOIN oscal.profiles pr ON pr.id = s.profile_id
JOIN public.module_frames mf ON mf.oscal_profile_uid = pr.uid::text
WHERE mf.uid = '<MF_UID>'
ORDER BY p.created_at DESC LIMIT 10;
"
# 看 created_at 是否在 confirm 之後 — 是 → 真寫了 (bug R = FE cache)
# 否 → 沒寫 (bug R = BE)
# 4. BE log
grep -A 20 "write_parties\|parties_written" log/app.log | tail -50<key>_diff suffixannotate_parse_result 時漏 wire GET 那條,本期改 BE 任何方法時 grep 所有 call site| 檔案 | 為何 read / 改 |
|---|---|
app/oscal/service/ssp_docx_import_app_service.py (_filter_parties_for_write / confirm_import parties path) |
trace parties 寫入;確認 Bug O 改動沒 side effect |
domain/oscal/service/write_strategy/...party*write* (若有) |
parties write strategy 邏輯 |
app/oscal/service/party_context_service.py |
既有 party 寫入/更新 path |
tests/test_ssp_docx_import_app_service.py (parties_written / unlinked test cases) |
regression test reference |
| 檔案 | 為何 read / 改 |
|---|---|
~/Projects/Billows/Audit-Manager/compliance-manager-fe/src/components/grc/ssp-docx-import-v2/sections/PartiesSection.vue |
Bug Q 補 role dropdown / Bug P 對 party_type 分流 button |
~/Projects/Billows/Audit-Manager/compliance-manager-fe/src/components/grc/ssp-docx-import-v2/sections/PartyLinkDialog.vue |
Bug P dialog 邏輯 — 確認 org / user 分開 |
~/Projects/Billows/Audit-Manager/compliance-manager-fe/src/components/grc/ssp/SspPartiesTab.vue (template-edit 端) |
對比 template-edit 怎麼處理 — wording / role dropdown / org link 都對齊 |
~/Projects/Billows/Audit-Manager/compliance-manager-fe/src/components/grc/ssp-docx-import-v2/SspDocxImportPage.vue (confirm 後 reset 邏輯) |
Bug R FE cache invalidate path |
~/Projects/Billows/Audit-Manager/compliance-manager-fe/src/stores/sspDocxImportStore.js reset() |
confirm 成功後 reset 是否真的清掉 / 重 GET |
~/Projects/Billows/Audit-Manager/compliance-manager-fe/CLAUDE.md# 1. 兩 repo branch + working tree
git -C ~/Projects/Billows/Audit-Manager/compliance-manager-be branch --show-current
git -C ~/Projects/Billows/Audit-Manager/compliance-manager-fe branch --show-current
# 預期:兩個都 feature/ssp-oscal-alignment
git -C ~/Projects/Billows/Audit-Manager/compliance-manager-be status --short
git -C ~/Projects/Billows/Audit-Manager/compliance-manager-fe status --short
# 預期:clean (Bug O 已 commit 完)
# 2. local vs origin
git -C ~/Projects/Billows/Audit-Manager/compliance-manager-be log origin/feature/ssp-oscal-alignment..HEAD --oneline
git -C ~/Projects/Billows/Audit-Manager/compliance-manager-fe log origin/feature/ssp-oscal-alignment..HEAD --oneline
# 預期 BE 9+ commits ahead;FE 4 commits ahead — 看 user 是否已 push
# 3. BE / FE listener
lsof -t -i:8000 && echo "BE up" || echo "BE down — restart needed"
lsof -t -i:5180 && echo "FE up" || echo "FE down"
# 4. BE pytest smoke
cd ~/Projects/Billows/Audit-Manager/compliance-manager-be
poetry run pytest tests/test_ssp_docx_import_app_service.py \
tests/test_ssp_docx_diff_service.py \
tests/test_ssp_write_strategy.py -q
# 預期 ~210+ passed# 6.1 H-6 cleanup verify — 4 OSCAL 表 org_unit_id 應全 NULL
PGPASSWORD='jedi@123!' psql -h 192.168.50.188 -p 25432 -U cmmgr -d guidant_ai_dev -A -c "
SET app.is_super_admin='t';
SELECT 'parties' AS tbl, count(*) AS bad FROM oscal.oscal_parties WHERE org_unit_id IS NOT NULL
UNION ALL SELECT 'leveraged', count(*) FROM oscal.ssp_leveraged_authorizations WHERE org_unit_id IS NOT NULL
UNION ALL SELECT 'components', count(*) FROM oscal.ssp_components WHERE org_unit_id IS NOT NULL
UNION ALL SELECT 'inventory', count(*) FROM oscal.ssp_inventory_items WHERE org_unit_id IS NOT NULL;
"
# 預期 4 row all bad=0
# 6.2 Bug O annotate 對 v3 4 key 真有套 — 看最近 awaiting_review job
PGPASSWORD='jedi@123!' psql -h 192.168.50.188 -p 25432 -U cmmgr -d guidant_ai_dev -A -c "
SET app.is_super_admin='t';
SELECT id, jsonb_object_keys(parsed_result) FROM oscal.ssp_docx_parse_jobs
WHERE status='awaiting_review' ORDER BY id DESC LIMIT 1;
"
# 預期 keys 含:components / components_diff / leveraged_authorizations / leveraged_authorizations_diff
# / inventory_items / inventory_items_diff / system_characteristic / system_characteristic_diff
# 若 _diff key 缺 = Bug O regression 跑回去了unselectable=truefeedback_no_chinglish)feedback_plan_vs_reality_verify_first)— Bug Q「原本好像有」是 user 記憶,先 git log 確認 H-N refactor 是否真移除過docs/conversation-history/<YYYY-MM-DD>/bug-pqr/請閱讀交接文件,了解現況,並接手 Bug P / Q / R 開發。
交接文件路徑:
docs/features/FR-028-2605-ssp-oscal-alignment/handoff/2026-05-25-bug-p-q-r-parties-form-handoff.md
按本檔 §0 接手讀序執行 — 必跑 §6 Pre-flight + §7 Verify Bug O close →
§3 開工順位。注意 §2 前次教訓 + §7 行為規範。
3 個 bug 摘要:
- Bug P: 負責單位點「連結帳號」跳 Error 且應連 org_unit 非 user (FE PartiesSection)
- Bug Q: 參與人員少了「角色」下拉 (FE PartiesSection refactor regression?)
- Bug R: 確認匯入後 parties 沒更新(trace BE write OK 還是 FE cache 沒 invalidate)
依 §3 順序,第 2 步 enter plan mode 寫 implementation plan 給 user approve 才開工。
Bug R 先驗 root cause (5 分鐘 DB SQL + log grep)再決定怎修。
Bug P / Q / R 是 H-N arc 第 11~13 個 follow-up,跟 Bug O 改動 scope 解耦(負責單位連結 / 角色下拉 / confirm 後 reload — 都不是 diff stepper 也不是 4 key annotation 直接相關)。
Bug O 已 closed(diff stepper 6-tab + 4 key annotation + confirm filter 全 ship),但 user E2E 測試時發現 docx import preview UI 的 parties form 還有 3 個獨立 bug。
本期 P/Q/R 是 H-N arc「user-facing complete」前的最後幾步 — 完成後 docx import update mode 整段才算 v1 stable。