AGENTS.md

EzAgent Android contributor guide

Keeping instructions focused

AGENTS.md files are standing project instructions, not task logs. Keep only durable conventions, constraints and authorization boundaries here. Put task reports, review findings, test counts, APK hashes, commit summaries and incident history in session reports or the task cache, not in public or private AGENTS.md. Keep machine-local setup in a separate private reference and link to it only where needed; update obsolete guidance instead of appending a timeline.

Project scope

The stable naming root is name.devnull.ezagent, based on the owner's devnull.name domain, not the Git hosting URL. The Android application ID and source namespace are name.devnull.ezagent.android; the Android-free Java library uses name.devnull.ezagent.lib. Keep source paths, test filters and install/launch scripts consistent with these names. Changing the application ID creates a separate Android app; never silently reset or transfer saved keys, profiles or host trust as part of a rename.

This is a separate Android client repository. The local harness checkout is ../ez-agent; the separate Linux-first desktop GUI is ../EzAgentGUI. The Android UI will use Java or Kotlin, and JSONL protocol handling should also live in that Android/JVM codebase. SSH may use a JVM library or a native implementation; neither is selected yet. Do not introduce Go merely for code sharing with the desktop client. Exceptions are future Hub support using the Go Hub compiled for Android targets, and a possible in-app on-device sandbox, which may introduce Go components. The sandbox would likely include an integrated Android-side GUI based on ../ez-wayland-box; inspect that project's instructions and architecture before designing the integration. Do not assume Android support already exists. These are tentative future options, not current scope. The choice between Java and Kotlin, UI toolkit, dependencies, build system, and remote repository name is not yet finalized.

First pass: SSH to an existing EzAgent Unix-domain socket, with native Android session/leaf discovery, inbox navigation, and chat modeled on the TUI workflow. Use Java/Kotlin for the UI and JSONL handling; do not embed a terminal UI. First-class image input remains a core requirement. Hub, remote graphical viewing, and on-device agent/distro/sandbox execution are outside the first pass; do not preemptively implement infrastructure for them.

See README.md for the intended SSH, future Hub, and first-class image workflows. Keep UI concerns separate from transport and connection lifecycle. Inspect the existing agent API before implementing attachment transfer or reconnect behavior; do not silently change its wire contract.

Required testing before delivery

  • When the user has provided an Android test environment, all changes presented to the user must first have been tested there. A successful build, JVM/unit tests, static inspection or APK installation alone is not sufficient. Exercise the affected behavior in the Android app and verify the result; retain concise evidence tied to the tested revision/artifact.
  • Agents are responsible for testing in the provided environment. Do not hand untested changes to the user as completed work or ask the user to perform routine Android validation. If testing is blocked, report the blocker and unfinished status, not a delivery or a claim of validation. Re-test after subsequent changes affecting behavior.
  • Keep environment-specific setup, ownership and access instructions in private local instructions, not public repository documentation. Do not put machine-local addresses or credentials in public documentation.

No legacy before release

  • Before the first public release, do not add or retain legacy compatibility, storage migrations, deprecated-format readers, or fallback UI merely to support earlier development builds. Maintain one current implementation and storage format rather than turning prototypes into permanent compatibility contracts.
  • An existing development installation does not establish a released user base or a requirement for migration support. Prefer an explicit development reset or re-import over shipping legacy paths. Do not silently erase keys, profiles, trusted hosts, or other data; obtain authorization before destructive test-environment resets.
  • Any pre-release compatibility exception requires explicit user approval and a concrete scope and removal condition. After release, decide compatibility and migration requirements against actual supported releases, not hypothetical ones.
  • This rule concerns this app's prior development formats and behavior; it does not prohibit interoperability with standard SSH key formats or supported servers.

