tina-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. tina_cli-0.1.0/.env.example +23 -0
  2. tina_cli-0.1.0/.github/workflows/ci.yml +37 -0
  3. tina_cli-0.1.0/.github/workflows/pr-title.yml +15 -0
  4. tina_cli-0.1.0/.github/workflows/release-please.yml +27 -0
  5. tina_cli-0.1.0/.github/workflows/release.yml +53 -0
  6. tina_cli-0.1.0/.gitignore +25 -0
  7. tina_cli-0.1.0/.release-please-manifest.json +3 -0
  8. tina_cli-0.1.0/AGENTS.md +80 -0
  9. tina_cli-0.1.0/CHANGELOG.md +45 -0
  10. tina_cli-0.1.0/CLAUDE.md +1 -0
  11. tina_cli-0.1.0/CONTRIBUTING.md +171 -0
  12. tina_cli-0.1.0/Dockerfile.reference +55 -0
  13. tina_cli-0.1.0/LICENSE +21 -0
  14. tina_cli-0.1.0/PKG-INFO +112 -0
  15. tina_cli-0.1.0/README.md +97 -0
  16. tina_cli-0.1.0/demo/README.md +54 -0
  17. tina_cli-0.1.0/demo/activities/triage/SKILL.md +8 -0
  18. tina_cli-0.1.0/demo/agent.py +57 -0
  19. tina_cli-0.1.0/demo/demo.sh +36 -0
  20. tina_cli-0.1.0/demo/record.sh +98 -0
  21. tina_cli-0.1.0/demo/stub_server.py +127 -0
  22. tina_cli-0.1.0/demo/tina.toml +20 -0
  23. tina_cli-0.1.0/docs/adr/000-adr-template.md +17 -0
  24. tina_cli-0.1.0/docs/adr/001-orchestration-only-factory.md +36 -0
  25. tina_cli-0.1.0/docs/adr/002-no-scheduling-ownership.md +35 -0
  26. tina_cli-0.1.0/docs/adr/003-dispatch-worker-split.md +43 -0
  27. tina_cli-0.1.0/docs/adr/004-worker-side-claiming.md +46 -0
  28. tina_cli-0.1.0/docs/adr/005-harness-adapters-declarative-outcome-file.md +47 -0
  29. tina_cli-0.1.0/docs/adr/006-four-state-outcome-contract.md +43 -0
  30. tina_cli-0.1.0/docs/adr/007-generic-artifact-verification.md +37 -0
  31. tina_cli-0.1.0/docs/adr/008-activities-installed-via-napoln.md +37 -0
  32. tina_cli-0.1.0/docs/adr/009-python.md +26 -0
  33. tina_cli-0.1.0/docs/adr/010-two-implementations-per-adapter-family.md +39 -0
  34. tina_cli-0.1.0/docs/architecture.md +461 -0
  35. tina_cli-0.1.0/examples/tina.toml +35 -0
  36. tina_cli-0.1.0/justfile +53 -0
  37. tina_cli-0.1.0/pyproject.toml +49 -0
  38. tina_cli-0.1.0/release-please-config.json +12 -0
  39. tina_cli-0.1.0/src/tina/__init__.py +23 -0
  40. tina_cli-0.1.0/src/tina/__main__.py +11 -0
  41. tina_cli-0.1.0/src/tina/cli.py +254 -0
  42. tina_cli-0.1.0/src/tina/config.py +284 -0
  43. tina_cli-0.1.0/src/tina/errors.py +25 -0
  44. tina_cli-0.1.0/src/tina/executors/__init__.py +22 -0
  45. tina_cli-0.1.0/src/tina/executors/base.py +20 -0
  46. tina_cli-0.1.0/src/tina/executors/cloudrun.py +86 -0
  47. tina_cli-0.1.0/src/tina/executors/local.py +47 -0
  48. tina_cli-0.1.0/src/tina/harness.py +115 -0
  49. tina_cli-0.1.0/src/tina/log.py +45 -0
  50. tina_cli-0.1.0/src/tina/models.py +90 -0
  51. tina_cli-0.1.0/src/tina/output.py +51 -0
  52. tina_cli-0.1.0/src/tina/prompt.py +86 -0
  53. tina_cli-0.1.0/src/tina/sources/__init__.py +21 -0
  54. tina_cli-0.1.0/src/tina/sources/base.py +68 -0
  55. tina_cli-0.1.0/src/tina/sources/github.py +154 -0
  56. tina_cli-0.1.0/src/tina/sources/jira.py +171 -0
  57. tina_cli-0.1.0/src/tina/verify.py +92 -0
  58. tina_cli-0.1.0/tests/conftest.py +47 -0
  59. tina_cli-0.1.0/tests/integration/test_cli.py +585 -0
  60. tina_cli-0.1.0/tests/unit/test_config.py +177 -0
  61. tina_cli-0.1.0/tests/unit/test_errors.py +40 -0
  62. tina_cli-0.1.0/tests/unit/test_executors.py +79 -0
  63. tina_cli-0.1.0/tests/unit/test_harness.py +131 -0
  64. tina_cli-0.1.0/tests/unit/test_output.py +115 -0
  65. tina_cli-0.1.0/tests/unit/test_prompt.py +49 -0
  66. tina_cli-0.1.0/tests/unit/test_sources_github.py +145 -0
  67. tina_cli-0.1.0/tests/unit/test_sources_jira.py +169 -0
  68. tina_cli-0.1.0/tests/unit/test_verify.py +136 -0
  69. tina_cli-0.1.0/tests/unit/test_version.py +55 -0
  70. tina_cli-0.1.0/tina-demo.gif +0 -0
  71. tina_cli-0.1.0/uv.lock +906 -0
