Skip to content

docs(spec): add architecture spec suite and ADR 0001 for Google Cloud Document Translation - #74

Merged
JAaron93 merged 5 commits into
mainfrom
fix_translation_layout_formatting
Aug 20, 2026
Merged

docs(spec): add architecture spec suite and ADR 0001 for Google Cloud Document Translation#74
JAaron93 merged 5 commits into
mainfrom
fix_translation_layout_formatting

Conversation

@JAaron93

@JAaron93 JAaron93 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Architectural Specification & Decision Record (ADR 0001)

Summary

This PR introduces the formal technical specification suite (following the /spec-creator Kiro/Blackwall standard) and Architecture Decision Record (ADR 0001) defining PhenomenalLayout's strategic migration to Google Cloud Document Translation API (Cloud Translation - Advanced v3).

Key Architectural Shifts

  1. Full-Book Scale Batch Default: Elevates asynchronous batchTranslateDocument via Google Cloud Storage (GCS) as the primary, default translation pipeline for 50–1,000+ page books.
  2. Dual-Tier Glossary Synchronization:
    • Tier 1 (Persistent Base Glossary): Foundation philosophical dictionaries (config/klages_terminology.json) provisioned in GCP.
    • Tier 2 (Dynamic Book Session Glossary): Dynamic user choices and novel coined compounds compiled into RFC 4180 TSVs and staged in GCS.
  3. Core Domain Elevation: Preserves and enhances the German Philosophical Neologism Detection Engine (services/neologism_detector.py, services/morphological_analyzer.py, services/philosophical_context_analyzer.py) and User Choice Manager (core/dynamic_choice_engine.py).
  4. Codebase Streamlining: Deprecates fragile custom ReportLab canvas reconstructors, dynamic programming layout engines, and Modal GPU OCR worker infrastructure.

Documents Included

  • spec/design.md: System design, sequence diagrams, GCS bucket folder structure, and component breakdown.
  • spec/requirements.md: User Stories (US-01 to US-04), Functional Requirements (FR-01 to FR-08) with formal Gherkin BDD scenarios, and Non-Functional Requirements.
  • spec/tasks.md: Test-driven implementation plan with 4 execution tracks, explicit dependencies, parallelism highlights, and TDD/BDD acceptance criteria.
  • docs/adr/0001-migrate-to-google-cloud-document-translation.md: Architecture Decision Record 0001.
  • README.md: Preserved interactive Mermaid workflow diagram and links to new specifications.

Greptile Summary

The PR establishes the specification suite and architecture decision for migrating full-book translation to Google Cloud Document Translation.

  • Defines GCS-backed asynchronous batchTranslateDocument as the default book-scale pipeline.
  • Specifies dual-tier glossary synchronization, neologism analysis, lifecycle management, and implementation tracks.
  • Updates the README architecture and links to align with the new specifications.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
README.md Updates the target architecture to use GCS-backed batch document translation and replaces local-worktree links with valid repository-relative links.
docs/adr/0001-migrate-to-google-cloud-document-translation.md Records the accepted migration decision, architectural constraints, and retirement of legacy reconstruction infrastructure.
spec/gcp-migration/design.md Defines the component boundaries, batch translation lifecycle, corrected LRO metadata contract, and GCS storage model.
spec/gcp-migration/requirements.md Establishes functional, behavioral, reliability, security, and test-coverage requirements for the migration.
spec/gcp-migration/tasks.md Decomposes the migration into dependency-aware implementation and testing tracks.
.greptile/instructions.md Adds repository review guidance aligned with the target GCP architecture and deprecated-engine policy.
.greptile/rules.md Adds review gates for credentials, deprecated infrastructure, asynchronous I/O, tests, and glossary formatting.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Book upload] --> B[Neologism pre-scan]
    B --> C[Terminology review]
    C --> D[Composite glossary]
    D --> E[GCS staging]
    E --> F[Batch document translation]
    F --> G[LRO monitoring]
    G --> H[Translated PDF delivery]
Loading

Reviews (3): Last reviewed commit: "fix(greploop): address Greptile review c..." | Re-trigger Greptile

… translation

- Add spec/design.md with book-scale GCP batch translation architecture
- Add spec/requirements.md with BDD Gherkin scenarios and traceability matrix
- Add spec/tasks.md with 4 parallel/sequential execution tracks and TDD criteria
- Add docs/adr/0001-migrate-to-google-cloud-document-translation.md
- Update README.md with target architecture flowchart and spec links
…n review

- Add .greptile/instructions.md with project mission and Dolphin OCR deprecation policy
- Add .greptile/rules.md with blocking gates, severity scoring, and glossary constraints
- Add .greptile/context.md with architectural context and specification references
@JAaron93

Copy link
Copy Markdown
Owner Author

@greptile review

Comment thread README.md Outdated
Comment thread spec/gcp-migration/design.md Outdated
Comment thread README.md Outdated
- Move design.md, requirements.md, tasks.md into spec/gcp-migration/
- Update relative and markdown links across README.md, ADR 0001, and .greptile/context.md
@JAaron93

Copy link
Copy Markdown
Owner Author

@greptile review

- Update README architecture diagram to show batchTranslateDocument (GCS)
- Fix LRO progress contract across specs (translated_pages, SUCCEEDED state)
- Replace absolute local worktree links with repository-relative paths
@JAaron93

Copy link
Copy Markdown
Owner Author

@greptile review

…nstitution

- Establish GCP Document Translation and GCS async batch as book-scale default
- Define official Translation v3 LRO contract (translated_pages, SUCCEEDED)
- Document Dual-Tier Glossary Synchronization standards
- Specify deprecation deny list (Dolphin OCR, canvas overlays, absolute links)
- Enforce topical subdirectory organization for spec files
@JAaron93
JAaron93 merged commit f03ac2f into main Aug 20, 2026
1 check passed
@JAaron93
JAaron93 deleted the fix_translation_layout_formatting branch August 20, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant