Skip to content

One review date: review_by only; drop per-library review days and strict mode (#44, B) - #46

Open
hkrlogic wants to merge 1 commit into
simplify/agent-contractfrom
simplify/one-review-date
Open

hkrlogic wants to merge 1 commit into
simplify/agent-contractfrom
simplify/one-review-date

Conversation

@hkrlogic

Copy link
Copy Markdown
Owner

Part B of #44, stacked on #45. Retarget the base to main once #45 is merged.

One review date

  • Policy items no longer have a review_date field, and its "on or after effective date" check is gone. items.review_by is the only review date.
  • Migration 025_single_review_date.sql:
    • copies the published review_date into review_by where review_by is empty;
    • strips review_date from the Policy working row and both published copies, with the version and review-by triggers paused so it does not count as a new publish;
    • removes the field from Policy library schemas.
  • The Policy starter goes from 11 to 10 fields; the field-cap tests now add two fields instead of one.
  • Agents that still send review_date get "Unknown field(s): review_date".

No per-library knobs

  • On every publish, Policy and Procedure libraries get publish day + 90 days.
  • Other libraries get no automatic date; a publisher sets one per item with the item page's "Set date" form, and later publishes keep it.
  • Removed:
    • the Freshness settings form and POST /libraries/:id/freshness;
    • the libraries.review_days and libraries.strict_freshness columns;
    • the SQL functions library_review_days() and item_review_by_for() (the JSON-parsing one).
  • The publish trigger is now a single template check.
  • Strict mode is gone: stale items are answered with the warning line. The refusal, withheld and staleRefusal / withoutRefused paths are removed.

Also removed: the dead policyItemSchema and policyItemFields (an older Policy form), and the unused label.checkbox CSS.

Demo seed: Help Desk Runbooks is a General library, so it now sets review-by dates per item. Account Lockout is set overdue and Incident Response due in 6 days, as before, and the other three get +90 days.

Tests

  • Freshness tests rewritten: +90 days for Policy/Procedure, no date for General, a hand-set date survives a republish, the dropped columns are absent, and stale items are answered rather than refused.
  • New test for migration 025: moves the date, keeps an existing review_by, strips review_date from the details, snapshot and schema, and leaves the version unchanged.
  • Typecheck, lint and the full suite pass (422/422).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant