Imports:
  - Types:
      - Question
      - QuestionGroup
      - SessionAnswers
    From: goga/onboarding/questions
  - Types:
      - Questionnaire
      - SessionPlan
      - core_questions
      - assemble_session_plan
      - apply_skips
    Usages:
      - survey-run
    From: goga/onboarding/survey
  - Types:
      - ToolParticipation
      - ToolDeclaration
      - ToolContribution
    Usages:
      - session-participation
    From: goga/onboarding/participation
  - Types:
      - FileGenerator
      - CreatedFile
    Usages:
      - artifact-generation
    From: goga/onboarding/generator
  - Types:
      - minor_version
      - host_goga_version
    Usages:
      - minor-line
    From: goga/version
  - Types:
      - resolve_project_name
    From: goga/config

Usages:
  convention: .goga/usages/conventions.md

Annotations: |
  The `convention` practice is used for:
  - Working with the codebase
  - Organizing the REPL development cycle
  - Debugging and testing
  - Organizing the test infrastructure
  - Understanding the general principles and rules of development and testing in the project

  This cell is the facade of the onboarding domain: it owns the session
  orchestration and re-exports the public session API of the leaf cells —
  the question-and-answer model, the survey, the tool participation, and
  the artifact generation. Consumers address the domain through this
  facade only. Use relative imports.

---

"InitLogic(questionnaire: Questionnaire, generator: FileGenerator, participation: ToolParticipation)":
  location: logic.py
  annotations: |
    The orchestrator of one initialization session.

    `questionnaire`: the survey engine
    `generator`: the artifact generator
    `participation`: the tool participation mediator

    Apply the `convention` practice for the code style and intra-package
    imports.
    Use the `minor-line` practice for reading the installed version and
    deriving the image tag.
    Use the `session-participation` practice for the two tool moments.
    Use the `survey-run` practice for the plan assembly and the survey.
    Use the `artifact-generation` practice for the generation and the file
    report.
  methods:
    "run() -> exit_code: int": |
      Run the whole session.

      `exit_code`: 0 on success, nonzero on a session error

      Algorithm:
      1. An existing .goga/config.yml ends the session — no question is
         asked, no tool event is delivered, no artifact is written
      2. Read the installed goga version — `host_goga_version` — and derive
         its minor line — `minor_version` — for the image hints; an
         unreadable version is a clean session error without a traceback
      3. Deliver the declaration moment via `ToolParticipation` — it warns
         for every invited identity that is not among the installed tool
         packages
      4. Build the core tree — `core_questions`, with the image tag from
         step 2, the project name from `resolve_project_name`, and
         convention_exists read from the existence of
         .goga/usages/conventions.md; assemble the plan with the collected
         declarations; flatten every declaration's buffered skips into
         (tool identity, raw path) pairs and apply them via `apply_skips`
      5. Run the survey into the answer space via `Questionnaire`
      6. Deliver the amendment moment and commit the surviving tool
         contributions via `ToolParticipation`
      7. Generate the artifacts via `FileGenerator` and render the final
         file report with the attribution
      8. Return 0

      Requirements:
      - A tool failure never changes the exit code — the softness of the
        tool moments is theirs
      - A session error is one clean message — a broken package import, an
        unreadable version, an empty required field at generation — never
        a traceback

->Question: {}
->QuestionGroup: {}
->SessionAnswers: {}
->SessionPlan: {}
->Questionnaire: {}
->core_questions: {}
->assemble_session_plan: {}
->apply_skips: {}
->ToolParticipation: {}
->ToolDeclaration: {}
->ToolContribution: {}
->FileGenerator: {}
->CreatedFile: {}

---

Author: Goga
CreatedAt: 14/09/26
Description: |
  Facade of the onboarding domain — the initialization session
  orchestration and the public session API.
