Skip to content

spec: declare the recycle-bin surface — the sys_recycle_bin object, the retention hook and the restore refusals (#3146 slice 2) #30235

Closed

Description

@objectstack-fleet

triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

Filing gate: ③ a split the parent needs, asked by domain:server#4 (Request: triage · #3146). ⛔ Not a claim.

Blocked-by: #30234
Part of #3146 · Ruling-ref: 6629858351 (the recycle-bin shape, maintainer 「同意,企业版功能在 cloud 中立卡后续开发」)

Wanted

The spec half of the ruled shape:

  • the recycle-bin system object (for example sys_recycle_bin, one entry per delete operation);
  • any object-level key the ADR names;
  • the host retention resolver hook's contract (days only);
  • the restore refusal codes the ADR lists.

A protocol addition. It ships with the ADR's readers named, and its liveness rows carry them.

Order: after #30234 (the ADR). The engine slice builds on it.


Generated by Claude Code

Activity

  1. added
    enhancement
    priority:p1
    domain:spec
    pm:blocked
    pm:blocking
    on Nov 5, 2026
  2. objectstack-fleet commented on Nov 5, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#3 · os-support-ai · session_01WGufzfgvGexKn9vLHsy89K

    Claim: PM loop round 24 (p1)
    Session: session_01WGufzfgvGexKn9vLHsy89K
    Account: os-support-ai
    Branch: the card thread's own claude/project-thread-* branch, named in the dev's hand-back and restated in a later claim (a measured platform exception to claude/issue-30235-…)
    Worktree: objectstack-issue-30235
    Domain: domain:spec
    Seat: domain:spec#3
    File surface: the spec declarations ADR-0148 D5 assigns this card: the sys_recycle_bin system object, the host retention resolver hook's contract (days only), the three restore refusal codes in the ADR-0112 error-code ledger, the restored event name, the two grant keys (restore own deletions; bin admin), their tests, liveness rows naming the readers in #30237 / #30239, and the changeset. ⛔ Not the engine's delete path, restore, purge, the TTL reap or the permission mapping (#30237); not the Console (#30239); not the tombstoned enable.trash / softDelete / allowRestore / allowPurge or the retired apiMethods values.
    Container & model: L, mode:thread, model: TIER_DEFAULT, effort: high
    Clause-②: yes (protocol addition: new spellings with their readers named; no tombstoned key returns)
    Metadata-protocol: added
    Responsibility: a deleted record is gone for good, with no bin to restore it from | the recycle-bin surface has no spec declarations for the engine and Console to build on | every org that deletes business records (#3146)
    Thread-read: none
    Premise: holds at origin/main 70981e63: ADR-0148 is on main (PR #30263, merged at f506b79d), and the maintainer ratified D7's eight choices (6659364907 on #30234).
    Human floor: the maintainer's recycle-bin ruling 6629858351 and the D7 ratification 6659364907; the framework knows days, never plans.
    Serial constraints: none known; #30237 and #30239 wait on this card.

  3. added
    pm:dispatched
    and removed
    pm:blocked
    on Nov 5, 2026
  4. objectstack-fleet commented on Nov 5, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#3 · os-support-ai · session_01WGufzfgvGexKn9vLHsy89K

    Claim: PM loop round 24 (p1), restated with the branch
    Session: session_01WGufzfgvGexKn9vLHsy89K
    Account: os-support-ai
    Branch: claude/project-thread-jpl1gr (card thread session session_01WGufzetvYmJLKYUzZnwSke; a measured platform exception to claude/issue-30235-…)
    Worktree: objectstack-issue-30235
    Domain: domain:spec
    Seat: domain:spec#3
    File surface: the spec declarations ADR-0148 D5 assigns this card: the sys_recycle_bin system object, the host retention resolver hook's contract (days only), the three restore refusal codes in the ADR-0112 error-code ledger, the restored event name, the two grant keys (restore own deletions; bin admin), their tests, liveness rows naming the readers in #30237 / #30239, and the changeset. ⛔ Not the engine's delete path, restore, purge, the TTL reap or the permission mapping (#30237); not the Console (#30239); not the tombstoned enable.trash / softDelete / allowRestore / allowPurge or the retired apiMethods values.
    Container & model: L, mode:thread, model: TIER_DEFAULT, effort: high
    Clause-②: yes (protocol addition: new spellings with their readers named; no tombstoned key returns)
    Metadata-protocol: added
    Responsibility: a deleted record is gone for good, with no bin to restore it from | the recycle-bin surface has no spec declarations for the engine and Console to build on | every org that deletes business records (#3146)
    Thread-read: 6659592591
    Premise: holds at origin/main 70981e63: ADR-0148 is on main (PR #30263, merged at f506b79d), and the maintainer ratified D7's eight choices (6659364907 on #30234).
    Human floor: the maintainer's recycle-bin ruling 6629858351 and the D7 ratification 6659364907; the framework knows days, never plans.
    Serial constraints: none known; #30237 and #30239 wait on this card.

  5. objectstack-fleet commented on Nov 5, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#3 · os-sales · session_01L6bhgTqqeHSwZYJmApbDCa

    Takeover · #30235 · 2026-11-05T15:50Z

    ① Release. The claims 6659592591 and 6659650100 of domain:spec#3 · os-support-ai · session_01WGufzfgvGexKn9vLHsy89K are taken over. Whose order: the maintainer (os-sales). The words: 「spec 前任没流量了,接手他们的座位和在手工作」. Where: the project chat of the os-sales account's project, with the previous holder's hand-off as this seat thread's opening message (seat post #18883, takeover audit there). The previous holder stopped on its own maintainer's 「停止所有开发」; its card thread session_01WGufzetvYmJLKYUzZnwSke has no traffic left.

    ② Assignee: os-support-ai → os-sales, in the same stroke as this comment.

    ④ Hand-over record. Branch claude/project-thread-jpl1gr, last pushed 884764a2da1e4d4f8dca663f28e362753ac1e33f, no PR. Status: the spec surface is written (packages/spec/src/data/recycle-bin.zod.ts and its test, the three ledger rows, the two grant keys in permission.zod.ts, regenerated artifacts, a changeset) and check:generated was green at that sha by the previous holder's hand-off (UNVERIFIED here); not done: the full spec vitest, the derived gates, the PR body and the PR. git merge-tree of origin/main and 884764a2 writes a clean tree.

    Seat decisions carried from the previous holder (binding on the resume; recorded again on #30237 at landing):

    1. The restored event is a spec constant only (RECORD_RESTORED_EVENT); engine: snapshot deletes into the recycle bin, restore under original ids, purge, and the TTL reap (#3146 slice 3) #30237 adds it to DataEventType / RealtimeEventType when it emits it.
    2. sys-recycle-bin.object.ts, its plugin registration and the PLATFORM_OBJECTS_BY_PACKAGE row move to engine: snapshot deletes into the recycle bin, restore under original ids, purge, and the TTL reap (#3146 slice 3) #30237; this card declares the object's name and its full field contract in spec.
    3. The two grant keys go in as planned liveness rows, naming their readers in engine: snapshot deletes into the recycle bin, restore under original ids, purge, and the TTL reap (#3146 slice 3) #30237 / ui: the admin recycle-bin page (list, restore, empty) and the 已删除 · 撤销 toast (#3146 slice 4) #30239.
    4. The three restore refusal codes enter the error-code ledger ahead of their producer (engine: snapshot deletes into the recycle bin, restore under original ids, purge, and the TTL reap (#3146 slice 3) #30237).

    Claim: PM loop round 1 (p1), taken over
    Session: session_01L6bhgTqqeHSwZYJmApbDCa
    Account: os-sales
    Branch: the new card thread's own claude/project-thread-* branch (a measured platform exception to claude/issue-30235-…), restated in a later claim once the thread is open
    Worktree: objectstack-issue-30235
    Domain: domain:spec
    Seat: domain:spec#3
    File surface: unchanged from claim 6659650100: the spec declarations ADR-0148 D5 assigns this card: the sys_recycle_bin field contract, the host retention resolver hook's contract (days only), the three restore refusal codes in the ADR-0112 error-code ledger, the restored event name, the two grant keys (restore own deletions; bin admin), their tests, liveness rows naming the readers in #30237 / #30239, the regenerated artifacts and the changeset. ⛔ Not the engine's delete path, restore, purge, the TTL reap or the permission mapping (#30237); not the Console (#30239); not the tombstoned enable.trash / softDelete / allowRestore / allowPurge or the retired apiMethods values.
    Container & model: L, mode:thread, model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate; the contract review of the published schema runs at CONTRACT_REVIEW_TIER), effort: high
    Clause-②: yes (widening)
    Metadata-protocol: added
    Responsibility: a deleted record is gone for good, with no bin to restore it from | the recycle-bin surface has no spec declarations for the engine and Console to build on | every org that deletes business records (#3146)
    Thread-read: 6659650100
    Premise: holds: ADR-0148 is on main (PR #30263), the maintainer's recycle-bin ruling 6629858351 and the D7 ratification 6659364907 stand, and no recycle-bin.zod.ts exists on origin/main b17dbcf2.
    Serial constraints cleared: none in flight on these files; #30237 and #30239 wait on this card.
    Resume-from: claude/project-thread-jpl1gr@884764a2da1e4d4f8dca663f28e362753ac1e33f


    Generated by Claude Code

  6. objectstack-fleet commented on Nov 5, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#3 · os-sales · session_01L6bhgTqqeHSwZYJmApbDCa

    Claim: PM loop round 1 (p1), restated with the branch
    Session: session_01L6bhgTqqeHSwZYJmApbDCa
    Account: os-sales
    Branch: claude/project-thread-uwrsn3 (the card thread's own branch, a measured platform exception to claude/issue-30235-…); card thread session session_01L6bhgWAJDEGE4g7p29M3zq
    Worktree: objectstack-issue-30235
    Domain: domain:spec
    Seat: domain:spec#3
    File surface: unchanged from the takeover claim 6662490518.
    Container & model: L, mode:thread, model: TIER_DEFAULT, effort: xhigh (the project's rule for p1 / L cards; the takeover claim said high)
    Clause-②: yes (widening)
    Metadata-protocol: added
    Responsibility: unchanged from the takeover claim 6662490518.
    Thread-read: 6662490518
    Premise: holds, as read on the takeover claim 6662490518.
    Serial constraints cleared: none in flight on these files.
    Resume-from: claude/project-thread-jpl1gr@884764a2da1e4d4f8dca663f28e362753ac1e33f (merged into the thread branch, no rebase)


    Generated by Claude Code

  7. objectstack-fleet commented on Nov 5, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#3 · os-sales · session_01L6bhgWAJDEGE4g7p29M3zq
    os-dev-report

    Stamp: 2026-11-05T16:34Z

    {
      "issue": 30235,
      "status": "done",
      "branch": "claude/project-thread-uwrsn3",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/30577",
      "head": "25af14cf1fd660284bb2f44722a788ffbe6a0f32",
      "session": "session_01L6bhgWAJDEGE4g7p29M3zq",
      "premise_still_valid": true,
      "summary": "Resumed claude/project-thread-jpl1gr@884764a2 by merge (8307de6d, no rebase), then merged origin/main c23eafa8 (already up to date). Re-read all five picked-up commits against ADR-0148 D1-D7 and the seat's four decisions and kept every hunk: packages/spec/src/data/recycle-bin.zod.ts (sys_recycle_bin name and RECYCLE_BIN_ENTRY_FIELDS with RecycleBinEntrySchema key for key, the snapshot shape, the retention hook RecycleBinRetentionResolver with the same (token: string | undefined) input as resolveFeatures, OS_RECYCLE_BIN_RETENTION_DAYS and default 30, the refusal text, the three restore refusal codes at 409, RECORD_RESTORED_EVENT as a constant only, RECYCLE_BIN_GRANT_KEYS), the three ledger rows under @objectstack/objectql, the two optional grant keys allowRestoreOwnDeleted and manageRecycleBin with planned liveness rows naming #30237 / #30239, and the regenerated artifacts. One correction (25af14cf): the changeset's Clause-② line carried a free-text arm and now reads yes (widening), as the claim declares. Draft PR 30577 opened through the relay pr_create, no assignees, no reviewers, no labels.",
      "tests": "At head 25af14cf: spec build VERDICT command-exit 0; spec check:generated exit 0, all 14 artifacts up to date; spec test (vitest --project local) VERDICT command-exit 0, Test Files 816 passed (816), Tests 25660 passed, 1 todo; spec typecheck (tsc + scripts typecheck + test typecheck) VERDICT command-exit 0; recycle-bin.zod.test.ts alone 1 file, 16 tests passed. Full turbo build (filter not docs) 119 successful of 119. Downstream consumers in the ...@objectstack/spec direction that the widened types reach: plugin-security, core and objectql typecheck each VERDICT command-exit 0; plugin-security test Test Files 244 passed (244), Tests 5379 passed, 45 skipped; core vitest src/security Test Files 63 passed, Tests 1221 passed; lint validate-security-posture + validate-retired-permission-residue Test Files 2 passed, Tests 209 passed. No ablation: declarations only, no tested runtime behaviour changes.",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at 25af14cf: 29 paths vs merge base c23eafa8, 106 derived commands, all run serially on that head after the full build, each exit captured before any pipe: 106 x exit 0. --ran reconciliation: 106 derived, 106 run, 0 NOT-MEASURED, 0 UNRUN (a derived zero, none exit 3). check-changeset-no-major --base origin/main exit 0 (no major; protocol lockstep 18 / 18.3.0) and re-run offline with the PR body as the --event payload exit 0 (LEVEL AXIS: yes (widening) + added, no moved package graded patch). check-adr-0087-registration --base origin/main exit 0 on the committed head (no declared-breaking changeset, 1 non-breaking seen). PR check-runs: in_progress at report time, not re-run locally; pnpm lint is CI's run.",
      "dogfood_battery": "n/a - no ! in the PR title and no (narrowing) arm",
      "line_budget": "870 changed lines (+852 / -18) in 29 files, under the 3000 human-merge threshold; 572 hand-written (recycle-bin.zod.ts 295, its test 189, permission.zod.ts 20, type-alias pin 20, ledger 15 + its test 15, changeset 14, data index 4), the rest regenerated artifacts and the strictness-ledger rows",
      "files_changed": 29,
      "mcp_calls": "7 - all reads, no write tool: issue_read get #30235, issue_read get_comments #30235 (twice, the second to verify the newest Claim names this branch), issue_read get_comments #30234, issue_read get #3146, issue_read get_comments #3146, pull_request_read get #30577",
      "api_writes": "0 REST proxy writes. Writes: git push (twice, not a REST write), relay pr_create (draft, read-back identical, 14882 bytes, run 42065627235), and this comment through post-stamped.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: #30237 - noted in the PR's Acceptance notes: GRANT_BITS in packages/core/src/security/effective-object-permissions.ts, ObjectPermissionVerbTarget / objectPermissionGrants in packages/spec/src/security/permission.zod.ts and OPERATION_TO_PERMISSION in plugin-security list neither new grant key; the reader card adds them and flips both liveness rows to live",
        "carrier: #30239 - noted: CAPS in ui/packages/app-shell/src/views/metadata-admin/previews/PermissionPreview.tsx shows neither grant key",
        "carrier: #30237 - Skills-docs line: skills/objectstack-api/SKILL.md says there is no recycle bin, true until the engine slice ships"
      ],
      "deviations": [
        "Commit trailers: the harness asked for a model-named Co-Authored-By line; commit 25af14cf carries the repository's model-free pair (Claude-Session + Co-authored-by: Claude), which the pre-push hook requires. The merge commit 8307de6d carries no trailer.",
        "Harness post-create step (assign the requester, request their review through MCP) not taken, per .claude/agents/os-dev.md rule 2 and the brief: pr_create carried no assignees and no reviewers; the seat sets them at hand-over.",
        "Harness PR-subscription posture not taken: per os-dev.md the dispatch contract wins, so the PR's CI is reported as in_progress and later reds come back as a patch round on the same claim.",
        "Branch is the harness-pinned card-thread branch claude/project-thread-uwrsn3 (the claim's measured platform exception), not claude/issue-30235-slug.",
        "No scripts/adr-anchors entry for recycle-bin.zod.ts: the claim's file surface names none; the ADR id is in the code at each declaration. The seat may order one."
      ]
    }
  8. objectstack-fleet commented on Nov 5, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#3 · os-sales · session_01L6bhgTqqeHSwZYJmApbDCa

    ACCEPT → PR #30577 comment 6664274007 · head 25af14cf1fd660284bb2f44722a788ffbe6a0f32

    Contract review 6664134926 PASS on the same head. Marked ready and auto-merge armed through the relay; it lands through the merge queue. Two should-fix items and the reader-side additions are carried to #30237 (listed in the ACCEPT's Carried line).


    Generated by Claude Code

  9. objectstack-fleet commented on Nov 5, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#3 · os-sales · session_01L6bhgTqqeHSwZYJmApbDCa

    Landed: PR #30577 merged at d9d42d4e. @objectstack/spec now declares the recycle bin's surface (ADR-0148 D5): the sys_recycle_bin entry contract and snapshot shape, the host retention resolver hook (positive whole days, default 30, OS_RECYCLE_BIN_RETENTION_DAYS), the three restore refusal codes at 409, data.record.restored as a constant, and the two planned grant keys allowRestoreOwnDeleted / manageRecycleBin. Nothing reads them yet; every delete is still physical.

    Probe on origin/main after the merge Reading
    git merge-base --is-ancestor d9d42d4e origin/main (tip 4831d500) ancestor
    git grep -l -F the landed names over packages/spec and content/docs/references RECYCLE_BIN_OBJECT 4 files, allowRestoreOwnDeleted 8 (authorable surface, liveness, three reference pages), RESTORE_PARENT_PURGED 6 (ledger and its reference pages), RECORD_RESTORED_EVENT 4: the regenerated artifacts came through the queue merge

    The merge queue landed it at 2026-11-05T17:44:33Z and Fixes #30235 closed the card as completed; this seat removes pm:dispatched and pm:blocking in the same stroke. #30237 is no longer blocked by this card: the seat decisions and the carried items are recorded there.


    Generated by Claude Code

  10. removed
    pm:dispatched
    pm:blocking
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:specenhancementpriority:p1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions