Repository navigation
Add events, inbox, and stream-ticket commands on the account event feed #726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
fe9134c
Pin the SDK to the main commit carrying the event-feed operations
jeremy 4fb6a92
Add events poll, inbox, and stream-ticket commands on the account eve…
jeremy 0237fb6
Name the lane's own identifier in an invalid --since, and re-hash the…
jeremy 571cb3b
Preserve filters when re-entering a gone position, and count feed rows
jeremy d61a138
Run the event-feed smoke suite
jeremy 07b0639
Carry the poll's own filters into every re-entry it advertises
jeremy cc2df29
Adopt the SDK's per-lane 410 and the 400's reason
jeremy 055f87a
Keep the stream-ticket mint off the MCP surface
jeremy ffab993
Hand the position back to the person, not just the machine
jeremy 2becc61
Quote the position in the command it hands back
jeremy 62c66dc
Re-hash the flake for the SDK re-pin
jeremy b283ecc
Say the walk was capped in --ids-only and --count too
jeremy 66d8c26
Name the set the stream-ticket mint is actually excluded by
jeremy 6e241bf
Withhold a cable URL that still carries the ticket anywhere
jeremy 348a753
Resume from the filters the last page was minted under
jeremy 250e295
Suppress --project when the id-or-url positional is optional too
jeremy 70a68c4
Say 195 endpoints and name the event feed
jeremy ae1a934
Build the redacted cable URL's query instead of editing it
jeremy 13f535a
Project the feed smoke reads down to what they assert
jeremy ca61413
Say that the redacted cable URL is a diagnostic
jeremy 45c8cd0
Name v0.18.0 as the release the pin builds on
jeremy 03edb00
Capture the redaction verdict, not the ticket it checks
jeremy ce9c288
Vet the redacted URL as rendered, not component by component
jeremy 6687811
Refuse an entry flag given an empty value
jeremy 50bc7cb
Write down why events keeps RunE alongside its subcommands
jeremy a56a169
State the redaction assertion's coverage component by component
jeremy 3b6f8f3
Treat every ticket the response presents as the secret
jeremy aa3e458
Check the redacted URL's decoding, not its components
jeremy dbbff8e
Refuse a list filter given an empty value
jeremy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| #!/usr/bin/env bats | ||
| # event_feed.bats - Account event feed: entry-point and filter validation | ||
| # | ||
| # Every case here is refused before a request leaves the process, so the suite | ||
| # needs no network and no live feed. | ||
|
|
||
| load test_helper | ||
|
|
||
| setup_extra() { | ||
| create_credentials | ||
| create_global_config '{"account_id": 99999}' | ||
| } | ||
|
|
||
| @test "events poll rejects --since and --position together" { | ||
| run basecamp events poll --since now --position abc | ||
| assert_failure | ||
| assert_output_contains "mutually exclusive" | ||
| } | ||
|
|
||
| @test "events poll rejects a --since that is not an entry point" { | ||
| run basecamp events poll --since 2026-07-14 | ||
| assert_failure | ||
| assert_output_contains "Invalid --since" | ||
| } | ||
|
|
||
| @test "events poll rejects a non-numeric bucket filter" { | ||
| run basecamp events poll --buckets one | ||
| assert_failure | ||
| assert_output_contains "Invalid --buckets id" | ||
| } | ||
|
|
||
| @test "events poll rejects an actor type outside agent and person" { | ||
| run basecamp events poll --actor-types robot | ||
| assert_failure | ||
| assert_output_contains "Invalid --actor-types" | ||
| } | ||
|
|
||
| @test "events poll --agent --help documents position handling" { | ||
| run basecamp events poll --agent --help | ||
| assert_success | ||
| assert_output_contains "position" | ||
| assert_output_contains "Deduplicate by event id" | ||
| } | ||
|
|
||
| @test "events ticket --agent --help warns against logging the ticket" { | ||
| run basecamp events ticket --agent --help | ||
| assert_success | ||
| assert_output_contains "show-secret" | ||
| } | ||
|
|
||
| @test "inbox rejects --since and --position together" { | ||
| run basecamp inbox --since now --position abc | ||
| assert_failure | ||
| assert_output_contains "mutually exclusive" | ||
| } | ||
|
|
||
| @test "inbox --agent --help documents addressing_id dedupe" { | ||
| run basecamp inbox --agent --help | ||
| assert_success | ||
| assert_output_contains "addressing_id" | ||
| assert_output_contains "agent" | ||
| } |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| #!/usr/bin/env bats | ||
| # smoke_event_feed.bats - Level 0: Account event feed operations | ||
| # | ||
| # Nothing here captures a position, a ticket or a cable URL: the first is a | ||
| # signed resume token and the other two are bearers, and bats keeps $output — | ||
| # a failing assertion prints it in full (test_helper.bash:118) into logs | ||
| # somebody keeps. So every read projects the envelope down to the fields it | ||
| # asserts with --jq, rather than capturing the whole thing and trusting | ||
| # redaction. Entering at the present (--since now) also keeps these reads | ||
| # bounded — a since=0 replay would walk the account's served history. | ||
| # | ||
| # This sits in Level 0 alongside the other read-only suites even though the | ||
| # ticket mint is a POST: it writes no record, mints a stateless signed token | ||
| # that expires in about two minutes, and leaves nothing behind for a parallel | ||
| # suite to trip over. | ||
|
|
||
| load smoke_helper | ||
|
|
||
| setup_file() { | ||
| ensure_token || return 1 | ||
| } | ||
|
|
||
| @test "events poll enters the feed at the present" { | ||
| run_smoke basecamp events poll --since now --jq '{ok: .ok}' | ||
| assert_success | ||
| assert_json_value '.ok' 'true' | ||
| } | ||
|
|
||
| @test "events poll rejects a since that is not an entry point" { | ||
| run_smoke basecamp events poll --since yesterday --json | ||
| assert_failure | ||
| assert_output_contains "Invalid --since" | ||
| } | ||
|
|
||
| # The comparison happens inside --jq so that only its verdict is captured. | ||
| # Projecting the ticket itself and comparing here would mean that the one | ||
| # regression this test exists to catch — redaction failing — is also the one | ||
| # that puts a live bearer in the failure output. | ||
| @test "events ticket mints a redacted ticket" { | ||
| run_smoke basecamp events ticket \ | ||
| --jq '{ok: .ok, error: .error, ticket_redacted: (.data.ticket == "[REDACTED]"), url_redacted: ((.data.url // "") | contains("REDACTED"))}' | ||
| assert_success | ||
| assert_json_value '.ok' 'true' | ||
| assert_json_value '.ticket_redacted' 'true' | ||
| assert_json_value '.url_redacted' 'true' | ||
| } | ||
|
|
||
| @test "inbox polls addressed items" { | ||
| run_smoke basecamp inbox --since now --jq '{ok: .ok, error: .error}' | ||
| # The inbox is served to agent principals only; a person's token gets 403. | ||
| if [[ "$status" -ne 0 ]]; then | ||
| assert_output_contains "agent principals only" | ||
| mark_unverifiable "Inbox is agents-only and this token is not an agent's" | ||
| fi | ||
| assert_json_value '.ok' 'true' | ||
| } | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.