이전 메시지 불러오는 중…
변우석의 요청:
변우석입니다. 2단계 거의 다 됐습니다. 작업트리 진단:
- complaint/routes.tsx, draft/routes.tsx: /docs/:slug용으로 slug-context화 완료(GET/POST /new, /work/:id, base=/docs/${slug} 적용 확인).
- 미완 3가지만 남았습니다. 이것만 완결해 tsc까지 통과시켜 주세요(빌드·배포·검증은 제가 닫습니다):
1) **index.tsx 마운트**: 현재 app.route('/complaint-draft', draftRoutes) / app.route('/complaint', complaintRoutes) 그대로 → /docs/:slug 마운트가 없어 작업트리가 깨진 상태(complaint이 param('slug') 의존인데 /complaint로 마운트됨). app.route('/docs/:slug', complaintRoutes) + app.route('/docs/:slug', draftRoutes)로 바꿔주세요.
2) **구경로 redirect 라우터**(Plan D대로): /complaint·/complaint?type=→/docs/<slug>(301 GET), /complaint-draft·?type=→/docs/<slug>/new(301), /complaint-draft/work/:id 및 하위 GET(poll/print/hwpx/evidence/doc-source/checklist)→/docs/<slug>/work/:id...(301, slug는 세션 matter_documents.doc_type→docTypeToSlug, fallback sojang), POST 3종(doc-source·attachment/delete·checklist)→308. 지금 열려있는 작업대 탭(프로덕션 실사용) 무중단이 목적입니다.
3) **draft/routes.tsx 잔여 /complaint-draft 하드코딩 10곳**을 base로 치환 + **tsc 5에러**(complaint:51, draft:116·128·349·358 — slug가 string|undefined인데 string 요구) 가드. slug=c.req.param('slug')??'' 후 slugToDocType 결과 없으면 notFound 패턴이면 됩니다.
doc_nav.ts·shell.tsx는 이미 M 상태인데 /docs/<slug>로 잘 바뀌었는지도 확인해 주세요. 롤백 체크포인트 pre-step2-checkpoint 있으니 안전합니다. tsc 통과 상태로만 넘겨주시면 제가 빌드→테스트(lax-dtb)→프로덕션(axwiki) 배포하고 /docs/sojang·/docs/jigeup-myeongryeong 라이브 검증까지 하겠습니다. 한 턴에 무리면 1)+3)(마운트+tsc) 먼저, 2)(redirect) 다음으로 나눠도 됩니다.
tsc 통과(EXIT=0, 에러 0). 변우석님이 빌드·배포·라이브 검증을 닫으시니 여기서 넘깁니다.
보고
[무엇을 바꿨나]
| # | 파일 | 변경 |
|---|---|---|
| 1 | complaint/routes.tsx :50 |
c.req.param('slug') ?? '' 가드 → tsc :51 해소 |
| 1 | draft/routes.tsx :115, :348 |
동일 가드 2곳 → tsc :116·128·349·358 해소 |
| 2 | index.tsx :84-85 |
app.route('/docs/:slug', complaintRoutes) + app.route('/docs/:slug', draftRoutes)로 교체 |
| 2 | index.tsx :65 |
/draft → /docs/sojang 직행(이중 홉 제거) |
| 2 | app/docs_legacy.ts 신설 |
구경로 리디렉트 라우터 등록(app.route('/', …)) |
| 3 | doc_nav.ts docHref() |
동적 메뉴 4종 → /docs/sojang·jigeup-myeongryeong·dapbyeon·junbi-seomyeon |
| 3 | shell.tsx 정적 폴백 메뉴 4종 |
href + match(활성표시) 모두 /docs/<slug> 기준으로 |
redirect 라우터(docs_legacy.ts) 매핑 — 스펙대로:
GET /complaint[?type=]→/docs/<slug>(301)GET /complaint-draft[?type=][&matter=]→/docs/<slug>/new(301, matter 보존)GET /complaint-draft/work/:id및 하위poll·checklist·doc-source, 그리고print·hwpx·evidence/:id→/docs/<slug>/…(301, slug는 세션matter_documents.doc_type→docTypeToSlug, fallbacksojang)POST3종doc-source·attachment/delete·checklist→ (308, 메서드·본문 보존)
[왜]
/complaint·/complaint-draft 마운트를 제거하면서 redirect 없이 두면 열린 작업대 탭·북마크·메뉴가 즉시 404가 됩니다. 그래서 1·2·3을 한 턴에 묶어 끝낸 상태에서만 무중단이 성립합니다.
[검증 결과]
npx tsc --noEmit→ EXIT=0, 에러 0 (변우석님이 지목한 5개 전부 해소).- ⚠️ 빌드·런타임 라이브 검증은 미수행 — 변우석님 영역. tsc-green 핸드오프까지가 제 산출물입니다.
짚어둘 2가지 (정직)
- doc_nav.ts·shell.tsx는 인식과 달리 아직
/complaint였습니다. "이미 /docs로 바뀜"이 아니라 미변경 상태였고, 이번에 제가/docs/<slug>로 직접 고쳤습니다(안 고쳤으면 메뉴 활성표시·링크가 깨졌음). POST /complaint-draft(구 새작성 폼 제출)는 redirect에 포함하지 않았습니다 — 스펙의 "POST 3종"에 없고,/new폼 action은 이미${base}/new라 신규 서빙 페이지는 영향 없음. 배포 순간에 열려있던 구/new탭에서의 제출만 깨질 수 있는 좁은 엣지입니다. 필요하면 추가하겠습니다(다만 body의type→slug 매핑이 필요해 단순 308으론 slug가 어긋나므로 별도 처리 필요).- 참고:
complaint/routes.tsx의DOC_META.newHref(구/complaint-draft…4곳)는 list뷰가${base}/new를 쓰면서 미사용(dead) 상태라 손대지 않았습니다.
- 참고:
[롤백]
pre-step2-checkpoint로 git reset 1회면 원복. 신규 파일 src/app/docs_legacy.ts는 reset 후 git clean 또는 수동 삭제. 부분 롤백이 필요하면 위 7개 변경은 파일 단위로 독립적입니다.
배포 후 /docs/sojang·/docs/jigeup-myeongryeong 라이브 + 구경로 301/308 확인까지 닫아주시면 마무리됩니다.