change: Implement 7: Document the tool-calling contract, statuses, exit codes and native-process usage #17

Merged
ai-reviewer merged 1 commits from change/9-implement-7-document-the-tool-calling-contract-statuses-exit-c into task/1-task 2026-11-03 02:43:42 +00:00
Member

Rewrote README.md as the delivered tool-calling contract for the calling AI agent and added tests/test_readme.py to keep it synchronized with the implementation.

README.md now documents:

  • Native-process usage only: python -m tools.example with no Docker, container image or packaging stage, Python >= 3.11, no runtime third-party dependencies.
  • Every parameter exactly as produced by --help: positional REQUEST.json, -t/--topic, --width, --height, -f/--format (png|ico), -s/--source (default wikimedia_commons), -c/--count (1-50, default 10), --download, -o/--output-dir, --resize, --dry-run; width/height documented as minimums and the "document XOR flags" rule.
  • The JSON request document form used by examples/input.json: field table, types, defaults, optional version, and the document-level invalid_request rules.
  • The single-document JSON response schema: fixed keys status, source, request, items, error; item fields (actual format/width/height, url/file_url, size_bytes), download record, resize fragment and the verified-save failure record.
  • The fixed status vocabulary with its exit codes: ok=0, dry_run=0, invalid_request=2, no_format=3, no_size=4, access_error=5, partial_download=6, plus why no_match/outage are distinguishable.
  • Approved free sources (wikimedia_commons, openverse) with no API keys, tokens or registration, the approved HTTPS host allowlist, and the registry extension point (SourceAdapter, SourceRegistry.register/unregister, build_registry()/default_registry(), host allowlist extension).
  • Both decided behaviours: --download without --output-dir is an invalid request (invalid_request / exit 2), and partial saves are reported as partial_download (exit 6) with download_incomplete details while saved paths are still reported.
  • The real test entrypoint pytest plus the compileall/help/smoke commands.

tests/test_readme.py asserts the README documents every long option the real parser accepts, the accepted formats, every status with its exit code from STATUS_EXIT_CODES, the response keys, every registered source id, the registry extension names, both product decisions, native-process wording, and the real pytest/compileall/help/smoke commands.

Tests:
Ran the facade check set with .venv/bin on PATH after prepare_environment(component=tools, mode=restore):

  • pytest -q -> 163 passed, 1 skipped (pre-existing tests/test_live_source.py live-network skip: Wikimedia upload host returns HTTP 429 from this sandbox).
  • python -m compileall -q tools tests -> ok.
  • python -m tools.example --help -> exit 0.
  • python -m tools.example examples/input.json -> exit 0, one JSON dry_run envelope.
  • pytest tests/test_readme.py -q -> 5 passed.
    Also confirmed git merge-base --is-ancestor origin/task/1-task HEAD (target branch already integrated, zero diff), so no integration step was required.

Progress:
Delivered the documentation slice for issue 9. README.md was a two-line placeholder; it is now the full tool-calling contract: CLI parameters matching --help output, the JSON request-document form for examples/input.json, the single-document response schema, the fixed status vocabulary with exit codes (ok/dry_run=0, invalid_request=2, no_format=3, no_size=4, access_error=5, partial_download=6), credential-free sources and the registry extension point, the decided --download-without---output-dir invalid-request behaviour, partial_download reporting for incomplete saves, and plain native-process execution with the real pytest entrypoint. Added tests/test_readme.py (5 tests) so CI fails if documentation drifts from build_parser(), STATUS_EXIT_CODES, ACCEPTED_FORMATS or the default registry. No protected facade paths or source behaviour changed; existing obligations preserved (full suite green apart from the pre-existing live-source skip).

Published by developer-agent through Tool Backend.

Closes #9

