Журнал изменений

Официальный сайт SLAED CMS

Журнал изменений

Фильтр и поиск

Всего: 1083 Доступных коммитов | Отфильтровано: 1083 Коммиты | Страница: 1 / 109
Сегодня (29.07.2026)
Feature: mailings become criteria and the queue becomes visible
Автор: Eduard Laas | Дата: 00:06 29.07.2026

Stages 3 and 4 of docs/MAIL-2026.md. A mailing stops being a list of addresses rendered into a select and posted back, and becomes a criterion the scheduler expands into the queue in resumable slices, guarded by a suppression registry, a canary slice and a circuit breaker. The queue it writes into gains the admin view that was missing, so an installation can no longer accumulate mail silently.

Core changes:

  1. Campaign state and the suppression registry (setup/sql/table.sql, setup/sql/table_update6_3.sql):
  2. {prefix}_newsletter carries the campaign state machine

    • status, audit, apar, cursor, expect, total, fails, note
    • mails is dropped, after setup/index.php has moved anything still pending into the queue
  3. {prefix}_maildead added, keyed by the normalised address

    • email uses a binary collation so case folding lives in the normaliser alone
  4. delcol joins the idempotent migration helpers beside addcol and addidx
  5. Delivery, verification and campaign control (core/classes/mail.php):
  6. checkAddress() runs the ladder: syntax, recorded outcomes, cached domain resolution

    • every step fails open, so no check can become a precondition for delivery
  7. failures are classified by the phase that produced them

    • only a permanent verdict at RCPT TO may touch the suppression registry
    • a transport-wide refusal stops the run instead of spending an attempt per row
  8. setCampReady(), setCampFree(), setCampAbort() and the circuit breaker

    • the sample is drawn one address per recipient domain and never releases the rest
  9. getStats(), getList(), setQueueRetry() and deleteQueueRows() serve the queue view
  10. Audience producer (core/system.php):
  11. updateNewsletter() expands one criterion in slices under a time budget, writing its cursor
  12. getMailAudience() and getMailAudienceNum() resolve a criterion to its query and its count
  13. addAdminMail() no longer rewrites _admins.modules; the admin screen owns that write
  14. addMailTask() reports a transport-wide refusal as a failed run
  15. Admin screens (admin/modules/newsletter.php, admin/modules/config.php):
  16. the audience selector stores a criterion and never a list of addresses
  17. the queue tab filters by kind and status and offers retry and delete
  18. every state change is a POST carrying checkSiteToken()
  19. the mail tab gains the verify and dnsttl rows
  20. Documentation and locales (docs/, admin/lang/*.php, README.md and the root documents):
  21. both stages recorded in the plan with their decisions, defects and open blockers
  22. 21 constants added to all six admin locales
  23. root documents drop their "last updated" lines and state the 8.4 requirement

Benefits:

  • a mailing of any size stores one row per recipient and one copy of its body
  • a damaged list is measured before it is sent to rather than after the damage
  • a failed message is visible, retryable and explains itself in the operator's words
  • a queue behind a stopped drain now says so on the screen that lists it

Technical notes:

  • config/newsletter.php holds campaign policy alone; count and active are gone
  • the newsletter scheduler job is now the producer and ships active
  • the fresh schema and the upgraded schema were diffed and are identical
  • breaking: {prefix}_newsletter.mails is removed, so the 6.3 upgrade must run first
Вчера (28.07.2026)
Docs: tighten the backup and upload plans
Автор: Eduard Laas | Дата: 22:42 28.07.2026

Both plans keep their scope and gain the contracts their reviews found missing: the backup plan pins the scheduler boundary it depends on, and the upload plan pins the storage contracts its callers already rely on.

Core changes:

  1. Backup plan (docs/BACKUP-2026.md):
  2. the scheduler boundary is specified rather than assumed

    • every state-changing action is POST; GET only displays state
    • browser actions validate the SLAED CSRF token, cron authenticates by bearer
token in the body and never through the URL
  • an OS flock keyed by the canonical job name owns a run; JSON status and
heartbeat are diagnostic only and unlock may not break a live lock
  • dbbackup.settings defaults are synchronized across both config sources, and the 6.3 upgrade fills only missing keys

  • the nine migration helper procedures are a release prerequisite; Backup fails closed while they exist and never deletes schema objects

  • schema fingerprinting excludes AUTO_INCREMENT counters and table statistics
  • scheduler row actions render through the real dial fragment
  • the verification matrix names upgrade, route, concurrency and restore tests
  • Upload plan (docs/UPLOAD-2026.md):
  • deleteStoredFile() joins the public surface for the orphan case

    • a database write that fails after publication removes that exact result
    • containment and the destination lock are re-checked on the delete path
  • paths are root-relative on both ends, and the stored name keeps the owner suffix the editor ownership filter reads

  • go=4 stays as the editor route with two explicit cases and rejects the rest
  • DNS resolution, cURL execution and the clock sit behind replaceable internal methods so the security cases are testable without a network

Benefits:

  • both plans can now be handed to an implementer without a second review round
  • the backup plan no longer depends on scheduler behaviour nobody wrote down
  • the upload plan states the contracts a caller would otherwise rediscover

Technical notes:

  • documentation only; no code, schema or configuration changes
  • neither plan is started, and both keep their no-compatibility-wrapper rule
Feature: comment notification is queued inside the comment transaction
Автор: Eduard Laas | Дата: 22:42 28.07.2026

Stage 3 of docs/COMMENTS-REDESIGN-2026.md. The admin notification of a new comment is a queue row written in the transaction that stores the comment, so a comment that never commits leaves no mail behind and a job is written once per stored comment. Nothing is delivered while the visitor waits.

Core changes:

  1. Comment submit handler (core/user.php):
  2. addComment() owns the transaction the comment and its queue row share

    • Comment::addComment() joins it instead of committing its own
    • addAdminMail() writes the queue rows inside it
    • the commit closes both, and any refusal rolls both away
  3. the notification is written only for a comment this request stored
  4. Comment subsystem (core/classes/comment.php):
  5. addComment() answers a fourth key, new, beside id, name and error

    • true only on the return that follows a successful insert
    • getKeyResult() answers false, because a replay stores nothing
  6. every refusal answers new as false as well
  7. Stage guard (tests/Unit/CommentNotifyTest.php, tests/Support/contract_probe.php):
  8. the commentnotify probe drives the two writes in the handler's order inside a transaction it always rolls back

    • one add stores one comment and queues one row per subscribed administrator
    • the rollback takes the comment and its job away together
    • a replay, a refused add and a rejected address each write nothing
  9. the handler cannot run under CLI because getVar() reads scalars through filter_input(), so its wiring is asserted against its source

  10. six of the ten cases fail against the pre-batch tree

Benefits:

  • a stored comment and its notification can no longer disagree with each other
  • a replayed submit no longer notifies the administrators a second time
  • the comment write and its notification cost 5.8 ms together, against 77 ms for one page render; the 26.6 s synchronous mail() is gone from the request path

Technical notes:

  • no schema change; the queue row is written through Mail::addQueue(), which is documented as being called inside the caller's transaction

  • a failed queue write is deliberately not checked: a statement that fails does not abort the transaction, so the comment still commits

  • breaking change for callers of Comment::addComment(): the returned array carries a new key, and a replay must no longer be treated as a stored comment

Feature: comments store source, render safe and write consistently
Автор: Eduard Laas | Дата: 22:13 28.07.2026

Stage 2 of docs/COMMENTS-REDESIGN-2026.md. The comment body becomes the source the author wrote and the parser escapes it on read, every write is transactional and idempotent, and the table gains the columns and indexes that make a soft delete, an idempotency key and a keyed flood fingerprint possible.

Core changes:

  1. Comment subsystem (core/classes/comment.php):
  2. checkRules() replaces checkAddRules()/checkEditRules() as one ordered rule set

    • the length rule measures the longest word, not the last one
    • it counts characters instead of bytes
    • the add-only rules (guest name, flood window, captcha) stay bound to the add
  3. add, edit, status and delete are transactional with checked results

    • status and delete are conditional updates, so a parallel request cannot count twice
    • the row is read FOR UPDATE inside the same transaction
    • an operation joins a transaction that is already open instead of refusing
  4. deleteComment() marks the row instead of erasing it, and every read filters it
  5. addComment() stores reqkey, iphash and format and answers a replay from the failed insert
  6. filterCommentBody() replaces filterHtml() in the write path and stores source
  7. getBodyFormat() refuses html as a comment format
  8. CommentMode replaces the bare acomm comparisons, getTargetMode() answers the enum
  9. listings sort on time, id
  10. Parser (core/classes/parser.php):
  11. filterContent() and filterDoc() take the source format as a fifth argument

    • plain recognises no Markdown construct and turns line endings into breaks
    • anything else is Markdown, which is what every existing caller gets
  12. the inline BB pairs stash their tags, so safe = true keeps them readable
  13. Schema (setup/sql/table.sql, setup/sql/table_update6_3.sql):
  14. five columns added: format, edited, deleted, reqkey, iphash
  15. five indexes added, cid and modul_status dropped, KEY time kept
  16. new addcol procedure, reqkey backfilled before its unique index is created
  17. a fresh install and the upgrade produce an identical table definition
  18. Storage migration (tools/comment-migrate.php):
  19. classify writes the format of every row in its own reviewable pass
  20. convert rewrites the bodies per class, in batches, resumable through a ledger
  21. iphash backfills the flood fingerprint from the stored address
  22. report and sample answer read-only, and --db runs the whole thing on a copy
  23. Render sites (core/user.php, core/system.php, admin/modules/comments.php):
  24. all four comment renders moved to safe = true and pass the row format
  25. the moderation save reads the raw field, because the body is source now
  26. Tests (tests/Unit/CommentStateTest.php, tests/Support/contract_probe.php):
  27. 15 cases over a probe that signs in as an administrator before the core boots
  28. repeated status transitions, idempotent delete, replayed key, stable sort, round-trip of both classes and the write-path normalisation are all measured

  29. the stage 0 guard and the parser fixtures follow the two shapes this stage changed

Benefits:

  • stored XSS through the comment path is closed by the rendering model itself
  • a moderation click, a double submit and a repeated delete can no longer move a target counter or an author's points twice

  • the flood check runs on an indexed fingerprint instead of a plain address
  • the list, its count and its pager can no longer disagree about a deleted row

Technical notes:

  • the body format is stored per row: plain or markdown, never html
  • the upgrade is idempotent, but tools/comment-migrate.php is not optional - until classify and convert have run, comments render with their old escaping

  • 121 of 7353 rendered comments change on purpose and are recorded in the plan
  • docs/BACKUP-2026.md and docs/UPLOAD-2026.md carry an unrelated rewrite that was already in the working tree

Docs: close the security self-review of the backup and upload plans
Автор: Eduard Laas | Дата: 20:44 28.07.2026

Both proposed plans are corrected where their own self-review found a contract that would still have been unsafe or non-deterministic when implemented, so neither can be built from a design that has a known gap in it.

Core changes:

  1. Scheduler access and locking (docs/BACKUP-2026.md):
  2. the access matrix is written out per entry: an authenticated administrator is never a token bypass, pseudo-cron accepts only the session-bound site token, cron only the configured static one, and manual or unknown triggers are rejected on the direct endpoint

  3. job exclusion moves from scheduler JSON to a process-held non-blocking flock kept for the whole run, so lock_timeout stays a budget and a diagnostic rather than permission for a second process to start

  4. the shared admin dial gains a form mode: edit stays an anchor, run, unlock and delete become submit buttons inside one POST form the template owns

  5. Deterministic export and restore (docs/BACKUP-2026.md):
  6. the export session fixes time zone and SQL mode beside the isolation level and restores every value it changed, and failing to establish or restore it is a failed run

  7. the dump prologue sets the same interpretation on the restoring side
  8. the verification list, the risk table and the completion criteria follow
  9. Remote transfer (docs/UPLOAD-2026.md):
  10. CNAME traversal is bounded and fails closed, every A and AAAA answer of the terminal name is validated, and a host without a validated public answer is rejected

  11. environment and configured proxies are disabled per hop, because a proxy moves DNS and connection enforcement outside the application

  12. the work order, the security criteria and the risk table follow

Benefits:

  • the two remaining procedural subsystems have plans whose security boundaries are settled before any code is written

  • the corrections are recorded in each plan's progress table, so a later session can see that the earlier revision was superseded rather than lost

Technical notes:

  • no PHP source changed and neither migration has started
  • both plans keep replacing their contracts outright, with no compatibility wrapper and no behavior-preserving intermediate implementation

Docs: mark mail stage 2 done in the execution order
Автор: Eduard Laas | Дата: 20:43 28.07.2026

The order table of the shared execution cookbook records that the mail queue and drain stage is finished and committed, so the next chat opens at the row after it instead of re-reading a stage that is already in the tree.

Core changes:

  1. Order of work (docs/EXECUTION-2026.md):
  2. row 4, mail stage 2, struck through and marked done
  3. the next open row is comments stage 2, which still needs its one comment-baseline capture before its first chat

Benefits:

  • the cookbook keeps telling a fresh session where to start

Technical notes:

  • no code changes and no changes to the prompts or the templates
Docs: record mail stage 2 in the plan
Автор: Eduard Laas | Дата: 20:41 28.07.2026

The mail plan gains its stage 2 entry and is corrected wherever the implementation measured something the plan had assumed, so a session reading only the plan sees the delivered design rather than the designed one.

Core changes:

  1. Progress and decisions (docs/MAIL-2026.md):
  2. stage 2 recorded: what was built, what was verified and against what
  3. the claim is described as it is implemented and measured: the predicate is the leading columns of the claim index, and exclusivity comes from the claim moving a row behind the lock window

    • the measurement that decided it is written down, 202 ms against 1.9 ms
  4. the upgrade statement lives in table_update6_3.sql, with the reason: 6.3 is the release this ships in, and a new file would give a fresh install the table and an upgraded one nothing

  5. the drain job is priority 2, as the plan's own paragraph argues; its code block said 1 and is corrected

  6. an empty drain run reports success and never idle, because the scheduler counts every other status as a failure and this job runs every five minutes

  7. retention is keyed on the creation stamp, the only one the table has
  8. the test send reports what the run did, not what the queue accepted
  9. Blockers (docs/MAIL-2026.md):
  10. concurrency closed: two processes racing one queue of 400 rows claimed 200 each with no overlap

  11. added: delivery is still proven only against a loopback sink, the transactional retention delete cannot use an index prefix, and the queue rows on the mail tab were verified as controls rather than as behaviour

  12. Facts re-measured:
  13. the admin config module line references, shifted by the six queue rows

Benefits:

  • the two places where the plan contradicted itself or the engine are settled in the plan rather than only in the code

  • the next stage starts from measured numbers

Technical notes:

  • no code changes
  • the execution cookbook is left untouched; marking the order table is the reader's step after the commit

Feature: outgoing mail is queued and drained instead of sent inside the request
Автор: Eduard Laas | Дата: 20:40 28.07.2026

Stage 2 of docs/MAIL-2026.md. addQueue() stores a row and answers accepted into the queue; delivery moves to a scheduler job that claims, sends and records under a lock, so no request waits on a transport and no failure stays invisible. No call site changes: all 26 moved to $mailer->addQueue() in stage 1.

Core changes:

  1. The queue table (setup/sql/table.sql, setup/sql/table_update6_3.sql):
  2. {prefix}_mail holds kind, sender, email, title, body, ref, prio, time, ntime, tries, status, camp, hold, locked, lockid, phase, code and error

  3. the claim index leads with hold, status, prio, ntime, id; kind_status_time and kind_ref_status serve retention and the campaign queries stage 3 adds

  4. the upgrade statement creates the table with its primary key alone and adds every secondary index through addidx, so a half-applied schema is repaired instead of refused

  5. Queue and drain (core/classes/mail.php):
  6. addQueue() stores instead of delivering; every value is bounded against the column that holds it, and an oversized subject is refused where the caller can still be told rather than by a failing write

  7. getBatch() claims one batch in a single conditional UPDATE and moves the rows behind the lock window, which is what makes the claim exclusive

    • the predicate is exactly what the claim index leads with: with a marker
column in it the optimizer left that index and filesorted 99 267 rows
  • setResult() records the outcome, grows the backoff per attempt and fails the row at the attempt cap; a reference to a body that is gone is not retried

  • updateQueue() is time-boxed rather than count-boxed, honours mail.rate across runs through the job state, and keeps one transport connection for the run

  • deleteQueue() prunes accepted rows per kind and never touches a failed one
  • sending is private: the queue is the only way out
  • Scheduler job (config/scheduler.php, core/system.php, setup/index.php):
  • maildrain ships active, runs every five minutes and stays manually triggerable
  • addMailTask() maps a run to the job status: an empty queue is a success, a run that refused everything it tried is a failure

  • the upgrade inserts the job into an existing config/scheduler.php
  • Queue settings and the test send (admin/modules/config.php, admin/lang/*.php):
  • batch, rate, tries, backoff, keep and keepbulk get a row on the mail tab and are validated on save

  • the test send queues and then drains inside the request, so the button still reports the transport's own words; a run that sent nothing says so instead of claiming a delivery nobody observed

  • seven constants added to all six locales
  • Tests (tests/Unit/MailQueueTest.php, tests/Unit/MailDrainTest.php, tests/Support/):
  • 25 tests over the statements the queue issues and the bounds it holds
  • 15 tests driving the live database and a loopback SMTP sink through tests/Support/mail_probe.php and tests/Support/mail_relay.php

  • the stage 1 transport tests now enter delivery the way the drain does

Benefits:

  • a request that sends mail returns at once: the security notice measured here queues in 0.11 s where the same path used to wait on mail()

  • a refused delivery is retried behind a backoff and recorded instead of being discarded

  • one SMTP handshake per drain run rather than one per message
  • the claim reads its 25 rows in 1.9 ms with 100 000 pending, against 202 ms before the predicate was written against the index

Technical notes:

  • new table {prefix}_mail; a fresh install and an upgrade produce the same definition, the upgrade is idempotent and repairs a partially applied one

  • two processes racing one queue of 400 rows claimed 200 each with no overlap
  • breaking change: mail becomes asynchronous on every installation that takes this release, and addQueue() answers accepted into the queue, never delivered

  • no compatibility layer and no runtime schema detection
  • config/mail.php is unchanged: stage 1 already shipped every queue key
Docs: plan the Backup and Upload class migrations
Автор: Eduard Laas | Дата: 19:16 28.07.2026

Two more procedural core subsystems get a concrete migration plan in the shape the 2026 plans already use, and the analysis document that only listed candidates is retired now that its two remaining entries have plans of their own.

Core changes:

  1. Database backup (docs/BACKUP-2026.md):
  2. addBackupTask() is replaced by one final Backup class owning database export and the creation of one verified, restorable artifact

  3. scheduler access, locking, state and presentation stay in the scheduler
  4. named Backup rather than DatabaseBackup, with addDatabaseBackup() as its first public operation so the short class name does not imply filesystem coverage

  5. one atomic replacement: atomic output, consistent reading, checked writes, exact artifact identity, cleanup and restore verification are part of the first implementation rather than a later hardening pass

  6. Uploads (docs/UPLOAD-2026.md):
  7. upload(), check_file() and check_size() are replaced by one Upload class
  8. the separate editor upload implementation joins the same validation and storage boundary

  9. owner context, quota locking, DNS-pinned remote transfer, stale-partial recovery and the supported-flow criteria are settled without fallbacks

  10. Retired analysis (docs/REFACTOR_CLASS_CANDIDATES.md):
  11. removed; the candidates it ranked are covered by the mail, comment, backup and upload plans

Benefits:

  • both subsystems now have a plan that states a final contract instead of a direction, so neither can be half-migrated

  • the docs directory holds plans that are executed rather than a list that is read

Technical notes:

  • no PHP source changed
  • both plans are proposed, not started
  • both replace their contracts outright: no compatibility wrapper and no behavior-preserving intermediate implementation

Docs: record stage 1 batch 6 and close the comment plan stage
Автор: Eduard Laas | Дата: 19:16 28.07.2026

The comment plan gains its last stage 1 entry and is re-measured against the code the batch left behind, so a session reading only the plan sees the delivered state rather than the designed one.

Core changes:

  1. Progress and decisions (docs/COMMENTS-REDESIGN-2026.md):
  2. batch 6 recorded: what moved, what was measured and how
  3. eight decisions added, covering the single module map, the public resolver against the private counter, the deletion of ashowcom() rather than a rename, the precomputed sidebar count and the shape the guard has to look for

  4. deviations added: the render defect moved verbatim, the unstable sort that makes an ascending capture differ from itself, two measurement artefacts, and the config cache that silently defeats a sort change

  5. Facts re-measured after the move:
  6. core/system.php 5944 to 5689 lines; the render is 136 lines in core/user.php
  7. seven defined('ADMIN_FILE') branches inside the deleted function, not eight
  8. no stored comment carries a module outside the eight-entry map
  9. line references refreshed across the Facts, Target design and Stage 2 sections
  10. Blockers closed:
  11. the frontend page-cache mechanism is index.php:130 through Cache::addEpoch(), mixed into every page key by getPageHash(); the two halves of the contract it does not meet are named and handed to stage 4

  12. the admin sidebar chip entry of the consumer list is struck through
  13. Execution cookbook (docs/EXECUTION-2026.md):
  14. comments stage 0, mail stage 1 and comments stage 1 marked done in the order table, so the next chat starts at mail stage 2

Benefits:

  • the plan states what was delivered and what was deliberately not, so the next stage does not rediscover either

  • every number quoted in it was measured against the current tree

Technical notes:

  • no code changes
  • one item of the stage is recorded as not delivered: deleteUser(), because the behaviour it would replace has never been decided

  • the markup baseline is left reporting CHANGED for three modules; the cause is recorded with the statement that restores it

Всего: 1083 на 109 страницах по 10 на каждой странице

1 2 3 4 5 6 7 8 9 10 109
Хотите опробовать SLAED CMS в действии?
Идеи и предложения
Обратная связь
Подтверждение

Поделиться
QR-код