Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
현재 구현: [질문별 순차 AI 작업 연결](docs/changes/question-plan-dispatch.md). 고정한 자료를 순서대로 기존 영속 작업으로 접수하고, 같은 요청은 완료한 분석을 재사용합니다. 기존 활성 작업1개·합산 예약 예산을 유지하며 브리핑 변환·자동 진행·API/UI·개발 적용은 후속입니다. 집중91/새 전체9,716개·정적/타입/빌드/OpenAPI·독립 최종 수정 검토 C0I0M0를 통과했습니다.

진행 중: [질문별 자료 선택 영속 계획](docs/changes/question-source-plans.md). 질문만으로 저장 색인에서 최대5자료를 선택하고 같은 요청은 원래 선택과 현재 원문을 재검증합니다. 실제 AI/예산 예약/개발 활성화는 없으며 다자료 실행·브리핑 변환/표시는 후속입니다.

현재 구현: [근거 작업 접수·queue 전달](docs/changes/evidence-job-dispatch.md). 신규23/새전체9,595개(Python8,775+JS820)·정적 검사/빌드/OpenAPI·실패/skip/warning0·독립 최종 검토/수정 재검토를 통과했습니다. 저장→명시 버전 queue 전달·동일 ID 재접수와 권한/원문 재검사를 연결했습니다. 실제 제공자 호출0·현재 앱 활성화0이며 질문 전용 검색·브리핑 변환/표시는 후속입니다.
Expand Down
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
현재 구현: [질문별 순차 AI 작업 연결](changes/question-plan-dispatch.md). 질문 검색의 고정 선택과 기존 작업/queue를 연결하며 신규 외부 모델 호출이나 앱 활성화는 이번 검증에 포함하지 않습니다. 집중91/새 전체9,716개·정적/타입/빌드/OpenAPI·독립 최종 수정 검토 C0I0M0를 통과했습니다.

진행 중: [질문별 자료 선택 영속 계획](changes/question-source-plans.md). 질문만으로 저장 색인에서 최대5자료를 선택하고 같은 요청은 원래 선택과 현재 원문을 재검증합니다. 실제 AI/예산 예약/개발 활성화는 없으며 다자료 실행·브리핑 변환/표시는 후속입니다.

현재 구현: [근거 작업 접수·queue 전달](changes/evidence-job-dispatch.md). 신규23/새전체9,595개(Python8,775+JS820)·정적 검사/빌드/OpenAPI·실패/skip/warning0·독립 최종 검토/수정 재검토를 통과했습니다. 저장→명시 버전 queue 전달·동일 ID 재접수와 권한/원문 재검사를 연결했습니다. 실제 제공자 호출0·현재 앱 활성화0이며 질문 전용 검색·브리핑 변환/표시는 후속입니다.
Expand Down
34 changes: 34 additions & 0 deletions docs/changes/question-plan-dispatch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 질문별 자료의 순차 AI 작업 연결

2026-10-26 KST. [질문별 자료 선택](question-source-plans.md)의 다음 단계. 최대5자료의 고정 선택을 기존 영속 AI 작업으로 이어서 접수한다. 기존 workspace당 활성 작업1개 제한과 합산 예약 예산을 유지하며 완료된 자식은 재사용한다. caller가 완료 후 같은 요청으로 다시 진행하며 자동 부모workflow·브리핑 변환/API/UI/개발 적용은 후속이다.

## Global Constraints

