# chichasescheese/ds160-form-autofiller architecture

> Architecture diagram of the GitHub repository chichasescheese/ds160-form-autofiller, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chichasescheese/ds160-form-autofiller
- Repository: https://github.com/chichasescheese/ds160-form-autofiller

## Overview

Backhome is a local, agent-assisted DS-160 preparation and verification tool. The main workflow takes the applicant’s documents through integrity checking and text digestion into sourced profile facts, validates them, builds an expected-value form sheet, and supports agent-assisted CEAC entry. Captured CEAC values are reconciled and checked before generating a printable review; signing and submission remain with the applicant. README documents the wider workflow and capabilities, while sampled source confirms the pipeline and sheet/reconciliation logic; some agent-to-browser and file handoffs are documented rather than shown in sampled Python.

Main entry points: [`src/backhome/cli.py`](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/cli.py) (CLI commands), [`src/backhome/model.py`](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/model.py) (Sourced profile), [`src/backhome/forms.py`](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/forms.py) (Sheet and questionnaire), [`src/backhome/preflight.py`](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/preflight.py) (Preflight checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Evidence intake"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_documents["Document ingest and digest<br/>[docs.py]"]
  node_raw[("Raw documents and digests")]
end

subgraph group_profile["Facts and validation"]
  node_profile[("Sourced profile<br/>[model.py]")]
  node_answers["Answer overlay<br/>[model.py]"]
  node_validators["Profile validators<br/>[validators.py]"]
end

subgraph group_application["Form preparation"]
  node_skills["Agent workflow skills"]
  node_form_spec["DS-160 form specification<br/>[spec.yaml]"]
  node_forms["Sheet and questionnaire<br/>[forms.py]"]
  node_application_files[("Application files")]
end

subgraph group_browser["CEAC verification"]
  node_nav["CEAC navigation<br/>[nav.js]"]
  node_snapshot["Page snapshot<br/>[snapshot.js]"]
  node_review_extract["Review extraction<br/>[review_extract.js]"]
  node_recon["Field reconciliation<br/>[forms.py]"]
end

subgraph group_outputs["Checks and review"]
  node_preflight["Preflight checks<br/>[preflight.py]"]
  node_review["Printable review<br/>[review.py]"]
  node_ceac_review["CEAC review coverage<br/>[ceac_review.py]"]
  node_photo["Photo preparation<br/>[photo.py]"]
end

node_applicant(("Applicant"))
node_agent(("Browser agent"))
node_ceac["CEAC website"]

node_applicant -->|"runs commands"| node_cli
node_cli -->|"ingests or digests"| node_documents
node_documents -->|"writes evidence"| node_raw
node_cli -->|"loads profile"| node_profile
node_applicant -->|"provides answers"| node_answers
node_answers -->|"overlays facts"| node_profile
node_cli -->|"validates profile"| node_validators
node_profile -->|"supplies facts"| node_validators
node_agent -->|"follows guidance"| node_skills
node_skills -->|"guides intake and fill"| node_agent
node_cli -->|"builds sheet"| node_forms
node_profile -->|"provides values"| node_forms
node_form_spec -->|"defines fields"| node_forms
node_forms -->|"writes sheet and prompts"| node_application_files
node_application_files -.->|"provides expected values"| node_agent
node_agent -->|"uses navigation"| node_nav
node_nav -->|"finds pages"| node_ceac
node_agent -->|"fills form pages"| node_ceac
node_ceac -->|"exposes field values"| node_snapshot
node_snapshot -.->|"exports snapshots"| node_application_files
node_ceac -->|"exposes review pages"| node_review_extract
node_review_extract -.->|"exports review text"| node_application_files
node_cli -->|"runs reconciliation"| node_recon
node_application_files -->|"supplies sheet and snapshots"| node_recon
node_recon -->|"writes results"| node_application_files
node_cli -->|"runs checks"| node_preflight
node_profile -->|"supplies facts"| node_preflight
node_application_files -->|"supplies sheet and recon"| node_preflight
node_cli -->|"generates review"| node_review
node_profile -->|"supplies provenance"| node_review
node_application_files -->|"supplies reconciled answers"| node_review
node_cli -->|"runs coverage review"| node_ceac_review
node_application_files -->|"supplies extracted pages"| node_ceac_review
node_applicant -->|"provides photo"| node_photo
node_cli -->|"prepares photo"| node_photo

click node_cli "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/cli.py"
click node_documents "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/docs.py"
click node_profile "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/model.py"
click node_answers "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/model.py"
click node_validators "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/validators.py"
click node_skills "https://github.com/chichasescheese/ds160-form-autofiller/tree/main/skills"
click node_form_spec "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/forms/ds160/spec.yaml"
click node_forms "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/forms.py"
click node_nav "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/ceac/nav.js"
click node_snapshot "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/ceac/snapshot.js"
click node_review_extract "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/ceac/review_extract.js"
click node_recon "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/forms.py"
click node_preflight "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/preflight.py"
click node_review "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/review.py"
click node_ceac_review "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/ceac_review.py"
click node_photo "https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/photo.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_documents,node_raw,node_agent toneBlue
class node_profile,node_answers,node_validators toneAmber
class node_skills,node_form_spec,node_forms,node_application_files toneMint
class node_nav,node_snapshot,node_review_extract,node_recon toneRose
class node_preflight,node_review,node_ceac_review,node_photo,node_applicant,node_ceac toneIndigo
```

## Components

### Evidence intake

- [CLI commands](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/cli.py): `src/backhome/cli.py`
- [Document ingest and digest](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/docs.py): `src/backhome/docs.py`
- **Raw documents and digests**

### Facts and validation

- [Sourced profile](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/model.py): `src/backhome/model.py`
- [Answer overlay](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/model.py): `src/backhome/model.py`
- [Profile validators](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/validators.py): `src/backhome/validators.py`

### Form preparation

- [Agent workflow skills](https://github.com/chichasescheese/ds160-form-autofiller/tree/main/skills): `skills`
- [DS-160 form specification](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/forms/ds160/spec.yaml): `src/backhome/forms/ds160/spec.yaml`
- [Sheet and questionnaire](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/forms.py): `src/backhome/forms.py`
- **Application files**

### CEAC verification

- [CEAC navigation](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/ceac/nav.js): `src/backhome/ceac/nav.js`
- [Page snapshot](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/ceac/snapshot.js): `src/backhome/ceac/snapshot.js`
- [Review extraction](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/ceac/review_extract.js): `src/backhome/ceac/review_extract.js`
- [Field reconciliation](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/forms.py): `src/backhome/forms.py`

### Checks and review

- [Preflight checks](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/preflight.py): `src/backhome/preflight.py`
- [Printable review](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/review.py): `src/backhome/review.py`
- [CEAC review coverage](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/ceac_review.py): `src/backhome/ceac_review.py`
- [Photo preparation](https://github.com/chichasescheese/ds160-form-autofiller/blob/main/src/backhome/photo.py): `src/backhome/photo.py`

### Other components

- **Applicant**
- **Browser agent**
- **CEAC website**

## Connections

- Applicant → CLI commands: runs commands
- CLI commands → Document ingest and digest: ingests or digests
- Document ingest and digest → Raw documents and digests: writes evidence
- CLI commands → Sourced profile: loads profile
- Applicant → Answer overlay: provides answers
- Answer overlay → Sourced profile: overlays facts
- CLI commands → Profile validators: validates profile
- Sourced profile → Profile validators: supplies facts
- Browser agent → Agent workflow skills: follows guidance
- Agent workflow skills → Browser agent: guides intake and fill
- CLI commands → Sheet and questionnaire: builds sheet
- Sourced profile → Sheet and questionnaire: provides values
- DS-160 form specification → Sheet and questionnaire: defines fields
- Sheet and questionnaire → Application files: writes sheet and prompts
- Application files → Browser agent: provides expected values
- Browser agent → CEAC navigation: uses navigation
- CEAC navigation → CEAC website: finds pages
- Browser agent → CEAC website: fills form pages
- CEAC website → Page snapshot: exposes field values
- Page snapshot → Application files: exports snapshots
- CEAC website → Review extraction: exposes review pages
- Review extraction → Application files: exports review text
- CLI commands → Field reconciliation: runs reconciliation
- Application files → Field reconciliation: supplies sheet and snapshots
- Field reconciliation → Application files: writes results
- CLI commands → Preflight checks: runs checks
- Sourced profile → Preflight checks: supplies facts
- Application files → Preflight checks: supplies sheet and recon
- CLI commands → Printable review: generates review
- Sourced profile → Printable review: supplies provenance
- Application files → Printable review: supplies reconciled answers
- CLI commands → CEAC review coverage: runs coverage review
- Application files → CEAC review coverage: supplies extracted pages
- Applicant → Photo preparation: provides photo
- CLI commands → Photo preparation: prepares photo
