askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
dbbasic-package.json · 6.3 KB · 84 lines
| 1 | { |
| 2 | "id": "app-worker", |
| 3 | "name": "Worker", |
| 4 | "version": "0.2.0", |
| 5 | "description": "Public creator profiles + follow graph + moderated guestbook -- a faithful port of a private predecessor-system audit, not part of this repo: a public profile (bio, free-text skills, experience, location, education, website, social links), a directed follower->following edge (follows), and a moderated guestbook (profile_comments, pending/approved/rejected, only-approved is publicly visible). This is a PUBLIC CREATOR PROFILE, NOT a task marketplace: the source had no skills-matching, no availability, and no rating/review system (those were commented-out stubs in the source model and are not built here). Storefront/cart/checkout in the source came from its catalog app (a separate concern -- see this codebase's app-catalog/app-orders, not touched by this package). Public profile pages need a site_routes record mapping /u/{username} to site_profile, and /profile/edit to site_profile_edit -- not seeded by this package, same precedent as app-notes' /notes/{note_id:uuid}. Deferred to a later slice (fields are carried, behavior is not): anonymous guestbook posting (v1 is signed-in only; the source's anonymous path needs the anti-abuse stack in plan/vocabulary/02-public-write-hardening-spec.md -- rate limits, honeypot, timing token -- none of which this package builds), cross-user comment moderation (the profile_comments status transitions are owner-gated to the COMMENTER's owner_id, not the profile owner -- the same cross-user moderation gap app-forum documents for is_pinned/is_locked/is_solved; a profile-owner-scoped or moderator-role permission rule closes it, not built here), full profile aggregation of the user's other public content (this package includes one opportunistic aggregation -- recent public articles, fetched without a hard dependency on app-articles -- links/notes/files/templates aggregation is not built), ratings/reviews (a commented-out stub in the source model, never built there, not built here), a storefront/cart/checkout (that is the catalog's orders, a separate concern from this package), and follow-edge deduplication (follows has no server-side unique_together equivalent -- the follow button checks client-side before creating an edge, but the raw records API does not enforce uniqueness). 0.1.1: a row a registered user writes could point at anybody's record, because the rules asked only that the new row be the writer's own. Every pointer a non-admin can write now declares relation.requires (profile_comments.profile_id read), so over the API a row points only at a record its writer may see, or, where it moves money, stock or state of what it points at, may update; a record they may not see is answered like a missing one (docs/permissions-model.md, 'Pointing at a record you may not act on'). 0.1.2: profile_comments.status was `public: hidden`, and `public` matches every caller, so nobody -- the author, moderators and the admin token included -- could read or set it over the API. It now has thread_comments.status's grant: the author reads it, role:moderator may edit it (though, as for thread_comments, no rule yet lets a moderator update someone else's comment, so status still cannot be moved over the API), everyone else has it hidden; the profile page shows other people's approved comments again (it tested a status it could never read). 0.2.0: guestbook moderation works over the API. role:moderator reads every comment (pending and rejected included) and may update one, and that update can change nothing but status: profile_id, author_name, author_url, content and owner_id are editable by the comment's author and admins only, and a moderator cannot move the status of their own comment. The status moves (pending -> approved, pending -> rejected, approved -> rejected) lose their guard: it required the comment to be the mover's own, which since 0.1.2 nobody could use; the field's permissions now decide who moves status. A moderator (a person, or an AI agent holding a moderator's API key) approves and rejects; nobody else's access changes, and moderators get no delete. The cross-user moderation gap above is closed for moderators (not for the profile owner). New attention count for moderators: other people's comments waiting in pending (profile_comments_to_moderate), opening a new page, /guestbook/pending (a seeded view: the pending comments the viewer may read; it lists, the decisions are a status PUT over the API). Depends on app-nav and app-views for them. On upgrade: reinstall the package, then give the role to whoever moderates (docs/permissions-model.md, 'Comment moderation'); the commenters' rule keeps its old reason text on an upgraded box (the installer matches rules without it).", |
| 6 | "compatibility": { |
| 7 | "dbbasic_object_server": ">=0.1.0" |
| 8 | }, |
| 9 | "dependencies": ["app-nav", "app-views"], |
| 10 | "objects": [ |
| 11 | { |
| 12 | "id": "site_profile", |
| 13 | "path": "objects/site/profile.py" |
| 14 | }, |
| 15 | { |
| 16 | "id": "site_profile_edit", |
| 17 | "path": "objects/site/profile_edit.py" |
| 18 | } |
| 19 | ], |
| 20 | "schemas": [ |
| 21 | { |
| 22 | "collection": "profiles", |
| 23 | "path": "schemas/profiles.json" |
| 24 | }, |
| 25 | { |
| 26 | "collection": "follows", |
| 27 | "path": "schemas/follows.json" |
| 28 | }, |
| 29 | { |
| 30 | "collection": "profile_comments", |
| 31 | "path": "schemas/profile_comments.json" |
| 32 | } |
| 33 | ], |
| 34 | "permissions": [ |
| 35 | { |
| 36 | "path": "permissions/rules.json" |
| 37 | } |
| 38 | ], |
| 39 | "seed": [ |
| 40 | { |
| 41 | "collection": "profiles", |
| 42 | "path": "seed/profiles.tsv" |
| 43 | }, |
| 44 | { |
| 45 | "collection": "follows", |
| 46 | "path": "seed/follows.tsv" |
| 47 | }, |
| 48 | { |
| 49 | "collection": "profile_comments", |
| 50 | "path": "seed/profile_comments.tsv" |
| 51 | }, |
| 52 | { |
| 53 | "collection": "views", |
| 54 | "path": "seed/views.tsv" |
| 55 | }, |
| 56 | { |
| 57 | "collection": "site_routes", |
| 58 | "path": "seed/site_routes.tsv" |
| 59 | } |
| 60 | ], |
| 61 | "migrations": [], |
| 62 | "attention": [ |
| 63 | { |
| 64 | "id": "profile_comments_to_moderate", |
| 65 | "collection": "profile_comments", |
| 66 | "where": {"status": "pending", "owner_id": {"op": "ne", "value": "$user_id"}}, |
| 67 | "label": "Guestbook comments to moderate", |
| 68 | "path": "/guestbook/pending", |
| 69 | "group": "Publishing", |
| 70 | "severity": "normal" |
| 71 | } |
| 72 | ], |
| 73 | "nav": [ |
| 74 | { |
| 75 | "id": "profile", |
| 76 | "label": "Profile", |
| 77 | "path": "/profile/edit", |
| 78 | "blurb": "Your public creator profile: bio, skills, experience", |
| 79 | "surface": "member", |
| 80 | "group": "Publishing", |
| 81 | "order": 230 |
| 82 | } |
| 83 | ] |
| 84 | } |