- Owned execution files: NEW packages/agents/src/issuedigest_agents/question_dispatch.py and packages/agents/tests/test_question_dispatch.py; existing packages/storage/src/issuedigest_storage/evidence_jobs.py and packages/storage/tests/test_evidence_jobs.py only the expected-source admission guard and focused tests. Other existing execution files/provider bytes/SDK/workflows/queue/API/UI/migrations/config/dependencies/export/fixtures stay unchanged. Docs allowed. No real provider calls, operational server/DB, main merge or app/default-worker activation; dedicated local synthetic PostgreSQL/nativeDBOS/mockSSE only.
- Existing EvidenceJobRepository.submit gains keyword expected_source_sha256: str|None=None. Exact str lowercase64hex or None before SQL. Within SAME existing gate/auth/load/presentation transaction compare computed source_digest with nonNone expected hash BEFORE prior lookup/budget/newrow; mismatch sanitized ResearchConflict with rollback/no reservation/job/queue. Existing noarg calls behave identically; do not change hashing, budget, active-one-workspace index, job lifecycle, receipts, guards, worker. Compare on retry too.
- New async advance_question_plan(plans:QuestionPlanRepository,jobs:EvidenceJobRepository,*,client:DBOSClient,app_version,token,workspace_id,request_id,question,model,reservation_usd)->QuestionDispatch|None. Caller owns lifecycle/explicit app_version and re-invocation. Require plans.engine is jobs.engine, exact concrete repository classes or documented no arbitrary source-plan injection; validate UUID4/nonblank<=1500 question/exact gpt-6.1-sol/finite exactcentDecimal(0,10]/app_version ASCII1..128 before SQL, including no_match. No new model selection/pricing policy.
- Call existing plans.submit via asyncio.to_thread to get current writer-owned stable plan (do not accept caller source IDs/planDTO). Reconstruct plan via strict JSON raw field checks before use, do not trust model_copy, and match workspace/request/exact question. Existing source membership/currentwriter/allsourcehash guard remains. Zero choices -> QuestionDispatch status no_match, total0/completed0/dispatches(), no jobs/queue/reservation.
- Process fixed sources in order, at most one pending/running job. Derive deterministic child UUID4 using SHA256 fixed namespace 'issuedigest:question-plan-child:v1' + canonical plan_id/snapshot_id/order; set UUID version4 bits, never random on retry; document profile/algorithm. New fixed plan identity means a different request gets different children. Job admission uses original exact question/model/reservation and expected_source_sha256 from plan. No new batch table/migration or hidden persistence; child identities recover deterministically. No reservation flattening/refund/reset on exceptions.
- For each child, await jobs.submit with expected hash offeventloop; None returns None without enqueue/laterchildren. Revalidate current job with jobs.get before trusting status. Verify source_sha256 matches fixed selection, question/model/workspace/snapshot/UUID/status before paid dispatch; no borrowed receipt exposed. Prior completed => append opaque EvidenceDispatch queuedFalse and proceed next. First pending => use unchanged submit_evidence_job with same child request and args (it rechecks current source/hash against admitted input), append ack and stop, regardless races. running => append queuedFalse and stop. failed/cancelled/indeterminate => append queuedFalse and stop blocked; never automatically skip/retry paid execution. Existing one-active-job-per-workspace index and summed monthlybudget stay intact. All children completed => evidence_complete, NOT briefing/semantic certification.
- Frozen QuestionDispatch dataclass (plan_id,status Literal no_match/in_progress/blocked/evidence_complete,completed_count,total_sources,dispatches tuple of existing EvidenceDispatch), only internal identifiers/counters/status/acks; no question/token/source text/hash/receipt/AI facts. Counts reflect validated completed prefix; progress not generation guarantee. Do not poll/sleep/auto-loop/wait for completion; trusted caller invokes again. Do not export through API/UI or register/startworkers. This is sequential resumable admission/dispatch, not automatic parentworkflow or briefing conversion.
- Preserve asyncio.CancelledError, never hidden continuation/nextchild/queue on cancelled SQL waiter. Existing EvidenceDispatchError sanitized IDs may propagate (caller recovers same request); other existing sanitized auth/budget/conflict errors propagate. No token/question/original provider exception logging, no blanket catch swallowing unknown errors. Current per-source transaction can reserve/queue a prefix; errors do not undo dispatched work. Same request reuses children, no other request fallback.
- TDD tests meaningful: expectedhash invalid/mismatch/retry before budget/row writes; defaultoldsubmit behavior; no_match0; onepending stops; actual first completed then second scheduled with deterministic IDs and one reservation each; repeated request no duplicate, finalcomplete0newqueue; blocked terminal stops; revoked access/source/presentation changed; cancellation/ambiguousack preserves pending and no laterchildren; sameengine/invalidinputnoSQL; strict/model_copy tamper. Real PostgreSQL index and DBOSClient/mockSSE integration for >=2sources, no providers. Newfixture cleans own questionplans/jobs and restores monkeypatch modules; no conftest edits. Cover cross-source mutation race between plan and admission with expectedhash rollback. Agent scoped tests/Ruff/format/mypy, controller fullQA/reviews/privacy/PR/Sites/cleanup. No agent subagents.

DBOS 통합 테스트는 qpd_<UUID> 전용 schema를 migrate/config/client에 동일하게 지정한다. client/worker 종료 후 해당 schema만 정리하고 기본 dbos schema/queue가 변경되지 않았음을 검사한다. 운영 설정 변경이 아닌 테스트 격리이며 실패한 첫 전체 실행은 통과로 세지 않는다.

## Task 1

- [x] 위4파일 범위만 TDD로 구현한다. spec/global constraints를 지킨다. 새로운 expected-source guard는 실제 transaction에서 예약 전 적용한다. ordered deterministic children/완료 prefix/첫 미완료 중단/no_match/현재권한/원문/예산/취소/재접수 검사를 포함한다. owned4파일+이 Task1 checkbox만 커밋하고 SDD 보고서에 RED/GREEN/명령/한계/자체검토를 남긴다.

## Controller gates

- [x] 독립 태스크/전체/수정 검토·새 전체9,716개/정적/타입/빌드/OpenAPI·기존488실행/이전43증거 보존·privacy·문서/Draft PR113/Sitesv135·자체QA3/volume3 정리.
- [ ] 자동 진행 parentworkflow·다자료 결과의 브리핑 변환·API/UI·실제품질/운영부하·개발 적용(이번 제외).

## 판단과 비용

1. 자료별 순차 접수와 완료 후 재진행으로 기존 활성1개/예산 계약을 유지한다. 자동 연속 실행은 상위 orchestration 후속이며 실패한 자료를 건너뛰지 않는다.
2. plan/source/order 기반 child UUID4를 결정적으로 유도한다. 새batchtable 없이 복구하지만 이 namespace/알고리즘은 이후 바꾸면 안 된다.
3. 예약 전 expected-source guard를 기존 repository에 선택적으로 추가한다. 원문 변경 경쟁을 막지만 기존 저장 코드1개와 검사1개를 수정한다.

4. 새 native 테스트의 DBOS 저장 공간을 고유 schema로 격리한다. 기본 queue의 다른 앱 소유권과 충돌하지 않지만 테스트 준비/정리가 늘고 전체 재검사가 필요하다.
4 changes: 4 additions & 0 deletions docs/planning/implementation-plan.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## M3 진행 · 질문별 순차 접수 검증 완료

[고정 자료→작업 연결](../changes/question-plan-dispatch.md)은 집중91/새 전체9,716개·정적/타입/빌드/OpenAPI·독립 최종 수정 검토 C0I0M0를 통과했다. 테스트 queue 소유권 간섭은 전용 schema 격리 후 새 DB 전체 재검증으로 해결했다. 기존 활성1개/예산 계약을 보존한다. 같은 요청의 완료 작업은 재사용하고 첫 미완료에서 반환한다. 자료 선택 때의 hash를 예약 전에 비교해 중간 원문 변경을 막는다. 자동 진행·브리핑 변환/표시·개발 적용은 후속이며 실제 제공자/운영/앱 활성화0이다.

## M3 진행 · 질문별 자료 선택 영속화

[질문 전용 검색 계획](../changes/question-source-plans.md)으로 원래 질문·선택 순서·현재 source hash를 저장한다. 같은 request는 재검색하지 않고 원래 자료를 다시 검증한다. no_match를 현실의 근거 부재·의미 판정으로 표시하지 않는다. 기존485실행/이전52증거·앱/기본worker/main을 유지하며 실제 제공자/예산 예약 변경0이다. 다자료 AI 실행·브리핑 변환/표시·부하 인수·개발 적용이 후속이다.
Expand Down
6 changes: 6 additions & 0 deletions docs/planning/progress.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 검증 완료 · 질문별 순차 AI 작업 연결 · 2026-10-26

