AAM Labs — Phase 0 due diligence & Phase 1 scaffold

24 Oct 2026 (IST). Generated from the local repo; no secrets included.

Key finding: github.com/anomalyco/opencode is the genuine OpenCode (sst/opencode redirects there; 220k stars, MIT). ADR-0001 (OpenHands) still stands but its rationale should be re-confirmed.

Decision Log (AAM Labs, 2026-10-24)

All decisions owner-authorized (Arihant Mangale) via call on 2026-10-24.

ADRDecisionStatus
ADR-0001OpenHands as primary coding agentAccepted — re-confirm (see Phase 0)
ADR-0002Docker containers as MVP sandbox; gVisor in phase 2Accepted
ADR-0003Model credentials via LiteLLM + env varsAccepted
ADR-0004Languages: Python and TypeScript/JavaScriptAccepted
ADR-0005Hosting: one small managed VM for control planeAccepted
ADR-0006Client retention and non-AMC recovery fees: draft onlyDraft for legal
ADR-0007Internal auto-release disabledAccepted

ADR-0001: OpenHands as primary coding agent

Date: 2026-10-24

Status: Accepted (owner-authorized)

Decision

Use OpenHands (MIT, OpenHands/OpenHands, 91.7k stars, v1.33.0) as the single phase-1 coding harness; do not combine agents.

Notes / consequences

Owner-authorized. Phase 0 finding that changes the rationale: github.com/anomalyco/opencode IS the real OpenCode — github.com/sst/opencode 301-redirects to it, same repo ID data (220.7k stars, MIT, v1.19.4). So 'unverified link' and 'smaller community' no longer hold. Decision stands as owner chose, but should be re-confirmed by owner and revisited after the phase-1 benchmark (plan §12 says choose harness after benchmark).

ADR-0002: Docker containers as MVP sandbox; gVisor in phase 2

Date: 2026-10-24

Status: Accepted (owner-authorized)

Decision

Ephemeral Docker containers for coding/build jobs in phase 1; gVisor (runsc) hardening in phase 2.

Notes / consequences

Accepted risk: plan §8 states plain Docker alone is not a sufficient hostile-code boundary. Mitigations required: non-root user, no host Docker socket, no production secrets, CPU/RAM/pids/time/disk limits, read-only root fs where feasible, cap-drop ALL, no-new-privileges, default-deny network with allowlist, repo-scoped short-lived tokens. Only internal/trusted repos in phase 1.

ADR-0003: Model credentials via LiteLLM + env vars

Date: 2026-10-24

Status: Accepted (owner-authorized)

Decision

All model calls route through LiteLLM; keys only from environment / secret store. Repo ships .env.example only.

Notes / consequences

Rotate keys every 90 days (see docs/CREDENTIAL_ROTATION.md). gitleaks in CI. LiteLLM enterprise/ dir is under separate licence — use MIT core only.

ADR-0004: Languages: Python and TypeScript/JavaScript

Date: 2026-10-24

Status: Accepted (owner-authorized)

Decision

Phase-1 slice supports Python and TS/JS only.

Notes / consequences

Others (Android, Go, etc.) deferred.

ADR-0005: Hosting: one small managed VM for control plane

Date: 2026-10-24

Status: Accepted (owner-authorized)

Decision

Always-on control plane (API, dispatcher, Postgres, audit) on one small managed VM (2-4 vCPU/4-8 GB per plan); builds in ephemeral containers.

Notes / consequences

Deviates from plan §1 'no VPS until measured need' for control plane only. Provider choice and any purchase need a separate owner go-ahead. Nothing provisioned.

ADR-0006: Client retention and non-AMC recovery fees: draft only

Date: 2026-10-24

Status: Accepted (owner-authorized)

Decision

Proposed terms drafted in docs/legal/PROPOSED_TERMS_DRAFT.md for legal sign-off. Nothing decided; no irreversible deletion implemented.

Notes / consequences

-

ADR-0007: Internal auto-release disabled

Date: 2026-10-24

Status: Accepted (owner-authorized)

Decision

Feature flag AUTO_RELEASE_ENABLED=false; every release (internal and client) passes OWNER_GATE.

Notes / consequences

Stricter than plan §7 which allows preauthorized internal auto-deploy; can be relaxed later by a new ADR.

Phase 0 — Licence and link check (captured 2026-10-24 ~11:50 IST via GitHub REST API; raw JSON + LICENSE heads in ./evidence/)

