Skip to content

Sprint 30 T1: web4 trust CLI subcommand#147

Merged
dp-web4 merged 1 commit into
mainfrom
worker/web4-20260410-120000
Apr 12, 2026
Merged

Sprint 30 T1: web4 trust CLI subcommand#147
dp-web4 merged 1 commit into
mainfrom
worker/web4-20260410-120000

Conversation

@dp-web4
Copy link
Copy Markdown
Owner

@dp-web4 dp-web4 commented Apr 10, 2026

Summary

  • Add web4 trust CLI subcommand — 6th subcommand, wraps evaluate_trust_query() for terminal-based trust query evaluation
  • Two modes: CLI flags (--actor/--target/--role + options) for quick queries, --file for complex TrustQuery JSON documents
  • 13 new tests (TestTrust class, in-process style per Sprint 29), 2621 total tests passing, mypy strict clean (25 files), 0 new files

Usage

# Quick trust evaluation with flags
web4 trust --actor lct:alice --target lct:bob --role analyst

# With custom profile and precise disclosure
web4 trust --actor lct:alice --target lct:bob --role analyst \
  --disclosure-level precise \
  --profile-roles '{"analyst": {"talent": 0.8, "training": 0.9, "temperament": 0.7}}'

# From JSON file
web4 trust --file query.json

# Compact output
web4 trust --actor lct:alice --target lct:bob --role analyst --compact

Test plan

  • All 13 TestTrust tests pass (flags, file input, disclosure levels, error handling)
  • Full suite: 2621 tests passing (up from 2608)
  • mypy --strict: 0 errors across 25 files
  • Manual verification of all CLI paths

🤖 Generated with Claude Code

@dp-web4
Copy link
Copy Markdown
Owner Author

dp-web4 commented Apr 11, 2026

CHANGES REQUESTED:

The code and tests are clean — web4 trust CLI subcommand is well-scoped, wraps existing evaluate_trust_query(), 13 tests, 0 new files. Good work.

However, PR #148 (distribution verification bug fixes) was just merged to main with its own Sprint 30 T1 definition. This PR now has merge conflicts on docs/SPRINT.md and SESSION_FOCUS.md — both PRs independently defined "Sprint 30 T1" with different content.

Action needed: Rebase onto main and resolve the conflicts. The trust CLI should become Sprint 30 T2 (since the distribution verification PR was merged first as T1). Update SPRINT.md and SESSION_FOCUS.md accordingly, adjusting test counts to account for #148's 2610 baseline.

I'll merge on next review cycle after rebase.

dp-web4 added a commit that referenced this pull request Apr 11, 2026
Version bump 0.22.0 → 0.23.0. CHANGELOG documents Sprint 29 (CLI test
refactoring, __main__.py coverage 15.8% → 90.6%) and Sprint 30 T1b
(4 bug fixes: LCT @type roundtrip, LCT schema @type rejection,
DictionaryEntity lct_id loss, pyproject.toml license deprecation).

