Before doing anything else, detect the stack by reading manifest files at
the repo root: package.json, pyproject.toml, requirements.txt, Cargo.toml,
go.mod, Gemfile, mix.exs, build.gradle, pom.xml, composer.json.
Report which you found in one short line. Then proceed with the stage-
specific task below, adapting your reading list to that stack.

Repo: $repo_name at $repo_path
Wiki root: $wiki_root
HEAD: $head_sha
Today: $today

Stage 3 of 5 — architecture, services, decisions.

Read the architectural surface, adapting to the detected stack:
  - Service layers: app/services, src/services, internal/<pkg>, lib/<domain>
  - Background jobs: app/jobs, workers/, queues/, schedulers (Sidekiq, Celery,
    rq, RQ, BullMQ, asynq, Temporal, etc.)
  - Initializers / bootstrapping: config/initializers, app startup files,
    cmd/<binary>/main.go, src/main.ts, manage.py wiring
  - Dependency manifests: Gemfile.lock, package.json + lockfile, pyproject.toml,
    go.mod, Cargo.toml, mix.exs, composer.lock
  - Mine git log inside $repo_path with these patterns to surface
    architectural events:
      git log --grep='refactor|migrate|breaking|architecture' -i
      git log --merges --first-parent
    Read the top ~30 merge commits and any commit whose subject matches one of
    the keywords above.

Generate:
  - $wiki_root/projects/$repo_name/architecture.md — top-level diagram
    (Mermaid), entry points, layering, request lifecycle, background-job
    pipeline. Cross-link the [[routes]] and [[data-model]] pages.
  - $wiki_root/projects/$repo_name/services/<sub>.md — one per significant
    service or subsystem: responsibility, callers, callees, side effects.
  - $wiki_root/projects/$repo_name/decisions.md — extracted ADR-style
    decisions surfaced from merge commits and refactor commits: what changed,
    when (commit sha / date), and the reasoning if recoverable.
  - $wiki_root/projects/$repo_name/dependencies.md (or `gems.md` for Rails) —
    third-party deps grouped by purpose (web, db, jobs, auth, observability),
    with one-line notes on why each is in use.
  - $wiki_root/projects/$repo_name/active-areas.md — files / modules / dirs
    that have been most actively edited in the last ~12 months (use git log
    inside $repo_path), with a one-line "what this area does" annotation per
    hot path.

Use [[wikilinks]] heavily. Every page must carry the v2 frontmatter template:

    ---
    title: <page title>
    type: architecture | service | decision | overview
    source: bootstrap
    project: $repo_name
    created: $today
    updated: $today
    tags: [architecture, ...]
    confidence: high | medium | low
    ---

Rules:
- Edit only files inside $wiki_root.
- Do NOT touch $wiki_root/raw/.
- Stay within $wiki_root/projects/$repo_name/ for repo-specific pages.

After editing, append one entry to $wiki_root/log.md:
`## [$today] bootstrap-3 | $repo_name $head_sha — architecture`.

Return a single short confirmation message; do not summarize the changes.