Rewrote README.md as the delivered tool-calling contract for the calling AI agent and added tests/test_readme.py to keep it synchronized with the implementation. README.md now documents: - Native-process usage only: `python -m tools.example` with no Docker, container image or packaging stage, Python >= 3.11, no runtime third-party dependencies. - Every parameter exactly as produced by `--help`: positional `REQUEST.json`, `-t/--topic`, `--width`, `--height`, `-f/--format` (`png|ico`), `-s/--source` (default `wikimedia_commons`), `-c/--count` (1-50, default 10), `--download`, `-o/--output-dir`, `--resize`, `--dry-run`; width/height documented as minimums and the "document XOR flags" rule. - The JSON request document form used by `examples/input.json`: field table, types, defaults, optional `version`, and the document-level invalid_request rules. - The single-document JSON response schema: fixed keys `status`, `source`, `request`, `items`, `error`; item fields (actual format/width/height, `url`/`file_url`, `size_bytes`), download record, resize fragment and the verified-save failure record. - The fixed status vocabulary with its exit codes: `ok`=0, `dry_run`=0, `invalid_request`=2, `no_format`=3, `no_size`=4, `access_error`=5, `partial_download`=6, plus why no_match/outage are distinguishable. - Approved free sources (`wikimedia_commons`, `openverse`) with no API keys, tokens or registration, the approved HTTPS host allowlist, and the registry extension point (`SourceAdapter`, `SourceRegistry.register/unregister`, `build_registry()`/`default_registry()`, host allowlist extension). - Both decided behaviours: `--download` without `--output-dir` is an invalid request (invalid_request / exit 2), and partial saves are reported as `partial_download` (exit 6) with `download_incomplete` details while saved paths are still reported. - The real test entrypoint `pytest` plus the compileall/help/smoke commands. tests/test_readme.py asserts the README documents every long option the real parser accepts, the accepted formats, every status with its exit code from STATUS_EXIT_CODES, the response keys, every registered source id, the registry extension names, both product decisions, native-process wording, and the real pytest/compileall/help/smoke commands. Tests: Ran the facade check set with .venv/bin on PATH after `prepare_environment(component=tools, mode=restore)`: - `pytest -q` -> 163 passed, 1 skipped (pre-existing tests/test_live_source.py live-network skip: Wikimedia upload host returns HTTP 429 from this sandbox). - `python -m compileall -q tools tests` -> ok. - `python -m tools.example --help` -> exit 0. - `python -m tools.example examples/input.json` -> exit 0, one JSON dry_run envelope. - `pytest tests/test_readme.py -q` -> 5 passed. Also confirmed `git merge-base --is-ancestor origin/task/1-task HEAD` (target branch already integrated, zero diff), so no integration step was required. Progress: Delivered the documentation slice for issue 9. README.md was a two-line placeholder; it is now the full tool-calling contract: CLI parameters matching `--help` output, the JSON request-document form for examples/input.json, the single-document response schema, the fixed status vocabulary with exit codes (ok/dry_run=0, invalid_request=2, no_format=3, no_size=4, access_error=5, partial_download=6), credential-free sources and the registry extension point, the decided --download-without---output-dir invalid-request behaviour, partial_download reporting for incomplete saves, and plain native-process execution with the real pytest entrypoint. Added tests/test_readme.py (5 tests) so CI fails if documentation drifts from build_parser(), STATUS_EXIT_CODES, ACCEPTED_FORMATS or the default registry. No protected facade paths or source behaviour changed; existing obligations preserved (full suite green apart from the pre-existing live-source skip). Published by developer-agent through Tool Backend. Closes #9
ai-dev added 1 commit 2026-11-03 02:40:30 +00:00
change: Implement 7: Document the tool-calling contract, statuses, exit codes and native-process usage
Repository Validate / repository-checks (pull_request) Successful in 19s
2e8e70e765
Rewrote README.md as the delivered tool-calling contract for the calling AI agent and added tests/test_readme.py to keep it synchronized with the implementation.

README.md now documents:
- Native-process usage only: `python -m tools.example` with no Docker, container image or packaging stage, Python >= 3.11, no runtime third-party dependencies.
- Every parameter exactly as produced by `--help`: positional `REQUEST.json`, `-t/--topic`, `--width`, `--height`, `-f/--format` (`png|ico`), `-s/--source` (default `wikimedia_commons`), `-c/--count` (1-50, default 10), `--download`, `-o/--output-dir`, `--resize`, `--dry-run`; width/height documented as minimums and the "document XOR flags" rule.
- The JSON request document form used by `examples/input.json`: field table, types, defaults, optional `version`, and the document-level invalid_request rules.
- The single-document JSON response schema: fixed keys `status`, `source`, `request`, `items`, `error`; item fields (actual format/width/height, `url`/`file_url`, `size_bytes`), download record, resize fragment and the verified-save failure record.
- The fixed status vocabulary with its exit codes: `ok`=0, `dry_run`=0, `invalid_request`=2, `no_format`=3, `no_size`=4, `access_error`=5, `partial_download`=6, plus why no_match/outage are distinguishable.
- Approved free sources (`wikimedia_commons`, `openverse`) with no API keys, tokens or registration, the approved HTTPS host allowlist, and the registry extension point (`SourceAdapter`, `SourceRegistry.register/unregister`, `build_registry()`/`default_registry()`, host allowlist extension).
- Both decided behaviours: `--download` without `--output-dir` is an invalid request (invalid_request / exit 2), and partial saves are reported as `partial_download` (exit 6) with `download_incomplete` details while saved paths are still reported.
- The real test entrypoint `pytest` plus the compileall/help/smoke commands.

tests/test_readme.py asserts the README documents every long option the real parser accepts, the accepted formats, every status with its exit code from STATUS_EXIT_CODES, the response keys, every registered source id, the registry extension names, both product decisions, native-process wording, and the real pytest/compileall/help/smoke commands.

Tests:
Ran the facade check set with .venv/bin on PATH after `prepare_environment(component=tools, mode=restore)`:
- `pytest -q` -> 163 passed, 1 skipped (pre-existing tests/test_live_source.py live-network skip: Wikimedia upload host returns HTTP 429 from this sandbox).
- `python -m compileall -q tools tests` -> ok.
- `python -m tools.example --help` -> exit 0.
- `python -m tools.example examples/input.json` -> exit 0, one JSON dry_run envelope.
- `pytest tests/test_readme.py -q` -> 5 passed.
Also confirmed `git merge-base --is-ancestor origin/task/1-task HEAD` (target branch already integrated, zero diff), so no integration step was required.

Progress:
Delivered the documentation slice for issue 9. README.md was a two-line placeholder; it is now the full tool-calling contract: CLI parameters matching `--help` output, the JSON request-document form for examples/input.json, the single-document response schema, the fixed status vocabulary with exit codes (ok/dry_run=0, invalid_request=2, no_format=3, no_size=4, access_error=5, partial_download=6), credential-free sources and the registry extension point, the decided --download-without---output-dir invalid-request behaviour, partial_download reporting for incomplete saves, and plain native-process execution with the real pytest entrypoint. Added tests/test_readme.py (5 tests) so CI fails if documentation drifts from build_parser(), STATUS_EXIT_CODES, ACCEPTED_FORMATS or the default registry. No protected facade paths or source behaviour changed; existing obligations preserved (full suite green apart from the pre-existing live-source skip).

Published by developer-agent through Tool Backend.

Closes #9
Author
Member

Developer-agent completed implementation and CI passed, but updating the PR title/body failed.

Intended title: change: Implement 7: Document the tool-calling contract, statuses, exit codes and native-process usage
Commit: 2e8e70e765
CI: CI passed.

Intended body:
Rewrote README.md as the delivered tool-calling contract for the calling AI agent and added tests/test_readme.py to keep it synchronized with the implementation.

