6.1 KiB
Analysis Queue Contract
<분석 대상 저장소>/analysis-queue.yaml is the first control file read by every detailed-analysis run. It is the SSOT for project order, active-project ownership, and explicit reanalysis requests.
State model
Allowed project states:
PENDING— queued, never started for the current analysis history;IN_PROGRESS— the project currently owned by the 09:00 analysis run;COMPLETE— all intended scopes andfinal/document.mdare complete for the recorded source snapshot;REANALYZE— a previously completed project explicitly queued for another analysis cycle after source changes or a requested re-review;BLOCKED— the active project cannot continue because required source, instructions, or environment are unavailable;SKIPPED— explicitly excluded by the user or queue owner.
At most one project may be IN_PROGRESS. activeProject must be null, or name the project currently owned by the analysis worker. An owned project may be IN_PROGRESS or BLOCKED. A REANALYZE entry is queued, not active, until a scheduled run activates it.
Mandatory run order
- Read
analysis-queue.yamlbefore scanning project contents. - Discover direct project directories under
<분석 대상 저장소>. Ignore control files and hidden infrastructure directories. - Append newly discovered, unlisted projects to the end of
projectsasPENDING. Never insert them ahead of existing entries automatically. - If
activeProjectnames anIN_PROGRESSproject, continue only that project. - If
activeProjectnames aBLOCKEDproject, do not start another project. Re-check only the blocking prerequisite; resume asIN_PROGRESSwhen resolved, otherwise leave it blocked and stop. - If there is no active project, scan queue entries from top to bottom and choose the first actionable entry whose state is
PENDINGorREANALYZE. - For
PENDING, set it toIN_PROGRESS, setactiveProject, initialize/continuedocs/<프로젝트>/state.json, and run the normal exhaustive analysis cycle. - For
REANALYZE, execute the reanalysis activation procedure below, then set it toIN_PROGRESSand setactiveProject. - Continue the active project across scheduled runs until its required scopes are complete and
final/document.mdis synthesized for the target source snapshot. - Only then mark the entry
COMPLETE, update the completed source revision, clearactiveProject, and allow a later scheduled run to select the next actionable entry.
Do not begin another project in the same run after completing one. Completion creates a clean scheduling boundary.
Reanalysis activation
REANALYZE is an explicit user request to analyze a project again without deleting the previous detailed analysis.
Before changing REANALYZE to IN_PROGRESS:
- Read the existing
docs/<프로젝트>/state.jsonandfinal/document.md. - Resolve the previous completed source snapshot. Prefer
finalDocument.sourceRevision; fall back only to another explicitly recorded completed revision. If no trustworthy baseline exists, mark the projectBLOCKEDwith a note rather than pretending this is incremental reanalysis. - Resolve the current target source revision. For Git repositories, record
git rev-parse HEADand working-tree status. Do not modify/reset source. - Compare baseline → target before reopening scopes. Record changed paths and the evidence used to map those paths to bounded scopes.
- Set
reanalysis.baselineRevision,reanalysis.targetRevision,reanalysis.changedPaths,reanalysis.impactedScopes, incrementanalysisCycle, and setreanalysis.requestedAt. - Choose a reanalysis mode:
IMPACTED_SCOPESwhen changed paths can be mapped confidently to bounded scopes and project/module boundaries remain stable;FULL_PROJECTwhen module/build boundaries, shared contracts, architecture rules, cross-cutting configuration, migration ownership, generated sources, or scope mapping itself changed, or when impact cannot be bounded confidently.
- Reopen only the impacted scopes for
IMPACTED_SCOPES, but keep previous analysis as historical baseline. Rebuild the project-wide synthesis after those scopes complete. - For
FULL_PROJECT, re-establish the project inventory and coverage ledger from the target snapshot and revalidate every intended scope.
A reanalysis cycle must never silently overwrite the fact that earlier documents described an earlier source snapshot. Preserve revision provenance in state and analysis prose where it matters.
Reanalysis completion
When reanalysis finishes:
- update every reopened scope to complete for the target revision;
- synthesize
final/document.mdagain, including material changes from the prior snapshot when relevant; - set
finalDocument.sourceRevisionto the target revision; - set
reanalysis.completedAt; - mark the queue entry
COMPLETE; - clear
activeProject.
The 10:00 root-tree stage will see the changed final document and may then update decomposition/readiness. The 11:00 generation stage remains grounded in that updated tree.
New projects and ordering
A new directory may appear while another project is being analyzed. Append it as PENDING; do not preempt the active project. REANALYZE also does not preempt the active project. The user may reorder queued PENDING and REANALYZE entries manually. Automatic runs never reorder existing entries.
Blocked projects
If the active project disappears, cannot be read, lacks a trustworthy reanalysis baseline, or requires an unavailable prerequisite, mark it BLOCKED, retain it as activeProject, record the reason, and stop. Do not silently jump to the next project. Resuming means returning the same entry to IN_PROGRESS; skipping requires explicit SKIPPED and clearing activeProject.
Example: explicit reanalysis request
version: 1
activeProject: null
projects:
- name: backend-clean-architecture
status: REANALYZE
- name: tech-log-backend
status: PENDING
- name: ca-tmpl
status: PENDING
On the next run, if the first project has a trustworthy completed baseline, it becomes the active IN_PROGRESS project and begins a new analysis cycle.