README updated: 2610 tests, 97.8% coverage. SESSION_FOCUS corrected:
Open PRs section (PR #147 pending), test count, coverage stats.
SPRINT.md Sprint 31 entry added. Test version assertions updated.

2610 tests passing. mypy --strict 0 errors (25 files). 0 new files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dp-web4
Copy link
Copy Markdown
Owner Author

dp-web4 commented Apr 11, 2026

APPROVED: Sprint 30 T1 — web4 trust CLI subcommand. 0 new files, 4 modified. Adds 6th CLI subcommand wrapping existing evaluate_trust_query() behavioral function. Two modes (CLI flags + JSON file) provide good ergonomics. 13 well-structured tests in TestTrust class following Sprint 29's in-process pattern. Tests cover happy path (flags, file, disclosure levels, profile roles), error cases (missing flags, invalid JSON, invalid query, bad disclosure level, bad T3 data), and edge cases (insufficient ATP, compact output). Integrates cleanly with existing trust module — no standalone code, no drift.

dp-web4 added a commit that referenced this pull request Apr 11, 2026
Version bump 0.22.0 → 0.23.0. CHANGELOG documents Sprint 29 (CLI test
refactoring, __main__.py coverage 15.8% → 90.6%) and Sprint 30 T1b
(4 bug fixes: LCT @type roundtrip, LCT schema @type rejection,
DictionaryEntity lct_id loss, pyproject.toml license deprecation).

README updated: 2610 tests, 97.8% coverage. SESSION_FOCUS corrected:
Open PRs section (PR #147 pending), test count, coverage stats.
SPRINT.md Sprint 31 entry added. Test version assertions updated.

2610 tests passing. mypy --strict 0 errors (25 files). 0 new files.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@dp-web4
Copy link
Copy Markdown
Owner Author

dp-web4 commented Apr 11, 2026

NOTE: This PR now has merge conflicts after PR #150 (Sprint 31 housekeeping) was merged to main. Both PRs modified SESSION_FOCUS.md, docs/SPRINT.md, and tests/test_cli.py.

The PR content is approved — please rebase onto main, resolve the conflicts (version references should be 0.23.0, sprint count should be 31), and push. I'll merge on the next cycle.

@dp-web4
Copy link
Copy Markdown
Owner Author

dp-web4 commented Apr 11, 2026

APPROVED (pending rebase):

Advances Sprint 30 T1 — wraps evaluate_trust_query() as the 6th CLI subcommand. 0 new files, 13 well-targeted tests (flags, file input, all disclosure levels, error paths). Deep integration with existing trust/atp modules. Clean implementation.

CHANGES REQUESTED: Merge conflicts with main (PR #152 just merged, touching the same files — main.py, test_cli.py, SPRINT.md, SESSION_FOCUS.md). Please rebase on main and push. I'll merge on next review cycle.

@dp-web4
Copy link
Copy Markdown
Owner Author

dp-web4 commented Apr 11, 2026

CHANGES REQUESTED:

Code quality is good: trust CLI subcommand wraps evaluate_trust_query() cleanly, supports both CLI flags and JSON file input, 13 well-structured tests covering happy path, edge cases (insufficient ATP, invalid JSON, invalid disclosure level), and compact output. 0 new files, 4 files modified. Sprint 30 T1 properly referenced.

However, this branch has merge conflicts against main (SESSION_FOCUS.md and SPRINT.md have advanced through Sprints 31-33 since this branch was cut at Sprint 29).

Please rebase onto current main and resolve the metadata file conflicts. The main.py and test_cli.py changes should merge cleanly — the conflicts are in the tracking documents only.

@dp-web4
Copy link
Copy Markdown
Owner Author

dp-web4 commented Apr 12, 2026

APPROVED: Advances Sprint 30 T1. Adds web4 trust CLI subcommand wrapping existing evaluate_trust_query() — 0 new files, 4 modified (SESSION_FOCUS, SPRINT.md, test_cli.py, main.py). 13 well-structured tests covering flags, file input, disclosure levels, error paths. Follows existing CLI dispatch pattern. mypy strict clean. No drift signals.

Add 6th CLI subcommand wrapping evaluate_trust_query() for terminal use.
Two modes: CLI flags (--actor/--target/--role + optional --disclosure-level,
--stake, --validity, --profile-roles, --atp-balance, --compact) for quick
queries, and --file for complex TrustQuery JSON documents.

13 new tests (TestTrust class, in-process style). 2621 total tests passing.
mypy strict clean (25 files). 0 new files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dp-web4 dp-web4 force-pushed the worker/web4-20260410-120000 branch from 8a073af to 3b2f93b Compare April 12, 2026 05:07
@dp-web4 dp-web4 merged commit 9359540 into main Apr 12, 2026
4 of 5 checks passed
@dp-web4 dp-web4 deleted the worker/web4-20260410-120000 branch April 12, 2026 05:08
dp-web4 added a commit that referenced this pull request Apr 12, 2026
Version bump 0.24.0 → 0.25.0 reflecting three merged PRs:
- PR #147: `web4 trust` CLI subcommand (7th CLI command, 13 new tests)
- PR #151/#153: Archive reference implementation sprawl (130+ files)

CHANGELOG, README (trust CLI docs, 2627 tests, 7 subcommands),
__init__.py docstring, test version assertions, SPRINT.md Sprint 34,
SESSION_FOCUS.md (version, tests, CLI count, open PRs, recent commits).

0 new files. 2627 tests passing. mypy strict clean (25 files).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dp-web4 added a commit that referenced this pull request Apr 12, 2026
Version bump 0.24.0 → 0.25.0 reflecting three merged PRs:
- PR #147: `web4 trust` CLI subcommand (7th CLI command, 13 new tests)
- PR #151/#153: Archive reference implementation sprawl (130+ files)

CHANGELOG, README (trust CLI docs, 2627 tests, 7 subcommands),
__init__.py docstring, test version assertions, SPRINT.md Sprint 34,
SESSION_FOCUS.md (version, tests, CLI count, open PRs, recent commits).

0 new files. 2627 tests passing. mypy strict clean (25 files).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dp-web4 added a commit that referenced this pull request Jun 4, 2026
…ts.md (#267)

C29 remediation turn (alternation: #147 was the C29 audit). Applies the 5
AUTONOMOUS findings from docs/audits/C29-data-formats-audit-2026-06-03.md to
the identifier/canonicalization SSOT; the 4 DESIGN-Q contradictions and 3
CROSS-TRACK items are deliberately held out.

- B-M1 (MED): §5.2 CBOR — replace obsoleted RFC 7049 MUST-citation with
  RFC 8949 §4.2 Core Deterministic Encoding (the 4 listed rules already match
  8949; only the normative citation was wrong).
- A-M1 (MED): §1.1/§1.2 — register the attested `device` method
  (multi-device-lct-binding.md:244) and restate the method list as
  non-exhaustive/extensible with unrecognized-method-name handling.
- A-M2 (MED): §5.1 — relabel the canonicalizeJSON snippet as a NON-NORMATIVE
  sketch; state conformance REQUIRES a full RFC 8785 implementation (the
  JSON.stringify replacer-array does not recursively sort nested keys). Prose
  MUST unchanged.
- A-L1 (LOW): hygiene — remove stray `_` and collapse multi-blank residue.
- A-L2 (LOW): add References [5] RFC 8785, [6] RFC 8949, [7] RFC 5869 (HKDF),
  cited inline.
- I1 (INFO, opportunistic): add Version/Status/Last-Updated banner.

DESIGN-Q held: A-H1 scheme self-contradiction, B-H1 deterministic-salt defect
(NOT corrected — bundles the operator pairwise-algorithm decision), B-M2
prefix, B-M3 W4IDp form → carry-C28/C29-design-Q.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant