Repository navigation
feat(apps): let an installed app put a record on a crewmate's Dashboard page - #24698
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the app route reuses the cron's single append path, takes the writer from the token claim, sits behind the existing Notes
[DESIGN-REVIEWED] 734aa72 Description read[DESCRIPTION-READ] 4e8a2c299d00525cbe84d3b4137251d42b98d689869c463cbae74b8c02cb231d That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The new app route is opt-in through a Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: let an installed app show a value on a crewmate's Dashboard page (closes #16521). This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 734aa72 Description read[DESCRIPTION-READ] ab2476dfdc1a96a5b7c206a4265c3109ac7d29ee2b8ac89f4bb1c8ffe366adb4 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
bbb1f5b to
7a7a1d4
Compare
7a7a1d4 to
c8d0c4d
Compare
b427aec to
b1415ef
Compare
b1415ef to
8460af4
Compare
|
self-added: yes
|
|
self-added: yes
|
8460af4 to
7563a5e
Compare
c8d0c4d to
8453850
Compare
7563a5e to
c7878fa
Compare
8453850 to
f9a865f
Compare
iamwhatever
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES at 1fb6f22. This PR is also reserved for human review because it adds a new route that admits app tokens to write a crewmate's log.
The new app-author docs say the 64-type cap refuses (api-reference.md#L1093-L1096): "64 record types kept per crewmate. Caps refuse, never truncate." The custom fold does not refuse a 65th type. It deletes the least recently written key from any writer (projection_dashboard.py#L597-L602). As a result, one granted app that writes 64 distinct types silently removes other apps' and crons' values from that crewmate's page. The docs tell app authors this cannot happen.
Smallest fix: correct the Caps bullet to say the page keeps the 64 most recently written types across all writers and drops the oldest. Alternatively, refuse a new app type at the door once the crewmate's fold is full, if apps should not be able to evict each other.
The rest of the route looks sound. The writer comes from the token claim and the crewmate from the slug, the <app>__<type> key splits one way, the quota is counted before the body is read, and the scrub-and-append door is shared with the cron route.
— crew-pr-reviewer (r133)
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#24698]: @iamwhatever, thanks for the review (5686321523 at 1fb6f22). Disposition at head 7cfc4df: 64-type cap described as a refusal. Fixed (docs + spec + tests). You are right:
Refuse a new app type at a full fold. Not done here; owner design question. It would change behaviour the cron door already has on main, add a fold read to every app write, and let a cron that holds all 64 types lock every app out. Whether apps may evict each other is for the owner to decide. The fold behaviour is unchanged by this push, so the docs now match main. No rebase: the branch merged cleanly onto main. Re-requesting your review. |
…rd page
An installed app could read a crewmate's event log but had no way to
write anything about that crewmate: its app token is turned away by
every member and dashboard route, and a backend spawned as a sandboxed
gateway child has the whole crew-log root hidden from it. Anything the
app did against a crewmate stayed in the app's own UI.
The app now has one door, and it is the door a script cron already
appends through. POST /api/member-records/{slug} {type, data}
resolves the writer from the token's app claim and the crewmate from
the path, then hands the record to the same record_through_door the
cron route calls: the same dashboard/custom_value entry in the
crewmate's own DM session log, the same caps (data at most 8 KiB and 8
levels deep, the whole line under MAX_ENTRY_BYTES), the same
30-a-minute quota per writer, the same `custom` fold. The
post-resolution half of the cron route is extracted into
record_through_door so the two routes share one append and one quota
and differ only in who they say is writing.
The grant is a manifest permissions.api entry, /api/member-records/*,
enforced by the token middleware's deny-by-default scope check and
approved by the owner at install or on the app's detail page like any
other API prefix. The route sits outside the app's own /api/apps/<name>
namespace, which an app token may call ungranted, and outside
/api/members/, whose routes refuse app tokens. No contributions
manifest block, no second approval record, no new consent screen, no
sandbox mask or seal, and no file under the data home is written by
the app.
The gateway stamps writer as app:<id> from request["app"]; the body is
read for type and data only, so writer, member, src, seq and time
cannot be supplied. An app's type is stored as <app>__<type>, the
kebab-case id with '-' written '_', then two underscores, then the
type. A page's field path is split on '.' and its segments admit only
[A-Za-z0-9_]; the door's shared type rule already holds every caller's
type to that alphabet, the rewritten id is in it too, so the key is one
bindable segment; a rewritten kebab id never contains '__' and
ends alphanumeric, so the first '__' is always the separator and the
key splits one way; and '__' is refused in every caller-supplied type,
cron and app alike, so no writer can spell another app's key. The
whole key is held to the 64-character type rule. A caller with no app
claim is refused app_token_required (the owner and internal callers
have their own write paths), a slug no crewmate has is 404, a slug two
crewmates share is 409, an id that is not kebab-case is refused rather
than keyed.
A record is text a page draws through its fold binding; context
assembly reads no crew-log fold, so it reaches a crewmate's model at
most as the one-line fold summary dashboard_fields already gives every
fold-sourced field.
Closes #16521
…t type The custom fold keeps the 64 most recently written types across every writer and drops the oldest past that; it never refused. Correct the app-author Caps bullet and the platform spec, and pin the cross-writer eviction and the doc wording with tests.
7cfc4df to
734aa72
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#24698]: Rebased onto main after the PR went CONFLICTING; head is now 734aa72. The rebase is conflict resolution only: the MCP route-table pin in |
CrysisDeu
left a comment
There was a problem hiding this comment.
Comment, not approving yet at 734aa72b. Maintainer decisions below; auto-merge is on, so I hold the approve until they are in.
The route itself is right: writer from the app's token claim, never the body; <app>__<type> splits one way; the same type / size / depth / scrub / quota checks as #24692; the grant is permissions.api approved at install and enforced by the existing token check.
Decisions, as maintainer:
- An app must not be able to evict other writers' records. Today an app with the grant can write 64 types in about two minutes and push every cron's and every other app's value off ANY crewmate's page, repeatedly (
crew_log/projection_dashboard.py:597-602,agent_panel_record_app.py:214). The docs now admit it; the code must prevent it. Give apps their own bounded namespace within the 64 (e.g. 16 types per app, evicting only that app's own oldest), or refuse the 65th type at the door for app callers. Documenting it is not enough. - The grant must be legible. The approval card shows the literal
/api/member-records/*, which also matches the gateway-only data leaf holding rules, goals and DM bindings (member_records.py:37). Give the prefix a human description that says "write records to every crewmate's Dashboard page", or move the route to a name that cannot be confused with the records leaf. - Uninstall must remove the app's records, or at least filter
writer == app:<id>for apps no longer installed; a later app under the same id must not inherit the keys and the label. Same bar #20483 set. - App strings must not reach the crewmate model unlabelled.
dashboard_agentic.py:792-805fold_summaryreturns an app string ≤80 chars verbatim as the field summary. For owner-written crons that was acceptable; for a third party it is a prompt-injection channel. Label it as app-written or withhold it.
Also: add one end-to-end test through token_auth_middleware with a minted app token, with and without the grant (test/test_agent_panel_routes_record_app.py stubs request["app"]). @iamwhatever's ask from 1fb6f22b is fixed in docs only and they have not re-reviewed; items 1 above settles the behaviour half.
Posted by code-reviewer (Kiro Crew member) on behalf of @CrysisDeu. Full report on file.
Problem / Motivation
Goal: An installed app can put a value on a crewmate's Dashboard page.
An installed app can read a crewmate's event log but cannot write anything about that crewmate. Its app token is turned away by every member and dashboard route (
_deny_app_caller), and a backend spawned as a sandboxed gateway child has the wholecrew-logroot hidden from it. An app that patrols a repository or tracks a budget for a crewmate has nowhere to say so; the work stays in the app's own UI.Why it matters
A user looking at a crewmate sees only what the gateway recorded. Every app result lives in a second place the user has to go and find. The only workaround, an app writing under the data home directly, is unfenced and would make a planted row attacker-authored state on the user's page.
Not a goal
contributionsmanifest block, no app-side event read stream, no projection publishing, noMAX_UNIT_LOG_BYTES, no CLI, no website store changes (the feat(apps): let an installed app contribute to a member's event log #12645 shape).permissions.apiapproval is the consent.hook_reconcileteardown for an app's value: a page binds the sharedcustomfold.What changed (motivation → approach → change)
Appending a typed entry to a crew log is an established pattern (Issue Radar's ledger), and #24692 adds the one record door for a script cron:
POST /api/agent-panel/dashboard/recordappends onedashboard/custom_valueentry to the crewmate's DM session log, stamped by the gateway, folded ascustom. The right shape for an app is a second caller of that same door, not a second writer.agent_panel_record.py: the post-body half of the cron route (scrub off-loop, scrubbed size, crew-log-on check, stamping, append, answer) is extracted intorecord_through_door(request, resolved, record_type, data). The cron route calls it unchanged in behaviour and keeps its quota-before-body ordering; the app route counts its own quota the same way._refusetakes anoperationfor the second caller's audit label;_record_body_refusalnow also refuses__in a type (reserved for the app key).agent_panel_record_app.py(new):POST /api/member-records/{slug}. Resolves the writer fromrequest["app"](the token's app claim) and the crewmate from the path (_member_names_for_slug: 404 for none, 409 for two), validates the body with the same_record_body_refusal, relies on the door's shared type rule (custom_type_name_ok,[A-Za-z0-9_]+, so a page's field path can bind it), stores the type as<app>__<type>(the kebab id with-written_, then__, then the type; held to the 64-character rule), then callsrecord_through_door. The rewritten kebab id never contains__and ends alphanumeric, so the first__is always the separator and the key splits one way;__is refused in every caller-supplied type (_record_body_refusal), cron and app alike, so no writer can spell another app's key. A caller with no app claim is refusedapp_token_required.permissions.api: ["/api/member-records/*"], enforced by the token middleware's existing deny-by-default scope check and approved at install or on the detail page like any other prefix. The route is outside/api/apps/<name>(callable ungranted) and outside/api/members/(refuses app tokens).agent_panel.register_agent_panel_routesand restated on the boot path inserver_runtime/mcp_routes.py(the deferred binder), as the contract test requires.app-kit/api-reference.md(new "Member records" section and endpoint row),manifest-reference.md(permissions.apihint),app-kit-platform.md§24a,crew-log-projection.mdcustomrow,reference/crew-log/session-types.mddashboard/custom_value,feature-map/README.mdMate dynamic dashboard row (handler and endpoint).Where an app backend runs and what it can touch, and whether crew-log entries reach a crewmate's model, are answered in the #24669 design note and restated in §24a: a command-entry backend is a sandboxed child with
crew-loghidden; context assembly reads no crew-log fold, so a record reaches a model at most as the one-linefold_summaryrow ofdashboard_fields.Backwards compatibility
Compatible: one new route and one new
permissions.apiprefix; nothingmainaccepts today stops working. The cron door (#24692) merged minutes before this; one of its messages now says "send the record again", and refusing__in a type is the one tightening on it, in the same release, so no released writer is affected.Removes nothing: the change adds a route and a function; no path, record or key on
mainis removed. The__refusal narrows an unreleased type grammar by one spelling.Tests
test/test_agent_panel_routes_record_app.py(30 tests): the owner's cookie and an internal caller with no app claim are refusedapp_token_required; the crew-panel switch closes the door; a slug no crewmate has is 404 and a malformed slug never reaches the config scan; a slug two crewmates share is 409; the cron door still 404s an app token; the route is behind thepermissions.apigrant and not the app's own namespace (pinned againsttoken_auth_app_scope.app_token_path_allowed); malformed, oversize and deep records are refused before any append; a type with.,-or__is refused; a type that fits alone but not behind the app id is refused naming the stored key;app_record_typesplits one way for the pairs a hyphen join collapsed (github+pr_statusvsgithub-pr+status); the cron door refuses a type spelling an app's key; the quota is per app and refuses past the window; a record lands under<app>__<type>withwriter: app:<id>andmember: <slug>and folds for the page;writer,member,crew_key,srcin the body are ignored; two apps writing the same type never share a key; no live unit is 409; a failed append is 503 with nothing pushed.test/test_agent_panel_facade.py: the new owner joins the family list.test/test_dashboard_server_composition_contract_reach.py: the MCP route table gains one row (314) and both boot chains one_deferred, the same way #24692 updated them.Proof: with the
add_post("/api/member-records/{slug}", ...)line removed, 19 of the first 22 new tests fail (the three that pass are the scope-gate unit test and the two 404 expectations). Fulltest_agent_panel*,test_cron_script_sessions,test_entry_types_facade,test_crew_log_typesand the route-contract suites: 717 passed.test_api_server,test_members_handler_facade,test_facade_mirror_guards: 866 passed locally on the rebased head.Manual verification
N/A — unit coverage sufficient: the route's refusals, the stamping and the fold round trip are all exercised through the mounted aiohttp app; the
permissions.apienforcement is the existing middleware, pinned by the scope-gate test.Related Issues
Closes #16521
Builds on #24692 (the record door for #24669), now merged; this PR is one commit on
main.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.