Security and runtime boundaries

  • Local key unlock is discretionary, not a strength policy: offer enrolled strong biometrics first when available, recommend local PIN/passphrase otherwise, and permit explicit Skip additional unlock protection without repeated nags. Accept any nonempty matching local secret; no minimum length or strength mandate. Skip uses non-user-auth Android Keystore wrapping in app-private no-backup storage, not plaintext storage, private-key export, or saved SSH account passwords.
  • The GUI must never reveal, copy, share or export a saved private key, encrypted or plaintext, in any mode. Only public keys may be displayed/copied/shared. Keep explicit private-key file/paste import on the key screen, including existing phone/Termux keys; never change/delete source files. Decode encrypted imports transiently using their original passphrase, then choose app-local protection separately. Do not imply generated non-exportable keys have an original backup: recovery requires enrolling a replacement or restoring an imported original if one is actually available.
  • Distinguish local unlock secrets, original import passphrases and unsaved SSH account passwords. A local PIN alone does not authenticate SSH; possession/use of the private key is also required. Extracted passphrase-protected files permit offline guesses. Never silently downgrade biometric protection after failure or cancellation, and never persist an unfinished replacement.
  • Connect directly with the selected mode: no generic authorization chooser; Skip has no unlock ceremony, PIN/passphrase asks locally, biometrics use the real CryptoObject. Trust failure discards all attempt credentials; retry uses a fresh mode-appropriate unlock (none for Skip). Changed host keys fail closed. Credential cancellation must respect worker ownership, never concurrently wipe mutable buffers in use. Preserve atomic trust, bounded exact imports, secure dialogs, safe error categories, default-off exec relay and service Disconnect.
  • Keep established SSH connections active through Android screen lock and backgrounding via the foreground service and ongoing Disconnect notification; do not introduce a separate app-lock action. After connection loss, require fresh unlock only for biometric/PIN-protected keys; Skip needs no unlock prompt, and SSH account passwords require fresh entry. Do not retain unlocked credentials for silent reconnect. OS process/network loss remains possible.
  • Private-key paste and file import are explicit actions in the key-import UI. Never interpret ordinary chat paste as key import or monitor the clipboard.
  • Preserve normal platform paste behavior elsewhere, including image input where supported. Do not impose key-screen restrictions across the application.
  • Never log keys, passphrases, passwords, or credential material. Keep secrets out of saved UI state and diagnostics; use protected app-private storage.
  • Verify SSH host keys. Key passphrases and SSH account passwords are different authentication inputs. Do not silently accept changed host keys.
  • Do not assume local image paths are accessible to remote agents. Handle Android URI permissions and attachment lifetime explicitly.
  • Credentials are capability, not authorization. Commits, pushes, opening PRs, comments, issue/PR changes, and merges need the user's instruction, explicitly or within a clearly delegated task. Access to remote hosts, host package installation, and launching services against live user state need authorization.

Commit attribution

  • Preserve contributor authorship. For new work on the user's behalf, use the human identity supplied by user instructions or existing Git configuration.
  • End commits containing AI-written code, tests, or scripts with Coded by AI -- <actual provider/model IDs>.
  • Name only models actually involved; distinguish coding and review roles when known. Verify identities from runtime metadata rather than guessing.
  • For documentation-only or review-only AI contributions, use an accurate final line such as Documentation by AI -- <actual provider/model IDs> or Reviewed by AI -- <actual provider/model IDs>.

Issues and pull requests

Most changes go through the GitCafe issue and pull-request workflow:

  • Opening an issue first is optional; use it to record a problem or agree on a plan before coding.
  • Open a pull request for each change. Keep it a draft while it is being planned or is incomplete.
  • Mark the pull request ready for review only when it is complete and validated, including the required Android test-environment testing above.
  • Merging happens by pushing the merge to main from Git (prefer git merge --no-ff so the PR branch boundary stays visible), then pushing. GitCafe's issue/PR state may reconcile asynchronously from the push; treat the pushed Git history as authoritative and do not perform or wait on service-side merge actions.

Issue and PR attribution

Clearly identify agent-authored descriptions, comments, replies, inline feedback, and reviews as AI-authored. End each with Agent signoff -- AI (<actual provider/model>), using a verified identity. See https://git.cafe/ezterry/ez-agent/pull/2 for an existing signoff example. When a verified model identity is unavailable in a session, use EzAgent as the attribution name instead of guessing a provider or model.