The Eisenberg Family Depression Center welcomes contributions from researchers and developers who want to help improve Field Station AI™. We invite you to submit feedback, ideas for improving the app, documentation, bug reports, and feature requests via GitHub issues.
For developers, this guide summarizes the current architecture, design principles, and development practices.
Field Station AI™ currently lives primarily in one file:
index.html
The script is organized by visible section comments. Preserve that structure when editing. Avoid broad reformatting; unrelated churn makes the file hard to review.
When using an AI coding assistant to help you write code, tell it to read AGENTS.md first. Use the assistant to generate code, but review and edit the output carefully. Do not blindly accept generated code. Always test before submitting a pull request. Avoid sharing PHI, secrets, or participant identifiers with any code assistant.
Before editing:
- Inspect existing code around the target change.
- Preserve established naming and UI patterns.
- Make the smallest coherent change.
- Keep documentation synchronized.
- Use synthetic examples.
- Review output for PHI and secrets.
Do not claim code was tested unless it was actually executed.
Recommended checklist:
- Add the model to the UI selection path.
- Add context-window or size metadata where the code expects it.
- Add cache-cleanup metadata where relevant.
- Test first load.
- Test cached reload.
- Test generation.
- Test Stop.
- Test model switching.
- Verify behavior without WebGPU if a fallback is expected.
- Update
docs/models-and-runtime.md.
Do not expose raw model IDs in user-facing errors when a friendly name is available.
Minimum checklist:
- Add icon metadata if needed.
- Add a skill registry entry.
- Write a
mount...Skill(container)function. - Wire the skill into enter/reset handling.
- Register a state probe if the tool has meaningful unsaved state.
- Use stale-token or abort behavior to invalidate stale runs.
- Acquire the shared engine lock around every model call and release in
finally. - Keep skill input state separate from chat state.
- Provide download and/or Send to Chat behavior where useful.
- Update
docs/field-kit.md.
Do not let a skill write to chat history unless the user explicitly chooses Send to Chat.
Update these areas together where they exist:
- Attachment kind detection.
- Size caps.
- MIME-to-icon display.
- Extraction or transcription logic.
- Attachment bar actions.
- Deletion cleanup.
- Retrieval behavior for text-bearing files.
- Documentation in
docs/data-files-and-knowledge-bases.md.
Deletion must remove metadata, blob storage, vector storage, and index records where those records exist.
Preserve these rules:
- Validate index shape before use.
- Do not send user prompts to the KB source URL.
- Keep query and passage embedding conventions consistent.
- Rebuild indexes after embedding convention changes.
- Retune thresholds after embedding convention changes.
All model calls must:
- Acquire the shared engine lock.
- Release the lock in
finally. - Respect Stop or stale-token behavior where applicable.
- Avoid logging PHI or raw input values.
- Use destination-aware redaction if crossing a process or network boundary where promised.
- Surface safe, actionable errors to users.
Pattern:
await EngineLock.acquire(ownerLabel, waitSignal);
try {
return await modelCall();
} finally {
EngineLock.release();
}For browser-based Python workflows:
- Do not write raw stdout/stderr to notebook outputs if they may include PHI.
- Do not include dataframe
head()output in notebooks unless explicitly reviewed. - Prefer aggregate metadata: row counts, column counts, column names, exception type.
- Keep real data previews limited to UI where needed and review PHI risk.
Before merging:
- No secrets, tokens, PHI, or participant identifiers in code, docs, tests, screenshots, or examples.
- No stack traces exposed directly to end users.
- No unguarded
innerHTMLwith user-controlled content. - No untrusted SQL or shell execution.
- Attachment deletion deletes all related records where applicable.
- Network-bound model prompts are redacted where the feature promises redaction.
Before merging UI changes:
- Keyboard-only operation works.
- Focus order is logical.
- Focus is visible.
- Dynamic status changes are announced where needed.
- Dialogs have labels and close behavior.
- Color is not the only state cue.
- Reduced-motion preference is respected for new animations.
Update docs in the same change when behavior changes:
README.mdfor user-visible setup or requirements.docs/quick-start.mdfor startup flow.docs/user-guide.mdfor everyday use.docs/field-kit.mdfor skill behavior.docs/data-files-and-knowledge-bases.mdfor file or retrieval behavior.docs/models-and-runtime.mdfor model/runtime changes.docs/security-privacy-accessibility.mdfor privacy or accessibility changes.
Use synthetic examples only.
Documentation licensed under the GNU Free Documentation License, version 1.3 or later.
Copyright © 2026 The Regents of the University of Michigan
