| version | 0.3 |
|---|---|
| project | odsview-cli-python |
| baseline_commit | main |
| curated_by | arturo |
This file customizes the baseline Software Curatorship recipe for this repository. Sections not explicitly customized here inherit their meaning from
docs/curation/AI_CURATOR_RECIPE_BASELINE_v0.3.md.
- Keep runtime minimal; favor clarity and determinism.
- All user-visible behavior is test-backed and explained via ADRs.
- Provenance is transparent (README “Attribution & Curation”, ADR-0010, AUTHORS).
- This project provides a read-only terminal viewer for
.odsfiles aiming to work well over SSH and in constrained environments (e.g. Termux).
Describe the externally visible behavior of the CLI.
This section reflects the currently implemented behavior plus
near-term intent from docs/curation/BLUEPRINT.md, ADR-0003, and
ADR-0004.
| Aspect | Description |
|---|---|
| Inputs | CLI invocation odsview [FILE] [options]; FILE is optional in the skeleton and required when using --list-sheets |
| Outputs/streams | stdout → help/usage text; sheet names (one per line) when using --list-sheets; range-based table view output for odsview FILE.ods [--sheet NAME] [--range A1:E10]; stderr → diagnostics and error messages on failure |
| Exit codes | 0 on success (e.g. --help, no arguments, --list-sheets FILE, or successful table view); 2 for CLI usage errors (e.g. --list-sheets without FILE, malformed --range); 1 for runtime/IO/loader errors when operating on a file |
| Determinism | Given the same CLI arguments, environment, and locale, help, --list-sheets, and range-based table output are deterministic over the curated fixtures; future ADRs may tighten locale/format guarantees. |
As of this milestone, the CLI is read-only and provides two user-visible data operations:
--list-sheets FILE.ods, which prints sheet names.- A minimal range-based table view for cell contents as specified in
ADR-0004 and exercised by
tests/test_cli.pyusing curated.odsfixtures.
- AI drafts; human curator approves and is accountable.
- Non-trivial changes: add/update tests and ADRs.
- Prefer stdlib/zero-deps unless ADR justifies otherwise.
- Maintain transparency of reasoning and provenance.
docs/curation/— baseline, prompts, blueprint, and curation log.scripts/— guardrails (recipe validation, ADR checks, fast tests, etc.)..github/workflows/ci.yml— CI pipeline (lint, type-check, tests, recipe validation)..pre-commit-config.yaml— local guardrails.- Future source and test layout (TBD, likely
src/odsviewandtests/).
- ADRs live under
docs/adr/. - Each ADR contains Context · Decision · Consequences.
- Status flow: Proposed → Accepted → Superseded.
docs/adr/README.mdserves as an index; CI should fail if stale.
- Cover CLI contracts (inputs, outputs, exit codes, invariants).
- At least one edge case per new behavior (e.g. empty sheet, large sheet, invalid file).
- Keep deterministic and fast; network-free.
- Provide a fast subset via
scripts/fast_tests.sh.
| Stage | Tools | Purpose |
|---|---|---|
| Local (pre-commit) | Ruff, mypy, ADR guards, print-guard, fast tests | Prevent regressions early |
| CI | Lint → Type → Tests → ADR checks → Recipe validation | Guarantee reproducibility |
Curator docs under docs/curation/ are validated via scripts/validate_recipe.py
but excluded from general lint/type checks.
- Lint/types/tests/build all green.
- Tests cover new/changed behavior.
- Docs/ADRs updated as needed.
- Provenance intact (licenses and curation docs preserved).
- Packaging/version sanity verified.
- Read repository tree and curator’s current goal.
- Expand the goal into a small checklist of concrete steps.
- Propose minimal, focused diffs instead of large rewrites.
- Propose explicit shell commands using this repo’s scripts and tooling
(e.g.
pre-commit run --all-files,bash scripts/fast_tests.sh,python scripts/validate_recipe.py …) and let the human curator run them in the terminal. - Iterate until checks are green or clearly mark any deferrals.
- Summarize changes (Done/Deferred) and reference ADRs where applicable.
- Keep attribution; never remove license/provenance.
- Use Semantic Versioning once the CLI is public.
- Define a single source of truth for the version (e.g.
__version__in the package module orpyproject.toml). - Tag releases as
vX.Y.Z; require green CI for tags. - Maintain lightweight release notes and/or changelog when appropriate.
- Periodically run
pre-commit run --all-files. - Review README and
BLUEPRINT.mdfor accuracy versus implemented behavior. - Perform ADR housekeeping (index, statuses, superseded links).
- Review automation scripts and CI for drift.
- Detailed CLI option and exit code matrix — will be specified in Appendix A once the first CLI implementation is in place.
- Determinism guarantees for locale/encoding — to be documented alongside the first end-to-end tests.
Current implemented behavior
- CLI entrypoint:
odsviewconsole script (viapyproject.toml). - Inputs:
- No arguments → prints help to
stdout, exits with code0. --help→ prints help tostdout, exits with code0.FILEargument without--list-sheets→ renders a default preview window of the first sheet, equivalent to rangeA1:H10, and exits with code0.--list-sheets FILE→ lists sheet names (one per line) tostdoutand exits with code0on success.FILEplus--sheet NAMEand/or--range A1:E10→ renders a range-based table view as specified in ADR-0004 and exits with code0on success. -- Outputs:- Help/usage text.
- Sheet names (one per line) when requested via
--list-sheets. - Range-based table output for
odsview FILE.odsand--sheet/--rangecombinations.
- No arguments → prints help to
- Invariants (even at this stage):
- Never mutates any input file.
- Avoids interactive prompts by default.
Current implemented internals (used by CLI and tests)
- Container layer:
odsview.container.open_ods_container(path)validates that the given path exists and is an.ods-compatible ZIP container and exposes access tocontent.xml. - Workbook layer:
odsview.workbook.load_workbook(path)usesodfpyto load the document model fromcontent.xmland returns aWorkbookabstraction. - Sheet enumeration:
Workbook.sheetsprovides an ordered list of sheets (names only). This is exercised both by tests and by the--list-sheetsCLI behavior using the fixturetests/fixtures/simple.ods.
Planned behavior (not yet implemented, subject to future ADRs)
- Smarter defaults (e.g. terminal-size-aware windows) and truncation rules for very wide or long sheets.
- Additional display options (e.g. toggling gridlines, alignment controls) while preserving the simple range-based contract.
Planned contracts become authoritative only once backed by tests and, where appropriate, ADRs.