ComponentRepo URLDefault branch @ SHALicence (API SPDX / file)Latest releaseCommercial-use notes
Redishttps://github.com/redis/redisunstable @ c039dd784ca6139314880631de162f65dda25d45NOASSERTION; LICENSE.txt: Redis 8+ tri-licence RSALv2 / SSPLv1 / AGPLv3; ≤7.2 BSD-38.10.2 (2026-09-17)Using unmodified Redis internally as a cache/queue is fine under AGPLv3; do not offer Redis-as-a-service. Alternative: Valkey (BSD) or skip Redis — Postgres can queue in MVP.
LiteLLMhttps://github.com/BerriAI/litellmmain @ e04e89c7010809cc051b14f0e43d71dd018cdaeeNOASSERTION; MIT except enterprise/ (enterprise/LICENSE, commercial)v1.106.2 (2026-10-21)Use MIT core only; do not enable enterprise features without a licence.
Langfusehttps://github.com/langfuse/langfusemain @ f3500cd1167ec459851730913ebbb94c5003535cNOASSERTION; MIT except ee/, web/src/ee/, worker/src/ee/, packages/shared/src/server/ee/ (ee/LICENSE)v4.69.0 (2026-10-23)Self-host MIT core OK; ee features need paid licence. Not in phase-1 scope.
Semgrephttps://github.com/semgrep/semgrepdevelop @ 087e93b3a1fdf44f97bc92b5b9c2ba221cb2488bLGPL-2.1 (engine)v1.182.0 (2026-10-20)Engine fine to run as CLI. Rules (semgrep/semgrep-rules) are "Semgrep Rules License v1.0" (API: NOASSERTION/Other) — restricts use in competing/SaaS offerings; internal scanning likely OK, counsel to confirm. Phase 1 uses Trivy+Gitleaks instead.
OpenHandshttps://github.com/OpenHands/OpenHands (All-Hands-AI/OpenHands redirects here)main @ 11eba891cb2455f87253888d9d3bf3f6b0f12bc1MITv1.33.0 (2026-10-23)Permissive. 91,698 stars.
LangGraphhttps://github.com/langchain-ai/langgraphmain @ 4c52e129eb1ab69a3da58b799f67929f77d81149MIT1.2.17 (2026-10-24)Permissive.
pgvectorhttps://github.com/pgvector/pgvectormaster @ 8df5b32d3dd62a65661b278791a50e616adfea0eNOASSERTION; LICENSE file = PostgreSQL Licenseno GitHub releases; latest tag v0.8.7Permissive (PostgreSQL licence).

OpenCode link check

  • https://github.com/anomalyco/opencode exists: Organization-owned, MIT, 220,715 stars, created 2025-04-30, default branch dev @ b64cc80db3c933c7a83980b1f36eef047551c845, latest release v1.19.4 (2026-10-22), not a fork.
  • https://github.com/sst/opencode → HTTP 301 location: https://github.com/anomalyco/opencode; API for sst/opencode returns full_name anomalyco/opencode with identical SHA/stars.
  • Conclusion: anomalyco/opencode is the genuine OpenCode repo (moved from sst org). It is NOT a lookalike, and it has more stars than OpenHands. ADR-0001's stated rationale should be re-confirmed by the owner.
  • Limitation: org-identity verification beyond GitHub's redirect (e.g. verified domain badge) not checked.
  • Scaffold status

    pytest output

    ============================= test session starts ==============================
    platform linux -- Python 3.13.5, pytest-9.1.1, pluggy-1.7.0 -- /workspace/aam-labs/.venv/bin/python3
    cachedir: .pytest_cache
    rootdir: /workspace/aam-labs
    configfile: pytest.ini
    testpaths: tests
    plugins: langsmith-0.14.12, anyio-4.15.1
    collecting ... collected 8 items
    
    tests/test_scaffold.py::test_graph_runs_all_roles_and_stops_at_owner_gate PASSED [ 12%]
    tests/test_scaffold.py::test_release_blocked_without_approval PASSED     [ 25%]
    tests/test_scaffold.py::test_budget_ceiling_halts PASSED                 [ 37%]
    tests/test_scaffold.py::test_tool_denied_and_audited PASSED              [ 50%]
    tests/test_scaffold.py::test_flags_default_off PASSED                    [ 62%]
    tests/test_scaffold.py::test_sandbox_args_safe PASSED                    [ 75%]
    tests/test_scaffold.py::test_skill_promotion_requires_exam PASSED        [ 87%]
    tests/test_scaffold.py::test_api_flow PASSED                             [100%]
    
    ============================== 8 passed in 0.35s ===============================
    

    Proposed terms (DRAFT)

    DRAFT — FOR LEGAL REVIEW — NOT AGREED, NOT IN EFFECT

    Nothing here is decided. Options for counsel/owner sign-off.

    A. Post-exit data retention (plan proposal: up to 270 days, final 7-day notice)

  • Start of clock — options: (1) contract end date; (2) date of final invoice settlement; (3) date client confirms exit in writing. Recommendation to discuss: (1), clearest.
  • Notices — options: 30-day reminder + final 7-day notice before purge (email to two named contacts).
  • Client choices during window: export pack on request; early deletion on written request (subject to statutory holds).
  • Statutory exceptions: tax/invoice records and legal holds retained per applicable law (e.g. India DPDP Act 2023, IT Act, GST record rules) — counsel to confirm.
  • Backups: purge from rolling backups within N days after primary deletion (option: 35 or 90 days). Deletion certificate issued.
  • Storage cost during window — options: (1) included free; (2) free for 90 days then monthly fee; (3) paid per GB.
  • B. Non-AMC emergency recovery fees (unresolved in plan)

  • Option 1: Fixed call-out fee + hourly rate (e.g. minimum 4 hours), surcharge for nights/holidays.
  • Option 2: Tiered fixed packages (assessment only / restore / restore + root-cause report).
  • Option 3: Time & materials with prepaid retainer before work begins.
  • All options: separate written scope, new access authorization, owner approval before any change, no guarantee of recoverability, liability cap.
  • Amounts deliberately left blank for owner/legal.