@@ -0,0 +1,23 @@
1
+ # Tina reads credentials from the environment. Only the adapters a workflow
2
+ # actually uses need to be populated.
3
+
4
+ # --- Jira source (source = "jira") ---------------------------------------
5
+ JIRA_BASE_URL=https://your-org.atlassian.net
6
+ JIRA_EMAIL=bot@your-org.example
7
+ JIRA_API_TOKEN=
8
+ # Atlassian account id of the bot user. Claiming assigns the issue to it.
9
+ JIRA_BOT_ACCOUNT_ID=
10
+
11
+ # --- GitHub Issues source (source = "github") ----------------------------
12
+ # Needs repo scope: read issues, assign issues.
13
+ GITHUB_TOKEN=
14
+ # Login of the bot user. Optional — looked up via GET /user when unset.
15
+ GITHUB_BOT_LOGIN=
16
+
17
+ # --- Harness -------------------------------------------------------------
18
+ # Seconds before Tina kills the agent subprocess. Default 3600.
19
+ TINA_HARNESS_TIMEOUT=3600
20
+
21
+ # Credentials the *agent* needs to do the work (open PRs, write Confluence,
22
+ # ...) also live here. Tina does not read them; it only passes the environment
23
+ # through to the harness subprocess, and reuses them for artifact verification.
@@ -0,0 +1,37 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ check:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v5
20
+ with:
21
+ enable-cache: true
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install just
25
+ uses: extractions/setup-just@v2
26
+
27
+ - name: Install dependencies
28
+ run: just setup
29
+
30
+ - name: Show interpreter
31
+ run: uv run python -V
32
+
33
+ - name: Check
34
+ run: just check
35
+
36
+ - name: Build
37
+ run: just build
@@ -0,0 +1,15 @@
1
+ name: PR Title
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, edited, synchronize, reopened]
6
+
7
+ jobs:
8
+ validate:
9
+ permissions:
10
+ pull-requests: read
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
14
+ env:
15
+ GITHUB_TOKEN: ${{ github.token }}
@@ -0,0 +1,27 @@
1
+ name: Release Please
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ actions: write
10
+ contents: write
11
+ pull-requests: write
12
+
13
+ jobs:
14
+ release-please:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: googleapis/release-please-action@v4
18
+ id: release-please
19
+ with:
20
+ config-file: release-please-config.json
21
+ manifest-file: .release-please-manifest.json
22
+
23
+ - name: Dispatch release build
24
+ if: ${{ steps.release-please.outputs.releases_created == 'true' }}
25
+ env:
26
+ GH_TOKEN: ${{ github.token }}
27
+ run: gh workflow run release.yml --repo ${{ github.repository }} -f tag=${{ steps.release-please.outputs.tag_name }}
@@ -0,0 +1,53 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ['v*']
6
+ workflow_dispatch:
7
+ inputs:
8
+ tag:
9
+ description: "Git tag to build and release (e.g. v0.1.0)"
10
+ required: true
11
+ type: string
12
+
13
+ permissions:
14
+ contents: write
15
+ id-token: write
16
+
17
+ jobs:
18
+ build:
19
+ name: Build & Publish
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ with:
24
+ ref: ${{ inputs.tag || github.ref_name }}
25
+ - uses: astral-sh/setup-uv@v5
26
+
27
+ - name: Build
28
+ run: uv build
29
+
30
+ - name: Upload artifacts
31
+ uses: actions/upload-artifact@v4
32
+ with:
33
+ name: dist
34
+ path: dist/
35
+
36
+ - name: Publish to PyPI
37
+ run: uv publish --trusted-publishing always
38
+
39
+ release:
40
+ name: GitHub Release
41
+ needs: build
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: actions/download-artifact@v4
45
+ with:
46
+ name: dist
47
+ path: dist/
48
+
49
+ - name: Upload to GitHub Release
50
+ uses: softprops/action-gh-release@v2
51
+ with:
52
+ tag_name: ${{ inputs.tag || github.ref_name }}
53
+ files: dist/*
@@ -0,0 +1,25 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .pytest_cache/
9
+ .ruff_cache/
10
+ .coverage
11
+ .coverage.*
12
+
13
+ # Local environment
14
+ .env
15
+
16
+ # Agents and worktrees
17
+ .claude/
18
+ .worktrees/
19
+
20
+ # IDE
21
+ .idea/
22
+ .vscode/
23
+
24
+ # OS
25
+ .DS_Store
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.0"
3
+ }
@@ -0,0 +1,80 @@
1
+ # Development Rules
2
+
3
+ ## First Message
4
+
5
+ If no concrete task is given, read README.md and docs/architecture.md, then ask
6
+ what to work on.
7
+
8
+ ## Project Overview
9
+
10
+ Tina is an orchestration-only factory: work items in, outcome reports out. It
11
+ claims a work item and calls an agent once with a one-shot prompt; the agent
12
+ does the work. Python 3.12+, uv and just, ruff/ty/pytest. Two roles, one image:
13
+ `tina dispatch` queries and enqueues workers, `tina run` claims one item and
14
+ records its outcome. Two adapter families: `sources/` (work item origins) and
15
+ `executors/` (worker enqueueing). Read [CONTRIBUTING.md](CONTRIBUTING.md) for
16
+ setup, layout, and how to add an adapter.
17
+
18
+ ## The Check Gate
19
+
20
+ - Run `just check` after code changes. Do not claim a change is done, working,
21
+ or ready to commit without a green `just check` in this session. CI runs the
22
+ same command, so a local green is the whole contract.
23
+ - `just fmt` auto-fixes formatting and lint.
24
+ - `just test -k <expr>` narrows while iterating, but a narrowed run is not the
25
+ gate.
26
+
27
+ ## Invariants
28
+
29
+ [docs/architecture.md](docs/architecture.md) and [docs/adr/](docs/adr/) are
30
+ authoritative; each rule below is argued in the record it links.
31
+
32
+ - Tina never parses harness stdout; the agent writes `outcome.json`
33
+ ([005](docs/adr/005-harness-adapters-declarative-outcome-file.md),
34
+ [006](docs/adr/006-four-state-outcome-contract.md)).
35
+ - Orchestration only — Tina never writes a result
36
+ ([001](docs/adr/001-orchestration-only-factory.md)).
37
+ - Claiming is worker-side; the tracker is the ledger
38
+ ([004](docs/adr/004-worker-side-claiming.md)).
39
+ - Every adapter family ships two implementations
40
+ ([010](docs/adr/010-two-implementations-per-adapter-family.md)).
41
+ - A harness is configuration — a `[harnesses.<name>]` block with a `command`,
42
+ not a new module. Do not add a harness adapter class (§12 of
43
+ [docs/architecture.md](docs/architecture.md)).
44
+
45
+ ## Commits
46
+
47
+ - Use [Conventional Commits](https://www.conventionalcommits.org/).
48
+ release-please reads the history, so a non-conforming subject silently drops
49
+ out of the changelog. Examples are in [CONTRIBUTING.md](CONTRIBUTING.md).
50
+ - NEVER add `Co-Authored-By` or any other AI-attribution trailer.
51
+ - Work lands directly on `main` — no fork, no feature branch, no review step.
52
+ Do not open a pull request or create a branch for this repo unless asked.
53
+
54
+ ## Tests
55
+
56
+ - The autouse `clean_env` fixture in `tests/conftest.py` deletes real adapter
57
+ credentials from the environment. A test that fails on a missing credential
58
+ is correct behavior: set it with `monkeypatch.setenv`. Never weaken, opt out
59
+ of, or delete `clean_env`, or export real credentials to make a test pass.
60
+ - A new credential variable must be added to `clean_env`'s tuple.
61
+ - No test touches the network. Fake HTTP through the `make_client` fixture
62
+ (`httpx.MockTransport`). Do not add `pytest-httpx`, `responses`, `vcr`, or
63
+ live-network tests.
64
+ - Unit tests (one file per module) go in `tests/unit/`; tests that drive the
65
+ full CLI stack go in `tests/integration/`. There is no `tests/fixtures/`.
66
+
67
+ ## Real Trackers
68
+
69
+ `tina dispatch` and `tina run` with real `JIRA_*` or `GITHUB_*` credentials
70
+ claim live work items and comment on real issues. Never run either against a
71
+ real tracker without explicit instruction; see [.env.example](.env.example).
72
+
73
+ ## Style
74
+
75
+ - Concise answers, no filler.
76
+ - Neutral technical voice in documentation: no editorializing, no first-person
77
+ plural.
78
+ - No emojis in commits, docs, or code.
79
+ - Use the read tool to examine files, not `cat` or `sed`; read fully before
80
+ editing.
@@ -0,0 +1,45 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 (2026-07-29)
4
+
5
+
6
+ ### Features
7
+
8
+ * add config, outcome models, and structured logging ([a8ed1b3](https://github.com/raiderrobert/tina/commit/a8ed1b3534cead7888c6440a3572ed4bd17bf850))
9
+ * add dispatch and run entrypoints ([76d9681](https://github.com/raiderrobert/tina/commit/76d9681a0c5ce7925f37d547cd1dad021011c4a5))
10
+ * add jira and github issue source adapters ([732c4ff](https://github.com/raiderrobert/tina/commit/732c4ff26784b2fdf7d65003b8b6e02f9b20c33e))
11
+ * add local and cloudrun executors ([db4388e](https://github.com/raiderrobert/tina/commit/db4388e0e44c8eb112b098bb223acb36f71f3900))
12
+ * assemble one-shot prompts and invoke the agent harness ([3e34ea4](https://github.com/raiderrobert/tina/commit/3e34ea4625f71f33e0e7ca7fa6c52d827bc17127))
13
+ * **cli:** add --dry-run to dispatch ([04a4847](https://github.com/raiderrobert/tina/commit/04a484783db03049bd52394a02b5bce59ed144c9)), closes [#11](https://github.com/raiderrobert/tina/issues/11)
14
+ * **cli:** add a --version flag ([55a2190](https://github.com/raiderrobert/tina/commit/55a2190b5ee4c857d616114fe4e39db1c0a1e9e8)), closes [#4](https://github.com/raiderrobert/tina/issues/4)
15
+ * **errors:** carry cause and fix, and render them on stderr ([6c86256](https://github.com/raiderrobert/tina/commit/6c8625684cf57b56700743fc05276c45c98f8ebd)), closes [#10](https://github.com/raiderrobert/tina/issues/10)
16
+ * verify declared artifacts exist ([10cf137](https://github.com/raiderrobert/tina/commit/10cf13735d73881863244bcbefb17553eec15ea2))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **tests:** strip ANSI styling before asserting on help output ([4598322](https://github.com/raiderrobert/tina/commit/459832265b94cc779abe94d117783f41a972b639)), closes [#4](https://github.com/raiderrobert/tina/issues/4)
22
+
23
+
24
+ ### Documentation
25
+
26
+ * add a terminal demo recording to the README ([39a09fa](https://github.com/raiderrobert/tina/commit/39a09fa07dcdbe5c7d84c386e3d83d138c78b4ba)), closes [#15](https://github.com/raiderrobert/tina/issues/15)
27
+ * add ADRs for factory architecture decisions ([6999f8b](https://github.com/raiderrobert/tina/commit/6999f8b0ac5348d459a65f7908e65792a6b6ffb3))
28
+ * add AGENTS.md with CLAUDE.md symlinked to it ([cd7e2a3](https://github.com/raiderrobert/tina/commit/cd7e2a3511ddd1fcb730da836d160a9ed79177c1)), closes [#8](https://github.com/raiderrobert/tina/issues/8)
29
+ * add CONTRIBUTING.md and cross-link it from the README ([0f36362](https://github.com/raiderrobert/tina/commit/0f363620985b38f2b580f802f07827a82e84368d)), closes [#5](https://github.com/raiderrobert/tina/issues/5)
30
+ * add project README ([d61dc3d](https://github.com/raiderrobert/tina/commit/d61dc3de74e7c446af026681f10117e475bb2f76))
31
+ * align config examples with implemented schema ([f01efa4](https://github.com/raiderrobert/tina/commit/f01efa488d138805536943bd71ac620f2391d691))
32
+ * autonomous factory architecture ([94cbfa1](https://github.com/raiderrobert/tina/commit/94cbfa10e5711e48026af0e86e843be714315f91))
33
+ * autonomous loop design document ([d38117a](https://github.com/raiderrobert/tina/commit/d38117a6bf7ee0c69daa5de69cabe99912151498))
34
+ * correct the type-check command to ty ([71a3c36](https://github.com/raiderrobert/tina/commit/71a3c3632cd53f8da36cf634dbcd94237389e004))
35
+ * initial architecture, type reference, and ADRs ([0967ab3](https://github.com/raiderrobert/tina/commit/0967ab3769c04547eecf5c4c98187e6ec14be1a9))
36
+ * lead README example with the github bug workflow ([b578c64](https://github.com/raiderrobert/tina/commit/b578c647d0c3578b3a187b24503758b253064606))
37
+ * remove Jira/GitHub as baked-in sources and tools ([9cba852](https://github.com/raiderrobert/tina/commit/9cba852d2a63498a981d2b54ba99a05e0224fccb))
38
+ * replace toolkit design with autonomous factory architecture ([4147996](https://github.com/raiderrobert/tina/commit/4147996321762257b61d63b81b70659ff28a054c))
39
+ * rewrite README to match pi mono repo style ([4121177](https://github.com/raiderrobert/tina/commit/4121177d78ce504fba89ce1c4be49211b2b005d9))
40
+ * swap Tina quote ([12a759c](https://github.com/raiderrobert/tina/commit/12a759c3bf8a9f17f6913f519062b8abe474bf89))
41
+
42
+
43
+ ### Continuous Integration
44
+
45
+ * add release automation with release-please and PyPI trusted publishing ([bef3a5d](https://github.com/raiderrobert/tina/commit/bef3a5d1c78605b3b3d1eaffc63b85ffa4ebb150)), closes [#2](https://github.com/raiderrobert/tina/issues/2)
@@ -0,0 +1 @@
1
+ AGENTS.md
@@ -0,0 +1,171 @@
1
+ # Contributing to Tina
2
+
3
+ ## Setup
4
+
5
+ Requires Python 3.12+, [uv](https://docs.astral.sh/uv/), and
6
+ [just](https://github.com/casey/just).
7
+
8
+ ```bash
9
+ brew install uv # or: curl -LsSf https://astral.sh/uv/install.sh | sh
10
+ brew install just
11
+ ```
12
+
13
+ ```bash
14
+ git clone git@github.com:raiderrobert/tina.git
15
+ cd tina
16
+ just setup
17
+ ```
18
+
19
+ `just setup` runs `uv sync --all-extras`. All extras, not just the dev group:
20
+ `just types` needs the `cloudrun` extra resolvable, or `ty` reports an
21
+ unresolved import on `from google.cloud import run_v2` in
22
+ `src/tina/executors/cloudrun.py`.
23
+
24
+ Running Tina by hand needs adapter credentials in the environment. See
25
+ [.env.example](.env.example).
26
+
27
+ ## The check loop
28
+
29
+ Run `just check` before every commit. It is the gate CI runs —
30
+ `.github/workflows/ci.yml` calls `just setup`, then `just check`, then
31
+ `just build`, on a 3.12/3.13 matrix.
32
+
33
+ `just check` runs four recipes in order:
34
+
35
+ | Recipe | Command |
36
+ |--------|---------|
37
+ | `fmt-check` | `uv run ruff format --check` |
38
+ | `lint` | `uv run ruff check` |
39
+ | `types` | `uv run ty check` |
40
+ | `test` | `uv run pytest` |
41
+
42
+ ```bash
43
+ just fmt # auto-fix: ruff format, then ruff check --fix
44
+ just test -k jira # arguments pass through to pytest
45
+ just test -x
46
+ just coverage # test run with a coverage report
47
+ ```
48
+
49
+ Also `just build` (`uv build`) and `just clean` (remove build artifacts and
50
+ caches). `just` with no recipe lists them all.
51
+
52
+ ## Project layout
53
+
54
+ ```
55
+ src/tina/
56
+ ├── cli.py # `tina dispatch` and `tina run` — two roles, one image
57
+ ├── __main__.py # `python -m tina`, how the local executor spawns workers
58
+ ├── config.py # TOML configuration
59
+ ├── models.py # Work items in, outcome reports out
60
+ ├── prompt.py # One-shot prompt assembly
61
+ ├── harness.py # Harness invocation
62
+ ├── verify.py # Generic artifact verification
63
+ ├── log.py # Structured logging, one JSON object per line
64
+ ├── errors.py # TinaError — the one thing the CLI catches
65
+ ├── sources/ # Where work items come from, and how they get claimed
66
+ │ ├── base.py # Source protocol, require_env, parse_payload
67
+ │ ├── jira.py
68
+ │ └── github.py
69
+ └── executors/ # How the dispatcher enqueues workers
70
+ ├── base.py # Executor protocol
71
+ ├── local.py
72
+ └── cloudrun.py
73
+
74
+ tests/ # conftest.py + unit/ (per-module) + integration/ (through the CLI)
75
+ docs/architecture.md # System design
76
+ docs/adr/ # Architecture decision records
77
+ examples/tina.toml # Worked configuration
78
+ Dockerfile.reference # Reference consumer image; documentation, not a build
79
+ justfile # Every check, in one place
80
+ ```
81
+
82
+ ## Adding a source adapter
83
+
84
+ 1. Implement the `Source` protocol in `src/tina/sources/base.py` — `query`,
85
+ `get`, `claim`. Use `require_env` and `parse_payload` from the same module
86
+ for credentials and response validation.
87
+ 2. Register it in the `build()` dispatch in `src/tina/sources/__init__.py`.
88
+ 3. Add `tests/unit/test_sources_<name>.py`, modeled on `test_sources_jira.py` and
89
+ `test_sources_github.py`.
90
+
91
+ `JiraSource` and `GitHubSource` are the templates. Copy their shape.
92
+
93
+ ## Adding an executor
94
+
95
+ 1. Implement the `Executor` protocol in `src/tina/executors/base.py` —
96
+ `enqueue`.
97
+ 2. Register it in `build()` in `src/tina/executors/__init__.py`.
98
+ 3. Add cases to `tests/unit/test_executors.py`, modeled on the existing `local` and
99
+ `cloudrun` tests.
100
+
101
+ `LocalExecutor` and `CloudRunExecutor` are the templates.
102
+
103
+ A harness is not an adapter in this sense: harnesses are configured, not coded.
104
+ A new one is a `[harnesses.<name>]` block with a `command`, not a new module
105
+ (§12 of [docs/architecture.md](docs/architecture.md)).
106
+
107
+ ## Tests
108
+
109
+ No test touches the network. HTTP is faked with `httpx.MockTransport` through
110
+ the `make_client` fixture in `tests/conftest.py`.
111
+
112
+ The autouse `clean_env` fixture strips real credentials from the environment. A
113
+ test that needs a credential sets it with `monkeypatch.setenv`, and a new
114
+ credential variable gets added to `clean_env`'s list.
115
+
116
+ `work_item` is the shared `WorkItem` sample.
117
+
118
+ `tests/unit/` holds one `test_*.py` per module. `tests/integration/` holds
119
+ tests that drive tina through the composition seam — a real on-disk config,
120
+ source, prompt, harness subprocess, and verification in one run. Shared
121
+ fixtures stay in `tests/conftest.py`.
122
+
123
+ There is no `tests/fixtures/` directory. Tests generate the configuration they
124
+ need per case — each `tina.toml` variant *is* the assertion — so a committed
125
+ file would only put the input a directory away from the test that explains it.
126
+
127
+ ## Commits
128
+
129
+ Use [Conventional Commits](https://www.conventionalcommits.org/).
130
+ release-please reads commit history to compute the version and generate the
131
+ changelog (`.github/workflows/release-please.yml`,
132
+ `release-please-config.json`); a non-conforming commit silently drops out of
133
+ the release notes.
134
+
135
+ ```
136
+ feat(cli): add a --version flag
137
+ fix(tests): strip ANSI styling before asserting on help output
138
+ chore: add a justfile as the single source of truth for checks
139
+ docs: lead README example with the github bug workflow
140
+ ci: run checks on a 3.12/3.13 matrix and make ty blocking
141
+ refactor: validate boundaries with pydantic models
142
+ ```
143
+
144
+ Never add `Co-Authored-By` or any other AI-attribution trailer to a commit.
145
+
146
+ Work lands directly on `main`. There is no fork, feature branch, or review
147
+ step. `just check` green is the gate.
148
+
149
+ ## Design decisions
150
+
151
+ [docs/architecture.md](docs/architecture.md) and [docs/adr/](docs/adr/) are
152
+ authoritative. Read them before proposing a structural change.
153
+
154
+ Invariants a change must not break, each with the record that argues it:
155
+
156
+ | Invariant | ADR |
157
+ |-----------|-----|
158
+ | Orchestration only — Tina never writes a result | [001](docs/adr/001-orchestration-only-factory.md) |
159
+ | Tina does not own scheduling | [002](docs/adr/002-no-scheduling-ownership.md) |
160
+ | Dispatch and worker are separate roles | [003](docs/adr/003-dispatch-worker-split.md) |
161
+ | Claiming is worker-side; the tracker is the ledger | [004](docs/adr/004-worker-side-claiming.md) |
162
+ | Tina never parses harness stdout — the agent writes `outcome.json` | [005](docs/adr/005-harness-adapters-declarative-outcome-file.md), [006](docs/adr/006-four-state-outcome-contract.md) |
163
+ | Every adapter family ships two implementations | [010](docs/adr/010-two-implementations-per-adapter-family.md) |
164
+
165
+ New ADRs copy [docs/adr/000-adr-template.md](docs/adr/000-adr-template.md) and
166
+ are numbered sequentially.
167
+
168
+ ## License
169
+
170
+ By contributing, you agree that your contributions are licensed under the
171
+ [MIT License](LICENSE).
@@ -0,0 +1,55 @@
1
+ # Reference image for a Tina consumer repo. Documentation, not a working build:
2
+ # it is deliberately not buildable as-is, because the parts that vary per
3
+ # company — which harness, which activities, which credentials — are the parts
4
+ # you have to fill in.
5
+ #
6
+ # Copy this into your own private repo, replace the marked lines, and build.
7
+ #
8
+ # One image serves both roles. The dispatcher and the worker are the same
9
+ # binary with different args:
10
+ #
11
+ # tina dispatch --workflow vul --limit 5
12
+ # tina run --workflow vul --item VUL-123
13
+ #
14
+ # FROM python:3.12-slim
15
+ #
16
+ # # ---------------------------------------------------------------------------
17
+ # # 1. Tina itself.
18
+ # # ---------------------------------------------------------------------------
19
+ # # Add the [cloudrun] extra only if the dispatcher enqueues Cloud Run jobs.
20
+ # RUN pip install --no-cache-dir "tina-cli @ git+https://github.com/raiderrobert/tina@v0.1.0"
21
+ # # RUN pip install --no-cache-dir "tina-cli[cloudrun] @ git+https://github.com/..."
22
+ #
23
+ # # ---------------------------------------------------------------------------
24
+ # # 2. The agent harness. Tina does not ship one — it shells out to whatever the
25
+ # # config names. Install exactly one, and make sure its argv matches the
26
+ # # [harnesses.<name>] command in tina.toml.
27
+ # # ---------------------------------------------------------------------------
28
+ # # RUN pip install --no-cache-dir pi
29
+ # # RUN npm install -g @anthropic-ai/claude-code
30
+ #
31
+ # # ---------------------------------------------------------------------------
32
+ # # 3. Activities. Tina contains no fetching code: skills are installed at build
33
+ # # time with napoln and read off disk at runtime. Versioning, pinning, and
34
+ # # upgrades are napoln's job.
35
+ # # ---------------------------------------------------------------------------
36
+ # COPY napoln.toml ./
37
+ # RUN uvx napoln install --target /app/activities
38
+ #
39
+ # # ---------------------------------------------------------------------------
40
+ # # 4. The tools the agent needs to produce results. Tina never writes a result;
41
+ # # the agent does, with its own tools. This is the container tool surface —
42
+ # # one of Tina's two guardrails — so keep it to what the activities need.
43
+ # # ---------------------------------------------------------------------------
44
+ # # RUN apt-get update && apt-get install -y --no-install-recommends git \
45
+ # # && rm -rf /var/lib/apt/lists/*
46
+ #
47
+ # # ---------------------------------------------------------------------------
48
+ # # 5. Configuration. Credentials come from the environment at run time (see
49
+ # # .env.example) — never bake them into the image.
50
+ # # ---------------------------------------------------------------------------
51
+ # WORKDIR /app
52
+ # COPY tina.toml /app/tina.toml
53
+ #
54
+ # ENTRYPOINT ["tina"]
55
+ # CMD ["dispatch", "--workflow", "vul", "--limit", "5"]
tina_cli-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Robert Roskam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.