Centralize Gitea domain workflows
This commit is contained in:
23
AGENTS.md
23
AGENTS.md
@@ -34,13 +34,21 @@ cargo test --workspace
|
||||
Do not weaken or skip these gates to make a commit pass. Fix the underlying
|
||||
warning, lint, formatting issue, or test failure.
|
||||
|
||||
## Rust and Swift ownership boundary
|
||||
## Gitea, app, CLI, and Swift ownership boundary
|
||||
|
||||
Rust owns all application behavior. Put networking, authentication, input
|
||||
validation, persistence, preference changes, filtering, sorting, aggregation,
|
||||
parsing, content classification, display-data formatting, and navigation target
|
||||
derivation in `crates/app`. Cover non-trivial behavior there with Rust tests and
|
||||
expose view-ready records and operations through UniFFI.
|
||||
`gotcha_gitea` owns Gitea networking and authentication plus the behavior of
|
||||
Gitea objects: validation, pagination, name-to-ID resolution, mutations,
|
||||
ownership checks, object relationships, activity targets, commit graphs, and
|
||||
diff parsing. The app and CLI must not import generated Gitea API modules or
|
||||
build generated-client configurations. Add a concrete `Client` operation to
|
||||
`gotcha_gitea` instead. Generated response models may cross the boundary when a
|
||||
frontend only needs to present their fields; the CLI's explicit `api request`
|
||||
command is the sole low-level escape hatch.
|
||||
|
||||
`crates/app` owns application state, persistence, preferences, favorites,
|
||||
content classification, navigation targets, and view-ready UniFFI records. The
|
||||
CLI owns argument and YAML parsing plus terminal formatting. Do not duplicate
|
||||
Gitea object transformations or relationship handling in either frontend.
|
||||
|
||||
Swift is the native iOS presentation layer. Limit `ios/Sources` to UIKit and
|
||||
SwiftUI lifecycle, view-controller navigation, native controls, layout, drawing,
|
||||
@@ -52,7 +60,8 @@ transformations, classify content, or implement persistence and API behavior.
|
||||
|
||||
When changing iOS functionality:
|
||||
|
||||
- Trace the complete flow before editing and implement behavior in Rust first.
|
||||
- Trace the complete flow before editing and implement Gitea behavior in
|
||||
`gotcha_gitea` and app behavior in `crates/app` first.
|
||||
- Prefer view-ready Rust records over exposing raw Gitea models or rebuilding
|
||||
titles, summaries, selections, progress, and categories in Swift.
|
||||
- Treat a pure Swift helper that does not require an Apple UI framework as a
|
||||
|
||||
Reference in New Issue
Block a user