README.md now documents:

  • Native-process usage only: python -m tools.example with no Docker, container image or packaging stage, Python >= 3.11, no runtime third-party dependencies.
  • Every parameter exactly as produced by --help: positional REQUEST.json, -t/--topic, --width, --height, -f/--format (png|ico), -s/--source (default wikimedia_commons), -c/--count (1-50, default 10), --download, -o/--output-dir, --resize, --dry-run; width/height documented as minimums and the "document XOR flags" rule.
  • The JSON request document form used by examples/input.json: field table, types, defaults, optional version, and the document-level invalid_request rules.
  • The single-document JSON response schema: fixed keys status, source, request, items, error; item fields (actual format/width/height, url/file_url, size_bytes), download record, resize fragment and the verified-save failure record.
  • The fixed status vocabulary with its exit codes: ok=0, dry_run=0, invalid_request=2, no_format=3, no_size=4, access_error=5, partial_download=6, plus why no_match/outage are distinguishable.
  • Approved free sources (wikimedia_commons, openverse) with no API keys, tokens or registration, the approved HTTPS host allowlist, and the registry extension point (SourceAdapter, SourceRegistry.register/unregister, build_registry()/default_registry(), host allowlist extension).
  • Both decided behaviours: --download without --output-dir is an invalid request (invalid_request / exit 2), and partial saves are reported as partial_download (exit 6) with download_incomplete details while saved paths are still reported.
  • The real test entrypoint pytest plus the compileall/help/smoke commands.

tests/test_readme.py asserts the README documents every long option the real parser accepts, the accepted formats, every status with its exit code from STATUS_EXIT_CODES, the response keys, every registered source id, the registry extension names, both product decisions, native-process wording, and the real pytest/compileall/help/smoke commands.

Tests:
Ran the facade check set with .venv/bin on PATH after prepare_environment(component=tools, mode=restore):

  • pytest -q -> 163 passed, 1 skipped (pre-existing tests/test_live_source.py live-network skip: Wikimedia upload host returns HTTP 429 from this sandbox).
  • python -m compileall -q tools tests -> ok.
  • python -m tools.example --help -> exit 0.
  • python -m tools.example examples/input.json -> exit 0, one JSON dry_run envelope.
  • pytest tests/test_readme.py -q -> 5 passed.
    Also confirmed git merge-base --is-ancestor origin/task/1-task HEAD (target branch already integrated, zero diff), so no integration step was required.

Published by developer-agent through Tool Backend.

Developer-agent completed implementation and CI passed, but updating the PR title/body failed. Intended title: change: Implement 7: Document the tool-calling contract, statuses, exit codes and native-process usage Commit: 2e8e70e765d8577d045d576ad5c11c2e3ec0cea5 CI: CI passed. Intended body: Rewrote README.md as the delivered tool-calling contract for the calling AI agent and added tests/test_readme.py to keep it synchronized with the implementation. README.md now documents: - Native-process usage only: `python -m tools.example` with no Docker, container image or packaging stage, Python >= 3.11, no runtime third-party dependencies. - Every parameter exactly as produced by `--help`: positional `REQUEST.json`, `-t/--topic`, `--width`, `--height`, `-f/--format` (`png|ico`), `-s/--source` (default `wikimedia_commons`), `-c/--count` (1-50, default 10), `--download`, `-o/--output-dir`, `--resize`, `--dry-run`; width/height documented as minimums and the "document XOR flags" rule. - The JSON request document form used by `examples/input.json`: field table, types, defaults, optional `version`, and the document-level invalid_request rules. - The single-document JSON response schema: fixed keys `status`, `source`, `request`, `items`, `error`; item fields (actual format/width/height, `url`/`file_url`, `size_bytes`), download record, resize fragment and the verified-save failure record. - The fixed status vocabulary with its exit codes: `ok`=0, `dry_run`=0, `invalid_request`=2, `no_format`=3, `no_size`=4, `access_error`=5, `partial_download`=6, plus why no_match/outage are distinguishable. - Approved free sources (`wikimedia_commons`, `openverse`) with no API keys, tokens or registration, the approved HTTPS host allowlist, and the registry extension point (`SourceAdapter`, `SourceRegistry.register/unregister`, `build_registry()`/`default_registry()`, host allowlist extension). - Both decided behaviours: `--download` without `--output-dir` is an invalid request (invalid_request / exit 2), and partial saves are reported as `partial_download` (exit 6) with `download_incomplete` details while saved paths are still reported. - The real test entrypoint `pytest` plus the compileall/help/smoke commands. tests/test_readme.py asserts the README documents every long option the real parser accepts, the accepted formats, every status with its exit code from STATUS_EXIT_CODES, the response keys, every registered source id, the registry extension names, both product decisions, native-process wording, and the real pytest/compileall/help/smoke commands. Tests: Ran the facade check set with .venv/bin on PATH after `prepare_environment(component=tools, mode=restore)`: - `pytest -q` -> 163 passed, 1 skipped (pre-existing tests/test_live_source.py live-network skip: Wikimedia upload host returns HTTP 429 from this sandbox). - `python -m compileall -q tools tests` -> ok. - `python -m tools.example --help` -> exit 0. - `python -m tools.example examples/input.json` -> exit 0, one JSON dry_run envelope. - `pytest tests/test_readme.py -q` -> 5 passed. Also confirmed `git merge-base --is-ancestor origin/task/1-task HEAD` (target branch already integrated, zero diff), so no integration step was required. Published by developer-agent through Tool Backend.
ai-dev added the auto:allowedrole:reviewerstatus:in-review labels 2026-11-03 02:40:58 +00:00
ai-dev added the claim:active label 2026-11-03 02:40:59 +00:00
ai-reviewer left a comment
Member

README.md is now a complete, non-empty tool-calling contract matching the delivered CLI: native-process invocation, every documented long option/format/source id, the JSON request document, response schema, STATUS_EXIT_CODES with exit values, approved credential-free sources and registry extension point, and both decided download behaviours. tests/test_readme.py runs through the standard pytest entrypoint and passed in CI at the reviewed head SHA (163 passed, 1 pre-existing live-network skip), with the facade help-command acceptance also passing. No protected facade paths were changed.

Acceptance evidence for 2e8e70e765d8577d045d576ad5c11c2e3ec0cea5:

  • issue-9-ac-1: README.md exists and is non-empty with the complete contract documentation; tests/test_readme.py asserts its presence/content and the CI test run at the PR head SHA passed. (README.md:1-160; README.md:160-318; tests/test_readme.py:1-92; CI job 10:315-438)
  • issue-9-ac-2: The README documents the CLI parameters and request document, response schema, fixed status vocabulary and exit codes, credential-free sources, product decisions, and native pytest/native-process usage. The real --help output and pytest suite were executed successfully at the reviewed commit, and the structured help-command acceptance passed. (README.md:160-318; tools/example.py:1-160; tools/envelope.py:160-263; CI job 10:315-438; CI job 10:438-442)
README.md is now a complete, non-empty tool-calling contract matching the delivered CLI: native-process invocation, every documented long option/format/source id, the JSON request document, response schema, STATUS_EXIT_CODES with exit values, approved credential-free sources and registry extension point, and both decided download behaviours. tests/test_readme.py runs through the standard pytest entrypoint and passed in CI at the reviewed head SHA (163 passed, 1 pre-existing live-network skip), with the facade help-command acceptance also passing. No protected facade paths were changed. Acceptance evidence for `2e8e70e765d8577d045d576ad5c11c2e3ec0cea5`: - issue-9-ac-1: README.md exists and is non-empty with the complete contract documentation; tests/test_readme.py asserts its presence/content and the CI test run at the PR head SHA passed. (README.md:1-160; README.md:160-318; tests/test_readme.py:1-92; CI job 10:315-438) - issue-9-ac-2: The README documents the CLI parameters and request document, response schema, fixed status vocabulary and exit codes, credential-free sources, product decisions, and native pytest/native-process usage. The real --help output and pytest suite were executed successfully at the reviewed commit, and the structured help-command acceptance passed. (README.md:160-318; tools/example.py:1-160; tools/envelope.py:160-263; CI job 10:315-438; CI job 10:438-442)
ai-reviewer merged commit 2e8e70e765 into task/1-task 2026-11-03 02:43:42 +00:00
ai-reviewer deleted branch change/9-implement-7-document-the-tool-calling-contract-statuses-exit-c 2026-11-03 02:43:42 +00:00
ai-dev added status:accepted and removed claim:activerole:reviewerstatus:in-review labels 2026-11-03 02:43:43 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: projects/product-54354138-1#17