feat(form,team,kudos): forms lifecycle + team-aware kudos#20
Merged
Conversation
## Summary
Adds the full forms-response lifecycle to `dailybot form` (get, responses,
response get, update, transition, delete) and introduces `dailybot team
list / get` plus `dailybot kudos give --team` so agents can drive any
form — including workflow-enabled ones — and credit entire teams in a
single kudos call.
## Change Log
- api_client.py
- New methods: list_form_responses, get_form_response, update_form_response,
transition_form_response, delete_form_response, list_teams, get_team,
list_team_members.
- give_kudos payload switched from `receivers` to
`user_uuid_receivers` + `team_uuid_receivers` per the api-services
contract.
- APIError now carries the structured `code` from {detail, code} 4xx
bodies.
- commands/form.py
- New subcommands: get, responses, response get, update, transition,
delete. Each one prints the workflow-state surface (current_state,
allowed_transitions, can_change_state, state_history) after every
mutating call.
- commands/team.py (new)
- team list / team get [--with-members]. Resolves by UUID or
case-insensitive name. The CLI never client-filters — server scoping
(admin sees all, member sees own) is rendered verbatim.
- commands/kudos.py
- `kudos give` accepts `--to`, `--team`, or both. Self-kudos still
rejected client-side. Either receiver list resolves to the new
payload shape.
- commands/public_api_helpers.py
- ERROR_CODE_MESSAGES table mapping server-side codes
(form_response_change_state_forbidden, final_state_locked,
form_response_delete_forbidden, user_can_not_see_form_responses,
form_response_not_found, form_does_not_exists, payload_too_large,
no_valid_team, no_valid_users, no_users_found).
- exit_for_api_error now handles 404 (EXIT_NOT_FOUND=5) and 400, and
JSON mode surfaces `code` + `detail` alongside `status`.
- resolve_team_by_name_or_uuid helper mirroring the user resolver,
surfacing the team-scoping reality on miss.
- display.py
- Helpers for form detail, response state surface, responses table,
response detail, teams table, team detail.
- Tests: 24 new tests across api_client_test.py + public_api_commands_test.py
covering forms lifecycle, teams, team-kudos, and code-based 4xx mapping.
Existing kudos test migrated to the new payload shape.
- README + docs/API_REFERENCE: new commands, options, error-code table,
HTTP endpoint table.
## Risks
- Behavioral change for /v1/kudos/: the CLI no longer sends the legacy
`receivers` field. Coordinated with api-services per handoff.
- Auth resolution + repo profile behavior unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary
Expands the documentation set so AI agents and human installers can
discover and use the new commands without reading the source.
## Change Log
- AGENTS.md (also reachable as CLAUDE.md via the existing symlink)
- Project overview now mentions forms-lifecycle, workflow states,
team browsing, and team-aware kudos for both humans and agents.
- Endpoint list extended (`/v1/forms/*`, `/v1/teams/*`, `/v1/kudos/`).
- Project Structure documents the per-command files (checkin, form,
team, kudos, user, public_api_helpers, user_scoped_actions).
- tests/ tree shows the modules covering the new surface.
- docs/PRODUCT_SPEC.md
- Human-facing feature matrix split out: form get / responses /
response get / update / transition / delete; team list / get;
kudos --to | --team | both.
- docs/CLI_COMMAND_BEST_PRACTICES.md
- Clarifies that short aliases are scoped per command, not globally
(-m and -c are reused legitimately across groups).
- docs/DISPLAY_OUTPUT_BEST_PRACTICES.md
- Specialized-renderer table extended with print_form_detail,
print_form_response_state, print_form_responses_table,
print_form_response_detail, print_form_response_deleted,
print_teams_table, print_team_detail.
- docs/TESTING_GUIDE.md
- Test-tree section reflects the actual files under tests/.
- Adds coverage expectations for forms-lifecycle (happy path,
error-path per server code, JSON-mode shape) and team-kudos
(the legacy `receivers` key MUST NOT appear).
- docs/TROUBLESHOOTING.md
- New "Forms & Workflow" section: 403 forbidden, final_state_locked,
404 not_found, delete forbidden, --latest empty, Markdown
newlines-in-content guidance.
- New "Teams & Kudos" section: role-scoping reality, "team not
visible" error, self-team kudos, no_valid_users / no_valid_team.
## Risks
None — docs-only.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The form-response webapp renders a constrained Markdown subset — only single-level `#` headings, with multi-level (`##`, `###`) falling through as plain text. Document the supported features so agents authoring `--content` for `form submit` / `form update` don't ship broken-looking renderings. Includes a quick CLI-side smoke-check using `form response get --json | jq` to confirm newlines and heading levels round-tripped correctly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the api-services cross-repo handoff for the forms-response lifecycle and team-aware kudos. Three additive workstreams on
dailybot:dailybot formwithget,responses,response get,update,transition,deleteso a coding agent can drive any form — including workflow-enabled ones — end-to-end afterdailybot login.dailybot team list/dailybot team get [--with-members]consumingGET /v1/teams/. Visibility is scoped server-side by role (admins see all org teams, members see only their own). The CLI never client-filters.dailybot kudos giveaccepts--to,--team, or both. Payload migrated fromreceiverstouser_uuid_receivers+team_uuid_receiversper the new api-services contract.Surface added
dailybot form get <uuid>GET /v1/forms/<uuid>/dailybot form responses <uuid> [--state] [--latest]GET /v1/forms/<uuid>/responses/dailybot form response get <uuid> <resp>GET /v1/forms/<uuid>/responses/<resp>/dailybot form update <uuid> <resp> --content '{...}'PATCH …/responses/<resp>/dailybot form transition <uuid> <resp> <state> [--note]POST …/responses/<resp>/transition/dailybot form delete <uuid> <resp>DELETE …/responses/<resp>/dailybot team listGET /v1/teams/dailybot team get <uuid_or_name> [--with-members]GET /v1/teams/<uuid>/+…/members/dailybot kudos give --team <name_or_uuid>POST /v1/kudos/(new payload)Error-code mapping
APIErrornow carries thecodefrom{detail, code}4xx bodies.exit_for_api_errormaps every server code from the handoff to a friendly message + structured exit code:form_response_change_state_forbidden,final_state_locked,form_response_delete_forbidden,user_can_not_see_form_responses→ 403 → exit4form_response_not_found,form_does_not_exists→ 404 → exit5(newEXIT_NOT_FOUND)payload_too_large,no_valid_team,no_valid_users,no_users_found→ 400 → exit2--jsonoutput surfaceserror,status,code, anddetailso chat-agent consumers can pattern-match on the structured shape.Tests
tests/api_client_test.pyandtests/public_api_commands_test.pycovering: form get / responses (state filter + latest) / response get (404) / update / transition (forbidden + final_state_locked) / delete (forbidden); team list / team get / team get --with-members; kudos give --team / kudos give --to + --team / kudos give --team unseen-team / kudos give without --to or --team.user_uuid_receivers/team_uuid_receiverspayload shape.ruff check,ruff format --check,mypy dailybot_cli— all clean.commands_test.pyexist on baremain(unrelatedCLI AgentvsCLIagent-name resolution).Live validation
Verified against the local api-services dev server (
http://djangovscode:8000) viaclitest-local:dailybot login→ multi-org selection works (XergioAleXDailyBotselected).dailybot team list→ returnsGeneral,Tech,Product(admin view).dailybot user list→ returns the 4 org members.dailybot form list→ returns all 6 org forms.dailybot form get,form submit,form response get,form update,form transitionexercised end-to-end on the "Code Release Form" (65de0ec6-…). Response04dbefcf-…walkednull → pre_release → qa → code_reviewwith notes; workflow surface (current_state,allowed_transitions,state_history) rendered correctly after every mutation.Docs
README.md— new sections forform get / responses / response get / update / transition / delete, the team commands, team-aware kudos, the workflow-state vocabulary, and the structured-code JSON mode.AGENTS.md(≡CLAUDE.md) — project overview now covers forms-lifecycle, workflow states, team browsing, team-aware kudos. Endpoint list extended. Project Structure tree shows all per-command files.docs/API_REFERENCE.md— every new subcommand documented with its endpoint, options, and the full server-code error table.docs/PRODUCT_SPEC.md— feature matrix split out per new command.docs/CLI_COMMAND_BEST_PRACTICES.md— note on short-alias per-command scoping.docs/DISPLAY_OUTPUT_BEST_PRACTICES.md— 7 new specialized renderers documented.docs/TESTING_GUIDE.md— coverage expectations: happy + error path per code + JSON-mode shape; "no legacyreceiverskey" rule.docs/TROUBLESHOOTING.md— new Forms & Workflow + Teams & Kudos sections covering every server code, plus a Form-response Markdown: supported subset entry (only single-level#headings render; real\nnewlines required; rest of the inline + block features documented).Risks
/v1/kudos/payload no longer includes the legacyreceiversfield. Coordinated with api-services per the cross-repo handoff — backend is fully ready.agents.json,config.json,credentials.json,.dailybot/profile.json) — no schema changes.Release notes
#7078,#8589,#3067) are deployed — those endpoints are required at runtime.auto-release.ymlwill cut the next bump automatically on merge perdefault_bump_level = 2inpyproject.toml.agent-skillrepo soforms/SKILL.mdcan re-test end-to-end against the new CLI version.Test plan
dailybot form get <uuid>renders questions + workflow states.dailybot form responses <uuid> --latest --jsonreturns at most one response.dailybot form transitionmapsform_response_change_state_forbidden(exit 4) andfinal_state_locked(exit 4).dailybot team listreturns admin's all-teams set; member view scoped server-side.dailybot kudos give --team "Tech"posts withteam_uuid_receivers.dailybot kudos give --to "X" --team "Y"posts both arrays.dailybot form deletehonors author / owner / admin invariant.🤖 Generated with Claude Code