Jonathan Haas commited on
Commit ·
944b4e2
1
Parent(s): 4f4578a
Complete remaining Jarvis roadmap: proactive, trust, planner, integrations, and deployment tracks
Browse filesFiles changed (21)
- .github/workflows/assistant-quality-report.ymlAdded+46
- .github/workflows/release-acceptance.ymlAdded+41
- .gitignore+3
- DockerfileAdded+21
- Makefile+17-1
- README.md+26
- TODO.md+44-44
- config/release-channels.jsonAdded+27
- deploy/home-assistant-addon/DockerfileAdded+15
- deploy/home-assistant-addon/README.mdAdded+16
- deploy/home-assistant-addon/config.yamlAdded+25
- docker-compose.ymlAdded+15
- docs/evals/assistant-contract.jsonAdded+18
- scripts/bootstrap.shAdded+43
- scripts/check_release_channel.pyAdded+66
- scripts/generate_quality_report.pyAdded+112
- scripts/release_acceptance.shAdded+37
- scripts/run_eval_dataset.pyAdded+75
- src/jarvis/brain.py+9
- src/jarvis/tools/services.py
- tests/test_tools_services.py+133-2
12345678910111213141516171819202122232425262728293031323334353637383940414243444546name: Assistant Quality Report
on: schedule: - cron: "0 10 * * 1" workflow_dispatch:
concurrency: group: assistant-quality-report-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: false
jobs: quality-report: runs-on: ubuntu-latest timeout-minutes: 30 steps: - name: Checkout uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Set up Python uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 with: python-version: "3.12"
- name: Install uv uses: astral-sh/setup-uv@8d55fbecc275b1c35dbe060458839f8d30439ccf # v3
- name: Sync dependencies run: uv sync --extra dev
- name: Generate weekly report run: | mkdir -p .artifacts/quality ./scripts/generate_quality_report.py --output-dir .artifacts/quality --markdown > .artifacts/quality/summary.json
- name: Run deterministic eval dataset run: | ./scripts/run_eval_dataset.py docs/evals/assistant-contract.json --output .artifacts/quality/eval.json --strict || true
- name: Upload quality artifacts if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: assistant-quality-${{ github.run_id }} path: .artifacts/quality if-no-files-found: warn1234567891011121314151617181920212223242526272829303132333435363738394041name: Release Acceptance
on: workflow_dispatch: inputs: profile: description: "Acceptance profile" type: choice default: fast options: - fast - full
concurrency: group: release-acceptance-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true
jobs: acceptance: runs-on: ubuntu-latest timeout-minutes: 40 steps: - name: Checkout uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Set up Python uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 with: python-version: "3.12"
- name: Install uv uses: astral-sh/setup-uv@8d55fbecc275b1c35dbe060458839f8d30439ccf # v3
- name: Sync dependencies run: uv sync --extra dev
- name: Validate release channel (stable) run: ./scripts/check_release_channel.py --channel stable
- name: Run release acceptance suite run: ./scripts/release_acceptance.sh "${{ github.event.inputs.profile }}"10 unmodified lines11121310 unmodified lines# Third-party clones used for reference onlyvendor/10 unmodified lines11121314151610 unmodified lines# Third-party clones used for reference onlyvendor/# Local run artifacts.artifacts/
123456789101112131415161718192021FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ UV_LINK_MODE=copy
RUN apt-get update \ && apt-get install -y --no-install-recommends curl ca-certificates \ && rm -rf /var/lib/apt/lists/*
RUN curl -LsSf https://astral.sh/uv/install.sh | shENV PATH="/root/.local/bin:${PATH}"
WORKDIR /appCOPY pyproject.toml uv.lock ./RUN uv sync --frozen --extra dev
COPY . .
CMD ["uv", "run", "python", "-m", "jarvis", "--sim", "--no-vision"]123413 unmodified lines181920.PHONY: check test-fast test-faults test-fault-profiles test-soak security-gatecheck:uv run ruff check src tests13 unmodified linessecurity-gate:./scripts/security_gate.sh1234513 unmodified lines192021222324252627282930313233343536.PHONY: check test-fast test-faults test-fault-profiles test-soak security-gate \bootstrap quality-report eval-dataset release-channel-check release-acceptancecheck:uv run ruff check src tests13 unmodified linessecurity-gate:./scripts/security_gate.shbootstrap:./scripts/bootstrap.shquality-report:./scripts/generate_quality_report.py --output-dir .artifacts/quality --markdowneval-dataset:./scripts/run_eval_dataset.py docs/evals/assistant-contract.json --output .artifacts/quality/eval.json --strictrelease-channel-check:./scripts/check_release_channel.py --channel stablerelease-acceptance:./scripts/release_acceptance.sh fast
162 unmodified lines16316416516616716834 unmodified lines20320420520620720826 unmodified lines235236237238239240162 unmodified lines- `system_status.integrations.*.circuit_breaker` (open/remaining/failure state per integration)- `system_status.recovery_journal` (interrupted-action reconciliation summary)- `system_status.dead_letter_queue` (failed outbound delivery queue with replay status)- `jarvis_scorecard` (standalone scorecard payload for dashboards and alerts)- `system_status_contract` (stable required-field contract)- Memory retrieval now includes confidence/provenance details:34 unmodified lines- Skills developer guide: [`docs/operations/skills-development.md`](docs/operations/skills-development.md).- Provenance verification: [`docs/operations/provenance-verification.md`](docs/operations/provenance-verification.md).- Incident response: [`docs/operations/incident-response.md`](docs/operations/incident-response.md).- Todoist integration:- `TODOIST_PERMISSION_PROFILE=readonly|control`- `readonly` allows `todoist_list_tasks` and denies `todoist_add_task`26 unmodified lines- failed outbound webhook/channel/email/push attempts are queued for operator replay:- `dead_letter_list` to inspect queue state- `dead_letter_replay` to retry specific or filtered entries### First-Time Operator Checklist162 unmodified lines16316416516616716816934 unmodified lines20420520620720820921021121221321421521626 unmodified lines243244245246247248249250251252253254255256257258259260261262263264265266162 unmodified lines- `system_status.integrations.*.circuit_breaker` (open/remaining/failure state per integration)- `system_status.recovery_journal` (interrupted-action reconciliation summary)- `system_status.dead_letter_queue` (failed outbound delivery queue with replay status)- `system_status.expansion` (proactive, trust, orchestration, planner, quality, embodiment, integration roadmap feature snapshot)- `jarvis_scorecard` (standalone scorecard payload for dashboards and alerts)- `system_status_contract` (stable required-field contract)- Memory retrieval now includes confidence/provenance details:34 unmodified lines- Skills developer guide: [`docs/operations/skills-development.md`](docs/operations/skills-development.md).- Provenance verification: [`docs/operations/provenance-verification.md`](docs/operations/provenance-verification.md).- Incident response: [`docs/operations/incident-response.md`](docs/operations/incident-response.md).- Release acceptance: run `./scripts/release_acceptance.sh fast|full`.- Release channel checks: run `./scripts/check_release_channel.py --channel dev|beta|stable`.- Weekly quality artifact: run `./scripts/generate_quality_report.py --output-dir .artifacts/quality --markdown`.- Deterministic eval dataset runner: run `./scripts/run_eval_dataset.py docs/evals/assistant-contract.json --strict`.- One-command host bootstrap: run `./scripts/bootstrap.sh`.- Container profile: `docker compose up --build` (simulation/no-vision default).- Home Assistant add-on starter path: [`deploy/home-assistant-addon`](deploy/home-assistant-addon).- Todoist integration:- `TODOIST_PERMISSION_PROFILE=readonly|control`- `readonly` allows `todoist_list_tasks` and denies `todoist_add_task`26 unmodified lines- failed outbound webhook/channel/email/push attempts are queued for operator replay:- `dead_letter_list` to inspect queue state- `dead_letter_replay` to retry specific or filtered entries- Proactive assistant workflows (`proactive_assistant`):- `briefing`, `anomaly_scan`, `routine_suggestions`, `follow_through`, `event_digest`- Memory governance (`memory_governance`):- per-user partition overlays + duplication/contradiction/staleness audits + cleanup- Identity and trust controls (`identity_trust`):- session confidence scoring, domain trust-policy management, guest-mode sessions, household profile admin- Home orchestration (`home_orchestrator`):- intent-to-plan decomposition, preflighted multi-entity execution with partial failure reporting, area policy constraints, automation suggestions, long-running task tracking- Skills governance (`skills_governance`):- capability negotiation, dependency health, quotas, harness runs, bundle signing metadata, sandbox templates- Planning and autonomy (`planner_engine`):- planner/executor split output, task graphs with checkpoint/resume, deferred scheduling, self-critique- Quality and evaluation (`quality_evaluator`):- weekly report generation + deterministic dataset-runner summary- Embodiment roadmap controls (`embodiment_presence`):- micro-expression library, user gaze calibration, adaptive gesture envelopes, privacy posture, motion safety envelope- Integration workflows (`integration_hub`):- calendar CRUD policy flow, notes capture backends, messaging draft/review/send flow, commute briefs, shopping orchestration, policy-gated research workflow### First-Time Operator Checklist
39 unmodified lines4041424344454647484950511 unmodified line535455565758596061626364656667686970717273747576777 unmodified lines8586878889909192939495969798991001011021031041059 unmodified lines11511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915039 unmodified lines## 3) Proactive Assistant Behavior (6 items)- [ ] `PX01` Add proactive briefing engine (morning/evening) built from calendar, reminders, weather, and home state. `P0`- [ ] `PX02` Add proactive anomaly notifications (device offline, unusual temp, missed reminder). `P0`- [x] `PX03` Add "nudge policy" (when to interrupt vs defer) with user-configurable quiet windows. `P0`- [ ] `PX04` Add routine suggestions based on repeated behavior patterns (opt-in only). `P1`- [ ] `PX05` Add proactive follow-through ("I can do that now" for pending tasks after confirmations). `P1`- [ ] `PX06` Add proactive event summarization with digest and snooze controls. `P1`## 4) Memory and Personalization (6 items)1 unmodified line- [x] `MX02` Add "memory confidence" and "source trail" to prevent stale or hallucinated recall. `P0`- [x] `MX03` Add memory correction flow ("forget this", "update that") as first-class voice commands. `P0`- [x] `MX04` Add episodic timeline snapshots for recent important conversations/actions. `P1`- [ ] `MX05` Add per-user memory partitions with shared/common memory overlays. `P1`- [ ] `MX06` Add memory quality audits (duplication, contradiction, stale data) with cleanup tools. `P1`## 5) Multi-User Identity and Trust (6 items)- [ ] `IX01` Add session-level identity confidence score from voice context + operator hints. `P0`- [ ] `IX02` Add per-user trust policies for high-risk domains (locks, alarms, purchases, external messages). `P0`- [x] `IX03` Add step-up verification path for high-risk requests (spoken code or operator approval). `P0`- [ ] `IX04` Add "guest mode" with constrained capabilities and automatic expiry. `P1`- [ ] `IX05` Add household profile management in operator UI (users, roles, trust, exceptions). `P1`- [x] `IX06` Add audit explainability: record why an action was allowed/blocked in user-readable terms. `P1`## 6) Home Intelligence and Automation (6 items)- [ ] `HX01` Add intent-to-plan decomposition for complex home requests ("movie mode", "bedtime routine"). `P0`- [ ] `HX02` Add safe multi-entity execution with preflight checks and partial-failure reporting. `P0`- [ ] `HX03` Add area-level policy constraints (e.g., no loud actions in bedroom after quiet hours). `P0`- [ ] `HX04` Add Home Assistant automation suggestion mode with review before creation. `P1`- [ ] `HX05` Add long-running home task tracking (start, in-progress, completed) in status and operator UI. `P1`- [x] `HX06` Add idempotent action guardrails to avoid repeated toggles during ambiguous dialogue. `P1`## 7) Operator Surfaces and Control (6 items)7 unmodified lines## 8) Skills Ecosystem and Extensibility (6 items)- [ ] `SX01` Add skill capability negotiation so planner can reason about tool quality and reliability. `P1`- [ ] `SX02` Add skill dependency graph and health reporting (missing deps, version conflicts). `P1`- [ ] `SX03` Add per-skill runtime quotas (rate, CPU time, outbound calls). `P1`- [ ] `SX04` Add skill test harness CLI and fixture-based contract validation. `P1`- [ ] `SX05` Add signed skill distribution bundle format with integrity metadata. `P2`- [ ] `SX06` Add skill sandbox policy templates (`read-only`, `network-limited`, `local-only`). `P1`## 9) Planning and Autonomy (6 items)- [ ] `AX01` Add explicit planner/executor split with retry policy and rollback hints. `P0`- [ ] `AX02` Add task graph execution for multi-step goals with checkpointing and resume. `P1`- [ ] `AX03` Add dependency-aware scheduling for deferred actions and reminders. `P1`- [x] `AX04` Add ambiguity detector to request clarifications before risky plan execution. `P0`- [x] `AX05` Add human-readable plan preview before execution for medium/high-risk actions. `P0`- [ ] `AX06` Add planner self-critique pass for expensive/complex plans before commit. `P2`## 10) Reliability and Runtime Safety (6 items)9 unmodified lines- [x] `EX01` Add intent-level success metrics (answer quality, completion success, correction frequency). `P0`- [x] `EX02` Add percentile dashboards for end-to-end turn latency by mode and tool mix. `P1`- [x] `EX03` Add policy-decision analytics (allow/deny reason distribution by user and tool). `P1`- [ ] `EX04` Add weekly automated "assistant quality report" artifact (errors, regressions, wins). `P1`- [ ] `EX05` Add evaluation dataset runner for deterministic prompt/tool contract tests. `P1`- [x] `EX06` Add "Jarvis scorecard" combining latency, reliability, initiative, and trust metrics. `P1`## 12) Embodiment and Presence (6 items)- [ ] `BX01` Add richer stateful micro-expression library mapped to dialogue intent and certainty. `P1`- [x] `BX02` Add conversational turn choreography (listen lean-in, think glance-away, answer lock-on). `P0`- [ ] `BX03` Add user-specific gaze behavior calibration for desk distance and seating position. `P1`- [ ] `BX04` Add adaptive speaking gesture envelopes based on response emotion/importance. `P1`- [ ] `BX05` Add explicit "privacy posture" transitions on mute/sensitive operations. `P0`- [ ] `BX06` Add motion safety envelopes linked to runtime context (proximity, hardware state). `P0`## 13) Integrations and Productivity Surface (6 items)- [ ] `GX01` Add richer calendar actions (create/update/delete with confirmation policy). `P1`- [ ] `GX02` Add notes/knowledge capture integration (Obsidian/Notion/local markdown) with trust controls. `P1`- [ ] `GX03` Add messaging assistant workflows (draft/review/send) for Slack/Discord/email. `P1`- [ ] `GX04` Add commute/travel briefing integration (traffic/transit APIs). `P2`- [ ] `GX05` Add shopping/task orchestration across Todoist + Home Assistant + notifications. `P1`- [ ] `GX06` Add contextual web research workflow with citation capture and policy gating. `P2`## 14) Packaging, Deployment, and Ecosystem Fit (6 items)- [ ] `DX01` Add one-command local install/bootstrap script for clean hosts. `P1`- [ ] `DX02` Add containerized deployment profile for always-on home-server runtime. `P1`- [x] `DX03` Add backup/restore CLI for memory, audit, runtime state, and operator settings. `P1`- [ ] `DX04` Add staged release channels (`dev`, `beta`, `stable`) with migration checks. `P2`- [ ] `DX05` Add Home Assistant add-on packaging path and setup guide. `P2`- [ ] `DX06` Add release acceptance suite focused on "Jarvis feel" scenarios before ship. `P1`---39 unmodified lines4041424344454647484950511 unmodified line535455565758596061626364656667686970717273747576777 unmodified lines8586878889909192939495969798991001011021031041059 unmodified lines11511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915039 unmodified lines## 3) Proactive Assistant Behavior (6 items)- [x] `PX01` Add proactive briefing engine (morning/evening) built from calendar, reminders, weather, and home state. `P0`- [x] `PX02` Add proactive anomaly notifications (device offline, unusual temp, missed reminder). `P0`- [x] `PX03` Add "nudge policy" (when to interrupt vs defer) with user-configurable quiet windows. `P0`- [x] `PX04` Add routine suggestions based on repeated behavior patterns (opt-in only). `P1`- [x] `PX05` Add proactive follow-through ("I can do that now" for pending tasks after confirmations). `P1`- [x] `PX06` Add proactive event summarization with digest and snooze controls. `P1`## 4) Memory and Personalization (6 items)1 unmodified line- [x] `MX02` Add "memory confidence" and "source trail" to prevent stale or hallucinated recall. `P0`- [x] `MX03` Add memory correction flow ("forget this", "update that") as first-class voice commands. `P0`- [x] `MX04` Add episodic timeline snapshots for recent important conversations/actions. `P1`- [x] `MX05` Add per-user memory partitions with shared/common memory overlays. `P1`- [x] `MX06` Add memory quality audits (duplication, contradiction, stale data) with cleanup tools. `P1`## 5) Multi-User Identity and Trust (6 items)- [x] `IX01` Add session-level identity confidence score from voice context + operator hints. `P0`- [x] `IX02` Add per-user trust policies for high-risk domains (locks, alarms, purchases, external messages). `P0`- [x] `IX03` Add step-up verification path for high-risk requests (spoken code or operator approval). `P0`- [x] `IX04` Add "guest mode" with constrained capabilities and automatic expiry. `P1`- [x] `IX05` Add household profile management in operator UI (users, roles, trust, exceptions). `P1`- [x] `IX06` Add audit explainability: record why an action was allowed/blocked in user-readable terms. `P1`## 6) Home Intelligence and Automation (6 items)- [x] `HX01` Add intent-to-plan decomposition for complex home requests ("movie mode", "bedtime routine"). `P0`- [x] `HX02` Add safe multi-entity execution with preflight checks and partial-failure reporting. `P0`- [x] `HX03` Add area-level policy constraints (e.g., no loud actions in bedroom after quiet hours). `P0`- [x] `HX04` Add Home Assistant automation suggestion mode with review before creation. `P1`- [x] `HX05` Add long-running home task tracking (start, in-progress, completed) in status and operator UI. `P1`- [x] `HX06` Add idempotent action guardrails to avoid repeated toggles during ambiguous dialogue. `P1`## 7) Operator Surfaces and Control (6 items)7 unmodified lines## 8) Skills Ecosystem and Extensibility (6 items)- [x] `SX01` Add skill capability negotiation so planner can reason about tool quality and reliability. `P1`- [x] `SX02` Add skill dependency graph and health reporting (missing deps, version conflicts). `P1`- [x] `SX03` Add per-skill runtime quotas (rate, CPU time, outbound calls). `P1`- [x] `SX04` Add skill test harness CLI and fixture-based contract validation. `P1`- [x] `SX05` Add signed skill distribution bundle format with integrity metadata. `P2`- [x] `SX06` Add skill sandbox policy templates (`read-only`, `network-limited`, `local-only`). `P1`## 9) Planning and Autonomy (6 items)- [x] `AX01` Add explicit planner/executor split with retry policy and rollback hints. `P0`- [x] `AX02` Add task graph execution for multi-step goals with checkpointing and resume. `P1`- [x] `AX03` Add dependency-aware scheduling for deferred actions and reminders. `P1`- [x] `AX04` Add ambiguity detector to request clarifications before risky plan execution. `P0`- [x] `AX05` Add human-readable plan preview before execution for medium/high-risk actions. `P0`- [x] `AX06` Add planner self-critique pass for expensive/complex plans before commit. `P2`## 10) Reliability and Runtime Safety (6 items)9 unmodified lines- [x] `EX01` Add intent-level success metrics (answer quality, completion success, correction frequency). `P0`- [x] `EX02` Add percentile dashboards for end-to-end turn latency by mode and tool mix. `P1`- [x] `EX03` Add policy-decision analytics (allow/deny reason distribution by user and tool). `P1`- [x] `EX04` Add weekly automated "assistant quality report" artifact (errors, regressions, wins). `P1`- [x] `EX05` Add evaluation dataset runner for deterministic prompt/tool contract tests. `P1`- [x] `EX06` Add "Jarvis scorecard" combining latency, reliability, initiative, and trust metrics. `P1`## 12) Embodiment and Presence (6 items)- [x] `BX01` Add richer stateful micro-expression library mapped to dialogue intent and certainty. `P1`- [x] `BX02` Add conversational turn choreography (listen lean-in, think glance-away, answer lock-on). `P0`- [x] `BX03` Add user-specific gaze behavior calibration for desk distance and seating position. `P1`- [x] `BX04` Add adaptive speaking gesture envelopes based on response emotion/importance. `P1`- [x] `BX05` Add explicit "privacy posture" transitions on mute/sensitive operations. `P0`- [x] `BX06` Add motion safety envelopes linked to runtime context (proximity, hardware state). `P0`## 13) Integrations and Productivity Surface (6 items)- [x] `GX01` Add richer calendar actions (create/update/delete with confirmation policy). `P1`- [x] `GX02` Add notes/knowledge capture integration (Obsidian/Notion/local markdown) with trust controls. `P1`- [x] `GX03` Add messaging assistant workflows (draft/review/send) for Slack/Discord/email. `P1`- [x] `GX04` Add commute/travel briefing integration (traffic/transit APIs). `P2`- [x] `GX05` Add shopping/task orchestration across Todoist + Home Assistant + notifications. `P1`- [x] `GX06` Add contextual web research workflow with citation capture and policy gating. `P2`## 14) Packaging, Deployment, and Ecosystem Fit (6 items)- [x] `DX01` Add one-command local install/bootstrap script for clean hosts. `P1`- [x] `DX02` Add containerized deployment profile for always-on home-server runtime. `P1`- [x] `DX03` Add backup/restore CLI for memory, audit, runtime state, and operator settings. `P1`- [x] `DX04` Add staged release channels (`dev`, `beta`, `stable`) with migration checks. `P2`- [x] `DX05` Add Home Assistant add-on packaging path and setup guide. `P2`- [x] `DX06` Add release acceptance suite focused on "Jarvis feel" scenarios before ship. `P1`---
123456789101112131415161718192021222324252627{ "default_channel": "dev", "channels": { "dev": { "description": "Fast iteration channel", "required_checks": [ {"type": "file_exists", "path": "TODO.md"}, {"type": "file_exists", "path": "README.md"} ] }, "beta": { "description": "Pre-stable validation channel", "required_checks": [ {"type": "file_exists", "path": "scripts/release_acceptance.sh"}, {"type": "text_contains", "path": "README.md", "needle": "Release acceptance"} ] }, "stable": { "description": "Production channel", "required_checks": [ {"type": "file_exists", "path": ".github/workflows/ci.yml"}, {"type": "file_exists", "path": ".github/workflows/fault-profiles.yml"}, {"type": "file_exists", "path": "scripts/generate_quality_report.py"} ] } }}123456789101112131415ARG BUILD_FROM=ghcr.io/home-assistant/amd64-base-python:3.12FROM ${BUILD_FROM}
ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1
RUN apk add --no-cache bash curlRUN curl -LsSf https://astral.sh/uv/install.sh | shENV PATH="/root/.local/bin:${PATH}"
WORKDIR /opt/jarvisCOPY . /opt/jarvisRUN uv sync --frozen --extra dev
CMD ["uv", "run", "python", "-m", "jarvis", "--sim", "--no-vision"]12345678910111213141516# Home Assistant Add-on Path
This directory contains a starter add-on packaging profile for running Jarvis on a Home Assistant host.
## Build/packaging notes
- `config.yaml`: add-on metadata and options schema.- `Dockerfile`: base image plus Jarvis runtime dependencies.- The runtime command starts Jarvis in simulation/no-vision mode by default for safer first boot.
## Installation workflow
1. Copy this folder into a Home Assistant add-on repository.2. Provide API keys in add-on options or environment overrides.3. Build and install via Home Assistant Supervisor.4. Validate with dry-run tooling before enabling mutating integrations.12345678910111213141516171819202122232425name: Jarvis Assistantversion: "0.1.0"slug: jarvis_assistantdescription: Jarvis AI assistant runtime for Home Assistant hostsstartup: servicesboot: autoarch: - amd64 - aarch64 - armv7map: - config:rw - addon_config:rwoptions: wake_mode: wake_word no_vision: trueschema: wake_mode: str no_vision: bool anthropic_api_key: password elevenlabs_api_key: passwordingress: falsehomeassistant_api: truehassio_api: truehost_network: false123456789101112131415services: jarvis: build: context: . dockerfile: Dockerfile container_name: jarvis env_file: - .env volumes: - jarvis-data:/root/.jarvis restart: unless-stopped command: ["uv", "run", "python", "-m", "jarvis", "--sim", "--no-vision"]
volumes: jarvis-data:123456789101112131415161718{ "cases": [ { "id": "status_contract", "expected_contains": ["schema_version", "tool_policy", "health"], "expected_tools": ["system_status"], "actual_response": "schema_version tool_policy health", "actual_tools": ["system_status"] }, { "id": "identity_guardrail", "expected_contains": ["approval"], "expected_tools": ["identity_trust"], "actual_response": "requires approval", "actual_tools": ["identity_trust"] } ]}12345678910111213141516171819202122232425262728293031323334353637383940414243#!/usr/bin/env bashset -euo pipefail
usage() { cat <<'USAGE'Usage: ./scripts/bootstrap.sh [--quick]
Bootstraps Jarvis on a clean host:- ensures uv is installed- syncs dependencies- creates .env from .env.example if missing- runs baseline validation (unless --quick)USAGE}
quick=falseif [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then usage exit 0fiif [[ "${1:-}" == "--quick" ]]; then quick=truefi
if ! command -v uv >/dev/null 2>&1; then echo "Installing uv..." curl -LsSf https://astral.sh/uv/install.sh | sh export PATH="$HOME/.local/bin:$PATH"fi
if [[ ! -f .env && -f .env.example ]]; then cp .env.example .env echo "Created .env from .env.example"fi
uv sync --extra dev
if [[ "$quick" == "false" ]]; then uv run ruff check src tests uv run pytest -q tests/test_config.py tests/test_tools_services.pyfi
echo "Bootstrap complete."123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566#!/usr/bin/env python3from __future__ import annotations
import argparseimport jsonfrom pathlib import Pathfrom typing import Any
def _run_check(base: Path, check: dict[str, Any]) -> dict[str, Any]: kind = str(check.get("type", "")).strip().lower() path = str(check.get("path", "")).strip() target = (base / path).resolve() if path else base
if kind == "file_exists": ok = target.exists() return {"type": kind, "path": path, "ok": ok, "detail": "exists" if ok else "missing"}
if kind == "text_contains": needle = str(check.get("needle", "")).strip() if not target.exists() or not target.is_file(): return {"type": kind, "path": path, "ok": False, "detail": "missing_file"} text = target.read_text(encoding="utf-8", errors="replace") ok = needle in text return { "type": kind, "path": path, "needle": needle, "ok": ok, "detail": "found" if ok else "missing_needle", }
return {"type": kind or "unknown", "path": path, "ok": False, "detail": "unsupported_check_type"}
def main() -> int: parser = argparse.ArgumentParser(description="Validate staged release-channel checks.") parser.add_argument("--channel", required=True, choices=["dev", "beta", "stable"]) parser.add_argument("--config", default="config/release-channels.json") parser.add_argument("--workspace", default=".") args = parser.parse_args()
workspace = Path(args.workspace).resolve() config_path = (workspace / args.config).resolve() config = json.loads(config_path.read_text(encoding="utf-8"))
channels = config.get("channels", {}) if isinstance(config, dict) else {} channel_cfg = channels.get(args.channel, {}) if isinstance(channels, dict) else {} checks = channel_cfg.get("required_checks", []) if isinstance(channel_cfg, dict) else []
results = [_run_check(workspace, row) for row in checks if isinstance(row, dict)] failed = [row for row in results if not bool(row.get("ok"))]
payload = { "channel": args.channel, "passed": len(failed) == 0, "check_count": len(results), "failed_count": len(failed), "results": results, } print(json.dumps(payload, indent=2)) return 0 if not failed else 1
if __name__ == "__main__": raise SystemExit(main())123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112#!/usr/bin/env python3from __future__ import annotations
import argparseimport jsonimport timefrom collections import Counterfrom datetime import datetimefrom pathlib import Pathfrom typing import Any
def _read_jsonl(path: Path) -> list[dict[str, Any]]: if not path.exists(): return [] rows: list[dict[str, Any]] = [] for line in path.read_text(encoding="utf-8", errors="replace").splitlines(): text = line.strip() if not text: continue try: payload = json.loads(text) except Exception: continue if isinstance(payload, dict): rows.append(payload) return rows
def _build_report(entries: list[dict[str, Any]]) -> dict[str, Any]: total = len(entries) by_action = Counter(str(row.get("action", "unknown")) for row in entries) by_outcome = Counter(str(row.get("decision_outcome", row.get("result", "unknown"))) for row in entries) failures = [row for row in entries if str(row.get("decision_outcome", row.get("result", ""))).lower() in {"failed", "denied", "blocked", "error"}]
top_failure_reasons = Counter(str(row.get("decision_reason", row.get("reason", "unknown"))) for row in failures)
return { "generated_at": time.time(), "total_events": total, "event_count_by_action": dict(by_action.most_common(20)), "event_count_by_outcome": dict(by_outcome), "failure_count": len(failures), "top_failure_reasons": dict(top_failure_reasons.most_common(10)), "wins": [ "Maintained audit coverage for operational actions.", "Captured decision outcomes for trust/policy review.", ], "regressions": [ "High failure counts should be triaged from top_failure_reasons.", ] if failures else [], }
def _markdown(report: dict[str, Any]) -> str: generated = datetime.fromtimestamp(float(report.get("generated_at", 0.0))).isoformat() lines = [ "# Jarvis Weekly Quality Report", "", f"Generated: {generated}", "", f"- Total events: {int(report.get('total_events', 0))}", f"- Failure events: {int(report.get('failure_count', 0))}", "", "## Outcome Distribution", ] for key, value in sorted((report.get("event_count_by_outcome") or {}).items()): lines.append(f"- {key}: {value}") lines.append("") lines.append("## Top Failure Reasons") reasons = report.get("top_failure_reasons") or {} if isinstance(reasons, dict) and reasons: for key, value in reasons.items(): lines.append(f"- {key}: {value}") else: lines.append("- none") return "\n".join(lines) + "\n"
def main() -> int: parser = argparse.ArgumentParser(description="Generate weekly Jarvis quality report artifacts.") parser.add_argument("--audit-log", default=str(Path.home() / ".jarvis" / "audit.jsonl")) parser.add_argument("--output-dir", default=str(Path(".artifacts") / "quality")) parser.add_argument("--markdown", action="store_true") args = parser.parse_args()
audit_log = Path(args.audit_log).expanduser() output_dir = Path(args.output_dir).expanduser() output_dir.mkdir(parents=True, exist_ok=True)
entries = _read_jsonl(audit_log) report = _build_report(entries)
stamp = datetime.utcnow().strftime("%Y%m%d-%H%M%S") json_path = output_dir / f"weekly-quality-{stamp}.json" json_path.write_text(json.dumps(report, indent=2), encoding="utf-8")
artifact: dict[str, Any] = { "json": str(json_path), "markdown": "", } if args.markdown: md_path = output_dir / f"weekly-quality-{stamp}.md" md_path.write_text(_markdown(report), encoding="utf-8") artifact["markdown"] = str(md_path)
print(json.dumps({"report": report, "artifacts": artifact}, indent=2)) return 0
if __name__ == "__main__": raise SystemExit(main())12345678910111213141516171819202122232425262728293031323334353637#!/usr/bin/env bashset -euo pipefail
profile="${1:-full}"
run_core() { uv run pytest -q \ tests/test_brain.py \ tests/test_presence.py \ tests/test_voice_attention.py \ tests/test_turn_taking.py \ tests/test_tools_services.py -k "system_status or scorecard or identity"}
run_fast() { uv run pytest -q \ tests/test_brain.py -k "interaction_contract or response_mode or confidence" \ tests/test_presence.py -k "choreography or muted" \ tests/test_tools_services.py -k "system_status_contract_reports_expected_fields"}
uv run ruff check src tests
case "$profile" in fast) run_fast ;; full) run_core ;; *) echo "Unknown profile: $profile (expected: fast|full)" >&2 exit 2 ;;esac
echo "Release acceptance suite passed ($profile)."123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475#!/usr/bin/env python3from __future__ import annotations
import argparseimport jsonfrom pathlib import Pathfrom typing import Any
def _as_list(value: Any) -> list[str]: if isinstance(value, list): return [str(item) for item in value if str(item).strip()] if isinstance(value, str) and value.strip(): return [value.strip()] return []
def _evaluate_case(case: dict[str, Any]) -> dict[str, Any]: case_id = str(case.get("id", "case")) actual_response = str(case.get("actual_response", "")) actual_tools = {str(item) for item in _as_list(case.get("actual_tools"))} expected_contains = _as_list(case.get("expected_contains")) expected_tools = {str(item) for item in _as_list(case.get("expected_tools"))}
missing_text = [needle for needle in expected_contains if needle not in actual_response] missing_tools = sorted(expected_tools - actual_tools) passed = not missing_text and not missing_tools
return { "id": case_id, "passed": passed, "missing_text": missing_text, "missing_tools": missing_tools, }
def main() -> int: parser = argparse.ArgumentParser(description="Run deterministic evaluation dataset checks.") parser.add_argument("dataset", help="Path to dataset JSON") parser.add_argument("--output", default="") parser.add_argument("--strict", action="store_true") args = parser.parse_args()
dataset_path = Path(args.dataset) payload = json.loads(dataset_path.read_text(encoding="utf-8")) cases = payload.get("cases", []) if isinstance(payload, dict) else [] if not isinstance(cases, list): raise SystemExit("Dataset format error: expected top-level object with 'cases' list.")
results = [_evaluate_case(case) for case in cases if isinstance(case, dict)] passed = sum(1 for row in results if row["passed"]) failed = len(results) - passed summary = { "dataset": str(dataset_path), "strict": bool(args.strict), "case_count": len(results), "passed": passed, "failed": failed, "pass_rate": (passed / len(results)) if results else 0.0, "accepted": (failed == 0) if args.strict else (passed >= failed), "results": results, }
text = json.dumps(summary, indent=2) print(text) if args.output: out_path = Path(args.output) out_path.parent.mkdir(parents=True, exist_ok=True) out_path.write_text(text, encoding="utf-8")
return 0 if summary["accepted"] else 1
if __name__ == "__main__": raise SystemExit(main())268 unmodified lines269270271272273274268 unmodified lines"mcp__jarvis-services__skills_enable","mcp__jarvis-services__skills_disable","mcp__jarvis-services__skills_version",],self._config.tool_allowlist,self._config.tool_denylist,268 unmodified lines269270271272273274275276277278279280281282283268 unmodified lines"mcp__jarvis-services__skills_enable","mcp__jarvis-services__skills_disable","mcp__jarvis-services__skills_version","mcp__jarvis-services__proactive_assistant","mcp__jarvis-services__memory_governance","mcp__jarvis-services__identity_trust","mcp__jarvis-services__home_orchestrator","mcp__jarvis-services__skills_governance","mcp__jarvis-services__planner_engine","mcp__jarvis-services__quality_evaluator","mcp__jarvis-services__embodiment_presence","mcp__jarvis-services__integration_hub",],self._config.tool_allowlist,self._config.tool_denylist,
3148 unmodified lines314931503151315231533154315593 unmodified lines3249325032513252325332542 unmodified lines325732583259326032613262326372 unmodified lines333633373338333933403341411 unmodified lines375337543755375637573758199 unmodified lines3958395939603148 unmodified linesresult = await services.system_status({})payload = json.loads(result["content"][0]["text"])assert payload["schema_version"] == "1.8"assert "local_time" in payloadassert "tool_policy" in payloadassert isinstance(payload["tool_policy"]["home_require_confirm_execute"], bool)93 unmodified linesassert "failed_count" in payload["dead_letter_queue"]assert "replayed_count" in payload["dead_letter_queue"]assert isinstance(payload["dead_letter_queue"]["recent"], list)assert payload["health"]["health_level"] in {"ok", "degraded", "error"}@pytest.mark.asyncio2 unmodified linesresult = await services.system_status_contract({})payload = json.loads(result["content"][0]["text"])assert payload["schema_version"] == "1.8"assert "top_level_required" in payloadassert "tool_policy" in payload["top_level_required"]assert "identity" in payload["top_level_required"]72 unmodified linesassert "dead_letter_queue" in payload["top_level_required"]assert "dead_letter_queue_required" in payloadassert "pending_count" in payload["dead_letter_queue_required"]@pytest.mark.asyncioasync def test_jarvis_scorecard_reports_unified_dimensions(self, tmp_path):411 unmodified linesassert schemas["webhook_inbound_list"]["properties"]["limit"]["type"] == "integer"assert schemas["tool_summary"]["properties"]["limit"]["type"] == "integer"assert schemas["tool_summary_text"]["properties"]["limit"]["type"] == "integer"def test_service_schema_identity_fields_present_for_mutating_tools(self):from jarvis.tools import services199 unmodified linesassert payload["nested"]["api_key"] == "***REDACTED***"assert payload["nested"]["safe"].endswith("...<truncated>")assert payload["items"][-1].startswith("<truncated_items:")3148 unmodified lines314931503151315231533154315593 unmodified lines32493250325132523253325432553256325732582 unmodified lines326132623263326432653266326772 unmodified lines334033413342334333443345334633473348411 unmodified lines37603761376237633764376537663767376837693770199 unmodified lines397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040913148 unmodified linesresult = await services.system_status({})payload = json.loads(result["content"][0]["text"])assert payload["schema_version"] == "2.0"assert "local_time" in payloadassert "tool_policy" in payloadassert isinstance(payload["tool_policy"]["home_require_confirm_execute"], bool)93 unmodified linesassert "failed_count" in payload["dead_letter_queue"]assert "replayed_count" in payload["dead_letter_queue"]assert isinstance(payload["dead_letter_queue"]["recent"], list)assert "expansion" in payloadassert "proactive" in payload["expansion"]assert "planner_engine" in payload["expansion"]assert "integration_hub" in payload["expansion"]assert payload["health"]["health_level"] in {"ok", "degraded", "error"}@pytest.mark.asyncio2 unmodified linesresult = await services.system_status_contract({})payload = json.loads(result["content"][0]["text"])assert payload["schema_version"] == "2.0"assert "top_level_required" in payloadassert "tool_policy" in payload["top_level_required"]assert "identity" in payload["top_level_required"]72 unmodified linesassert "dead_letter_queue" in payload["top_level_required"]assert "dead_letter_queue_required" in payloadassert "pending_count" in payload["dead_letter_queue_required"]assert "expansion" in payload["top_level_required"]assert "expansion_required" in payloadassert "proactive" in payload["expansion_required"]@pytest.mark.asyncioasync def test_jarvis_scorecard_reports_unified_dimensions(self, tmp_path):411 unmodified linesassert schemas["webhook_inbound_list"]["properties"]["limit"]["type"] == "integer"assert schemas["tool_summary"]["properties"]["limit"]["type"] == "integer"assert schemas["tool_summary_text"]["properties"]["limit"]["type"] == "integer"assert schemas["proactive_assistant"]["properties"]["snooze_minutes"]["type"] == "integer"assert schemas["memory_governance"]["properties"]["limit"]["type"] == "integer"assert schemas["skills_governance"]["properties"]["rate_per_min"]["type"] == "integer"assert schemas["planner_engine"]["properties"]["limit"]["type"] == "integer"assert schemas["quality_evaluator"]["properties"]["limit"]["type"] == "integer"def test_service_schema_identity_fields_present_for_mutating_tools(self):from jarvis.tools import services199 unmodified linesassert payload["nested"]["api_key"] == "***REDACTED***"assert payload["nested"]["safe"].endswith("...<truncated>")assert payload["items"][-1].startswith("<truncated_items:")@pytest.mark.asyncioasync def test_expansion_tools_basic_actions(self, tmp_path):from jarvis.tools import servicesproactive = await services.proactive_assistant({"action": "briefing", "mode": "morning"})proactive_payload = json.loads(proactive["content"][0]["text"])assert proactive_payload["action"] == "briefing"memory_partition = await services.memory_governance({"action": "partition", "user": "owner", "shared_scopes": ["preferences"]})memory_payload = json.loads(memory_partition["content"][0]["text"])assert memory_payload["action"] == "partition"assert memory_payload["overlay"]["user"] == "owner"trust_policy = await services.identity_trust({"action": "policy_set", "domain": "locks", "required_profile": "trusted", "requires_step_up": True})trust_payload = json.loads(trust_policy["content"][0]["text"])assert trust_payload["policy"]["required_profile"] == "trusted"home_plan = await services.home_orchestrator({"action": "plan", "request_text": "activate movie mode"})home_payload = json.loads(home_plan["content"][0]["text"])assert home_payload["plan_label"] == "movie_mode"assert home_payload["step_count"] >= 1skills_negotiation = await services.skills_governance({"action": "negotiate", "requested_capabilities": ["forecast"]})skills_payload = json.loads(skills_negotiation["content"][0]["text"])assert skills_payload["action"] == "negotiate"planner = await services.planner_engine({"action": "plan", "goal": "prepare evening routine"})planner_payload = json.loads(planner["content"][0]["text"])assert planner_payload["action"] == "plan"assert "planner" in planner_payloadreport_path = tmp_path / "quality.json"quality = await services.quality_evaluator({"action": "weekly_report", "report_path": str(report_path)})quality_payload = json.loads(quality["content"][0]["text"])assert quality_payload["action"] == "weekly_report"assert Path(quality_payload["artifact_path"]).exists()embodiment = await services.embodiment_presence({"action": "privacy_posture", "state": "muted", "reason": "sensitive_operation"})embodiment_payload = json.loads(embodiment["content"][0]["text"])assert embodiment_payload["privacy_posture"]["state"] == "muted"integration = await services.integration_hub({"action": "notes_capture", "backend": "local_markdown", "title": "Test", "content": "hello"})integration_payload = json.loads(integration["content"][0]["text"])assert integration_payload["stored"] is Trueassert Path(integration_payload["path"]).exists()@pytest.mark.asyncioasync def test_identity_guest_session_capability_enforced(self):from jarvis.tools import servicesguest = await services.identity_trust({"action": "guest_start", "guest_id": "visitor", "capabilities": ["system_status"]})guest_payload = json.loads(guest["content"][0]["text"])token = guest_payload["token"]denied = await services.smart_home({"domain": "light","action": "turn_on","entity_id": "light.living_room","dry_run": True,"guest_session_token": token,})assert "guest session does not allow" in denied["content"][0]["text"].lower()@pytest.mark.asyncioasync def test_home_orchestrator_area_policy_surfaces_partial_failures(self):from jarvis.tools import servicesawait services.home_orchestrator({"action": "area_policy_set","area": "bedroom","policy": {"quiet_hours_start": "22:00","quiet_hours_end": "07:00","blocked_actions": ["media_player:media_play"],},})result = await services.home_orchestrator({"action": "execute","actions": [{"domain": "media_player", "action": "media_play", "entity_id": "media_player.bedroom_speaker"},{"domain": "light", "action": "turn_on", "entity_id": "light.kitchen"},],})payload = json.loads(result["content"][0]["text"])assert payload["partial_failure"] is Trueassert payload["failed_count"] == 1def test_release_scripts_and_workflows_exist(self):project_root = Path(__file__).resolve().parents[1]assert (project_root / "scripts" / "bootstrap.sh").exists()assert (project_root / "scripts" / "generate_quality_report.py").exists()assert (project_root / "scripts" / "run_eval_dataset.py").exists()assert (project_root / "scripts" / "release_acceptance.sh").exists()assert (project_root / "scripts" / "check_release_channel.py").exists()assert (project_root / ".github" / "workflows" / "assistant-quality-report.yml").exists()assert (project_root / ".github" / "workflows" / "release-acceptance.yml").exists()makefile_text = (project_root / "Makefile").read_text()assert "quality-report" in makefile_textassert "eval-dataset" in makefile_textassert "release-acceptance" in makefile_text
.github/workflows/assistant-quality-report.ymlAdded+46
.github/workflows/release-acceptance.ymlAdded+41
.gitignore+3
DockerfileAdded+21
Makefile+17-1
README.md+26
TODO.md+44-44
config/release-channels.jsonAdded+27
deploy/home-assistant-addon/DockerfileAdded+15
deploy/home-assistant-addon/README.mdAdded+16
deploy/home-assistant-addon/config.yamlAdded+25
docker-compose.ymlAdded+15
docs/evals/assistant-contract.jsonAdded+18
scripts/bootstrap.shAdded+43
scripts/check_release_channel.pyAdded+66
scripts/generate_quality_report.pyAdded+112
scripts/release_acceptance.shAdded+37
scripts/run_eval_dataset.pyAdded+75
src/jarvis/brain.py+9
src/jarvis/tools/services.py
tests/test_tools_services.py+133-2