[계약](../changes/question-plan-dispatch.md)·[검증](../research/question-plan-dispatch-validation.md). 고정 자료의 기대 hash를 예약 전 비교하고 결정적인 자식 요청으로 접수한다. 완료한 작업은 재사용하며 첫 미완료/실패에서 반환한다. 실행df8cd6f/테스트 격리 보완6c6f65b·집중91/새 전체9,716개(Python8,896+JS820)·정적/타입/빌드/OpenAPI·실패/skip/warning0이다. 태스크/전체/최종 수정 검토 C0I0M0다. 최초 전체 실행의 queue 소유권 충돌3건은 새 테스트만 고유 schema로 격리해 해결했고 새 DB에서 전체 재검증했다. 기존488실행/이전43증거 보존·실제 제공자/운영 변경0·앱/기본worker/main 유지다. 자동 진행·브리핑 변환/API/UI·실제 품질/부하·개발 반영은 후속이며 PR/Sites·자체QA 정리는 최종 인계를 따른다.

최종 인계: [Draft PR113](https://github.com/DigestWorks/IssueDigest/pull/113)·[Sitesv135](https://lawdigest-rebuild-plan.ijaesinii.chatgpt.site/) public/native succeeded. 이전v134와 변경7문서 정확 사본(9a07d6c)을 보존했다. Site source `a4c5a44f81de77b4b6bc8b0abeaef9d425ed0902`, saved `appgprj_6ac612dd42708191a7a0c8377be64d48~appgver_6d7221835ff8819186bbfe4f474d2970`, deployment `appgdep_6adeea3abf4081919988caf0ba5c38b3`다. HTML120/로컬대상3,605/공개텍스트370·비공개60+12항목 제외를 확인했다. 자체QA3/전용volume3을 정확 소유권 확인 후 정리하고 포트 닫힘을 확인했다. 사용자 탭 이동/신규 브라우저 검사0(기존 레이아웃 텍스트 변경)이다. 실제 제공자/운영 변경·앱/기본worker/main 활성화0이며 자동 진행/브리핑/API/UI 인수는 후속이다. 네 판단과 비용은 명세/검증 기록에 남겼다. PR 채팅 첨부는 도구100개 한도로 실패했지만 링크는 유효하다. 원격CI는 로컬 전체 검사와 구분하며 이후 인계는 저장소 원본을 따른다.

## 검증 완료 · 질문별 자료 선택 영속화 · 2026-10-26

[계약](../changes/question-source-plans.md)·[검증](../research/question-source-plans-validation.md). 질문만으로 기존 저장 색인에서 최대5자료를 선택하고 원문/제목 hash를 고정한다. 같은 요청은 재검색하지 않고 현재 권한·원문을 재검증하며 no_match도 유지한다. 실행9ecdce0/기존 검사 보완14e1585·신규62/전체9,657개(Python8,837+JS820)·정적 검사/빌드/OpenAPI·실패/skip/warning0이다. 태스크 C0I0M1/전체 C0I0M2 후 문서 보완 재검토 C0I0M0이며 비차단 후속1개(표시 정보 단독 삭제 집중 검사)를 남겼다. 기존484실행은 그대로이고 승인한 migration 검사1개만 수정했으며 이전52증거를 보존했다. 실제 제공자/운영 변경0·앱/기본worker/main 유지다. 다자료 AI 실행·브리핑 표시·개발 적용은 후속이며 PR/Sites·자체QA 정리는 최종 인계를 따른다.
Expand Down
8 changes: 8 additions & 0 deletions docs/planning/tasks.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 진행 · 질문별 순차 AI 작업 연결 · 2026-10-26

- [x] [기대 원문 hash·순차 접수·자식 요청 ID 계약](../changes/question-plan-dispatch.md) 고정.
- [x] 예약 전 source guard·순차 dispatch TDD/실제DBOS 모의 stream 집중91개·정적 검사.
- [x] 독립 검토·새 전체9,716개/정적/타입/빌드/API 계약 검사·기존488실행/이전43증거 보존.
- [x] Draft PR113·Sitesv135/이전v134+정확7문서 보존·자체QA3/전용volume3 정리(최종 인계).
- [ ] 자동 진행·브리핑 변환/API/UI·실제품질/운영부하·개발 적용.

## 구현·집중 검사 완료 · 질문별 자료 선택 영속화 · 2026-10-26

- [x] [질문 전용 검색·선택/hash 고정·재접수 계약](../changes/question-source-plans.md) 고정.
Expand Down
Loading
Loading