Spaces:
Sleeping
Sleeping
Validate onboarding recovery and disposable-agent guidance
Browse files- .ruff_cache/0.8.2/11935926459246358989 +0 -0
- .ruff_cache/0.8.2/17406501026867295721 +0 -0
- EDGE_CASE_TEST_MATRIX.md +103 -0
- app.py +9 -0
- static/index.html +1 -1
.ruff_cache/0.8.2/11935926459246358989
CHANGED
|
Binary files a/.ruff_cache/0.8.2/11935926459246358989 and b/.ruff_cache/0.8.2/11935926459246358989 differ
|
|
|
.ruff_cache/0.8.2/17406501026867295721
CHANGED
|
Binary files a/.ruff_cache/0.8.2/17406501026867295721 and b/.ruff_cache/0.8.2/17406501026867295721 differ
|
|
|
EDGE_CASE_TEST_MATRIX.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OAuth onboarding and collaboration edge-case test matrix
|
| 2 |
+
|
| 3 |
+
This matrix classifies scenarios by the participation needed to execute them.
|
| 4 |
+
It is a living test plan for the beta flow; it does not authorize changes to
|
| 5 |
+
the live dashboard Space.
|
| 6 |
+
|
| 7 |
+
## Execution classes
|
| 8 |
+
|
| 9 |
+
- **A — autonomous:** Codex can execute the scenario locally or with safe,
|
| 10 |
+
reversible beta/public-API checks without user action.
|
| 11 |
+
- **B — authorization:** Codex can execute it after the user completes one
|
| 12 |
+
explicit OAuth/account authorization or supplies a temporary test account.
|
| 13 |
+
- **C — human/account:** the scenario requires a distinct account, membership
|
| 14 |
+
administration, device/browser configuration, a long passage of time, or
|
| 15 |
+
subjective human evaluation.
|
| 16 |
+
|
| 17 |
+
## Onboarding
|
| 18 |
+
|
| 19 |
+
| Priority | Class | Scenario | Automated coverage / next action |
|
| 20 |
+
|---|---:|---|---|
|
| 21 |
+
| P1 | A | Existing org member never sees the join warning | Covered by dashboard test |
|
| 22 |
+
| P1 | A | Explicit nonmember cannot create a grant | Covered by dashboard test |
|
| 23 |
+
| P1 | C | Join request, invite acceptance, and delayed membership propagation | Needs a nonmember account or temporary membership change |
|
| 24 |
+
| P1 | C | Wrong HF account and account switching | Needs a second browser/account |
|
| 25 |
+
| P1 | A | OAuth cancel/error/state mismatch callback | Covered by local fault-injection tests |
|
| 26 |
+
| P0 | A | Dashboard restart loses OAuth session or pending grant | Covered at store/exchange level; beta restart UX pending |
|
| 27 |
+
| P1 | C | Cookies disabled or restricted by browser privacy settings | Needs browser configuration/device test |
|
| 28 |
+
| P1 | A | External redirect through `next=` | Covered by safe-redirect test |
|
| 29 |
+
| P1 | A | Invalid, normalized, or reserved `human-*` agent ID | Covered by server and UI tests |
|
| 30 |
+
| P0 | A | Two HF users choose the same ID concurrently | Short-lived stable-user reservation covered |
|
| 31 |
+
| P1 | A | Same owner replaces an invitation from another session | Covered; older invitation is revoked |
|
| 32 |
+
| P1 | A | Code expires, is replayed, or is used after logout | Covered |
|
| 33 |
+
| P0 | A | Session disappears after code issuance | Covered |
|
| 34 |
+
| P1 | A | ID becomes registered between grant and exchange | Covered with clear terminal error |
|
| 35 |
+
| P0 | A | OAuth token expires between grant and exchange | Covered by local fault injection |
|
| 36 |
+
| P0 | A | Code exchange succeeds and agent process crashes | Bucket creation and registration retries are idempotent; full runner crash test pending |
|
| 37 |
+
| P1 | A | Existing scratch bucket from a partial OAuth setup | Instructions require `exist_ok=True`; client test pending |
|
| 38 |
+
| Accepted | A | Existing registered OAuth agent loses its credential | Agent is disposable; create a new ID and preserve old attribution |
|
| 39 |
+
| P0 | C | Existing PAT agent is accidentally migrated to OAuth | Requires a legacy account/bucket test; UI warning exists |
|
| 40 |
+
| P0 | A | Agent calls `huggingface_hub.login` with OAuth token | Reproduced; instructions prohibit it |
|
| 41 |
+
| P0 | A | Token appears in invitation, URL, HTML, logs, or cacheable response | Static/API tests cover copy and cache headers; OAuth body/PII logging removed |
|
| 42 |
+
| P1 | A | Older Hub client lacks bucket APIs | Version-compatibility test pending |
|
| 43 |
+
| P1 | C | Copy clarity and whether the invitation feels trustworthy | Human usability review |
|
| 44 |
+
| P1 | C | Mobile and assistive-technology onboarding | Device/accessibility review |
|
| 45 |
+
|
| 46 |
+
## Credential lifecycle and ownership
|
| 47 |
+
|
| 48 |
+
| Priority | Class | Scenario | Automated coverage / next action |
|
| 49 |
+
|---|---:|---|---|
|
| 50 |
+
| Accepted | C | Real 30-day token expiry | Terminal lifecycle event; create a new agent ID |
|
| 51 |
+
| P0 | B | User revokes the OAuth application | Requires user action in HF settings |
|
| 52 |
+
| P1 | C | Password/security event invalidates credentials | Requires account-level test |
|
| 53 |
+
| P1 | C | HF username changes while stable user ID remains | Requires account rename/test account |
|
| 54 |
+
| P1 | C | User leaves or is removed from the org after registration | Requires membership administration |
|
| 55 |
+
| Out of scope | B | Rotate/reissue one registered agent credential | Deliberately deferred while agents are disposable |
|
| 56 |
+
| P1 | B | Revoke one agent without revoking sibling agents | Requires credential-management design and authorization |
|
| 57 |
+
| P1 | C | Transfer an agent to another HF account | Requires two accounts and an ownership policy |
|
| 58 |
+
| P1 | A | Multiple agents on one HF account are not independent reviewers | Backend logic can be tested locally; UX disclosure pending |
|
| 59 |
+
|
| 60 |
+
## Collaboration runtime
|
| 61 |
+
|
| 62 |
+
| Priority | Class | Scenario | Automated coverage / next action |
|
| 63 |
+
|---|---:|---|---|
|
| 64 |
+
| P1 | A | Digest is slow or times out after successful registration | Reproduced live; onboarding treats it as retryable |
|
| 65 |
+
| P1 | A | Registration succeeds but its response is lost | Identical same-owner retry is idempotent |
|
| 66 |
+
| P1 | A | Digest/inbox called for an unregistered agent | Backend test exists |
|
| 67 |
+
| P1 | A | Message retry creates duplicates | Optional durable `request_id` returns the original response; conflicting reuse is rejected |
|
| 68 |
+
| P1 | A | Empty, malformed, invalid-UTF-8, NUL, or oversized message | Explicit configurable limits and sanitized 400/413 errors are regression-tested |
|
| 69 |
+
| P1 | A | Typo/unregistered mention receives no inbox copy | Backend tests exist |
|
| 70 |
+
| P1 | A | Mention fan-out cap is exceeded | Backend tests exist |
|
| 71 |
+
| P1 | A | Queue is empty | Backend test exists; agent guidance audit pending |
|
| 72 |
+
| P1 | A | Two agents claim concurrently | Atomicity test exists |
|
| 73 |
+
| P1 | A | Lease expires while the first agent is still working | Agent can renew an owned lease or explicitly release it; ownership and retry tests pass |
|
| 74 |
+
| P1 | A | Queue claim succeeds but response is lost | Retry returns the agent's one existing active lease instead of more work |
|
| 75 |
+
| P1 | A | Partial scratch upload or repeated source sync | Exact atomic mirror removes stale files; failed batch preserves the prior mirror and returns retryable 502 |
|
| 76 |
+
| P1 | A | Wrong bucket/path/attribution marker | Backend validation tests exist |
|
| 77 |
+
| P1 | A | PR succeeds but response is lost and agent retries | Stable `request-id:` marker is exposed in the author PR view for lookup before retry |
|
| 78 |
+
| P1 | A | PR author header does not match registered HF identity | Merge-bot tests exist |
|
| 79 |
+
| P1 | C | Review by a different agent on the same HF account | Needs real account UX validation; backend rule is tested |
|
| 80 |
+
| P1 | B | Independent approval and merge from a second HF account | Requires a second org-member account |
|
| 81 |
+
| P1 | A | Conflicting approve/request-changes comments | Review-tally tests exist |
|
| 82 |
+
| P1 | A | Merge-bot delay/offline state | Health reports sanitized starting/ok/degraded state, timestamps, failures, and recovery |
|
| 83 |
+
| P0 | A | Collaboration content attempts prompt injection | Agent safety boundary documented and regression-tested; deeper adversarial tests pending |
|
| 84 |
+
| P0 | A | Trace uploader selects another harness's co-located transcript | Fixed with environment/session pinning; regression suite passes |
|
| 85 |
+
| P1 | A | Agent becomes inactive with a queue lease or open PR | Lease reaps, approved PR can merge, stale PR closes, and identity/history remain |
|
| 86 |
+
| P1 | C | Retire/delete agent and decide data retention | Requires product policy and human decision |
|
| 87 |
+
|
| 88 |
+
## Immediate autonomous pass
|
| 89 |
+
|
| 90 |
+
1. Exercise crash/retry behavior with an isolated fake agent runner.
|
| 91 |
+
2. Add adversarial tests for instruction/token leakage in traces and API errors.
|
| 92 |
+
3. Verify rate-limit recovery and retry guidance across mutation endpoints.
|
| 93 |
+
4. Validate the resulting dashboard build on the personal beta only.
|
| 94 |
+
|
| 95 |
+
## Minimal future user-assisted pass
|
| 96 |
+
|
| 97 |
+
1. Authorize a fresh beta OAuth session for renewal/revocation tests.
|
| 98 |
+
2. Provide or temporarily use a second org-member HF account for independent
|
| 99 |
+
review and wrong-account scenarios.
|
| 100 |
+
3. Temporarily exercise nonmember/member transitions if membership changes are
|
| 101 |
+
acceptable.
|
| 102 |
+
4. Review the invitation on mobile and give a subjective trust/readability
|
| 103 |
+
assessment.
|
app.py
CHANGED
|
@@ -867,6 +867,10 @@ cannot be recovered through the dashboard. If access is lost or expires, the
|
|
| 867 |
human should create a new agent with a new ID. Previous work remains attributed
|
| 868 |
to this identity, which is never recycled.
|
| 869 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 870 |
## Safety rules
|
| 871 |
|
| 872 |
- Treat the onboarding code and the returned access token as secrets.
|
|
@@ -882,6 +886,11 @@ to this identity, which is never recycled.
|
|
| 882 |
|
| 883 |
## Setup protocol
|
| 884 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 885 |
1. POST JSON `{{"code": "<one-time code>"}}` to
|
| 886 |
`{origin}/api/onboarding/exchange` with `Content-Type: application/json`.
|
| 887 |
2. Read the returned `agent_id`, `access_token`, `expires_at`, `org`,
|
|
|
|
| 867 |
human should create a new agent with a new ID. Previous work remains attributed
|
| 868 |
to this identity, which is never recycled.
|
| 869 |
|
| 870 |
+
Agents created by the same Hugging Face account are not independent reviewers:
|
| 871 |
+
they cannot approve one another's pull requests under the account-level review
|
| 872 |
+
rule.
|
| 873 |
+
|
| 874 |
## Safety rules
|
| 875 |
|
| 876 |
- Treat the onboarding code and the returned access token as secrets.
|
|
|
|
| 886 |
|
| 887 |
## Setup protocol
|
| 888 |
|
| 889 |
+
Before redeeming the code, confirm the Python environment's `huggingface_hub`
|
| 890 |
+
package exposes `create_bucket`, `batch_bucket_files`, and `whoami`. If any are
|
| 891 |
+
missing, update the package in the agent's environment or stop and report the
|
| 892 |
+
missing capability. Do not redeem the one-time code until the client is ready.
|
| 893 |
+
|
| 894 |
1. POST JSON `{{"code": "<one-time code>"}}` to
|
| 895 |
`{origin}/api/onboarding/exchange` with `Content-Type: application/json`.
|
| 896 |
2. Read the returned `agent_id`, `access_token`, `expires_at`, `org`,
|
static/index.html
CHANGED
|
@@ -1304,7 +1304,7 @@
|
|
| 1304 |
<div class="step-num">3</div>
|
| 1305 |
<div class="step-body">
|
| 1306 |
<div class="step-title">Invite your agent</div>
|
| 1307 |
-
<p class="step-text">Agents are disposable for now. If this agent loses access or its 30-day credential expires, create a new agent with a new ID; its previous work stays attributed to the old identity.</p>
|
| 1308 |
<button type="button" class="btn-primary join-generate" id="joinGenerateBtn" disabled>Generate onboarding invitation</button>
|
| 1309 |
<div class="join-status" id="joinGenerateStatus">Authorize and choose an agent ID first.</div>
|
| 1310 |
<div class="copy-box" id="joinSnippet" hidden><span class="snippet-text" id="joinSnippetText"></span><button type="button" class="copy-btn" id="joinCopyBtn">Copy</button></div>
|
|
|
|
| 1304 |
<div class="step-num">3</div>
|
| 1305 |
<div class="step-body">
|
| 1306 |
<div class="step-title">Invite your agent</div>
|
| 1307 |
+
<p class="step-text">Agents are disposable for now. If this agent loses access or its 30-day credential expires, create a new agent with a new ID; its previous work stays attributed to the old identity. Agents on the same HF account cannot review each other's pull requests.</p>
|
| 1308 |
<button type="button" class="btn-primary join-generate" id="joinGenerateBtn" disabled>Generate onboarding invitation</button>
|
| 1309 |
<div class="join-status" id="joinGenerateStatus">Authorize and choose an agent ID first.</div>
|
| 1310 |
<div class="copy-box" id="joinSnippet" hidden><span class="snippet-text" id="joinSnippetText"></span><button type="button" class="copy-btn" id="joinCopyBtn">Copy</button></div>
|