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

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

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

Всего: 1091 Доступных коммитов | Отфильтровано: 1091 Коммиты | Страница: 2 / 110
28.07.2026
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

Refactor: the comment counter and the target resolver move into the Comment class
Автор: Eduard Laas | Дата: 19:15 28.07.2026

Stage 1 of docs/COMMENTS-REDESIGN-2026.md closes here. The comment table now has exactly one owner: the three global helpers that shared it are gone, the last consumer reaching it through an assembled table name is closed, and a guard test asserts the boundary for the whole stage rather than for one batch.

Core changes:

  1. Counter and resolver absorbed (core/classes/comment.php):
  2. numcom() becomes the private updateTargetCount()

    • three unreachable branches dropped: account/members, gallery, multimedia
    • their points slots 3, 17 and 29 leave the code; the users.points CSV keeps
all 45 positions, because the list is indexed positionally
  • getCommentMode() becomes the public getTargetMode()
  • both index one MODULES map holding the target table and the points slot of the eight modules that render comments

    • the counter map and the supported-module list stop being two lists
  • getStatusCount() added for the admin sidebar
  • The HTML monolith is deleted (core/system.php, core/user.php):
  • ashowcom() removed; its frontend half is getCommentList() in core/user.php, directly above setComShow(), which is where the design puts the rendering

  • the seven defined('ADMIN_FILE') branches are deleted rather than moved

    • core/user.php is required only under MODULE_FILE, so they were unreachable
  • core/system.php shrinks from 5944 to 5689 lines
  • The last direct consumer is closed (core/admin.php):
  • the waiting-content chip reads getStatusCount(CommentStatus::Pending)
  • getAdminCountRow() takes an optional precomputed count and skips its own query when it is given; the other fifteen sidebar rows are unchanged

  • the dead table, where and rate keys leave the comment entry of getProfileModules(), which is the shape that hid two consumers from earlier sweeps

  • Stage guard (tests/Unit/CommentIsolationTest.php):
  • no production file but the class names the comment table
  • the files that build a table name from a variable are a closed list, and neither getProfileModules() nor getAdminCountRow() can be handed comments

  • the retired globals are defined nowhere and named nowhere
  • the module map keeps its eight modules and their slots; the points CSV keeps its length

Benefits:

  • one reader and one writer for the comment table, so a counter can no longer drift from the rows it counts

  • the resolver that authorizes a target and the counter that follows a write sit behind the same private boundary, so the trust boundary stage 0 closed cannot be reopened from inside the project

  • the render is 135 lines of markup assembly with no SQL and no dead branches

Technical notes:

  • no table or column changes
  • behaviour and markup preserved: 80 URLs per round compared against the pre-move tree, 80/80 identical descending, and the moderator branch the guest probe cannot reach proven by source equivalence

  • measured on the live table: no stored row carries a module outside the map, so the dropped counter branches were unreachable in data as well as in code

  • breaking change for third-party code: ashowcom(), numcom() and getCommentMode() no longer exist; no wrapper and no alias is provided

Docs: record stage 1 batch 5 of the comment plan
Автор: Eduard Laas | Дата: 17:58 28.07.2026

The Progress section is the only place decisions of a finished batch survive into the next chat, so batch 5 writes down what it moved, what it measured, and the two consumers the plan's own fact list had missed.

Core changes:

  1. Progress and decisions (docs/COMMENTS-REDESIGN-2026.md):
  2. batch 5 row: what moved, the three parity measurements, and the checks that ran

  3. decisions: why deleteTarget() binds one placeholder per id and moves no counter, why it does not re-validate the module, why the whole shop id list was bound rather than the comment statement alone, what the two extra round trips per profile page buy, and where the unreachable feed guard went

  4. Consumers found by reading rather than grepping:
  5. modules/account/index.php built the profile hub from the same module map as the feed, so it reached the comment table through an assembled name and never appeared in a search for the literal; batch 5 migrated it

  6. core/admin.php:319 counts pending comments the same way through getAdminCountRow() and is recorded as open, with what it would take

  7. the stage 1 acceptance criterion now says a sweep for the literal name is not enough, and names both shapes seen so far

  8. Re-measured facts (docs/COMMENTS-REDESIGN-2026.md):
  9. the comment table holds 7353 rows and 3 pending, not 7357 and 4; the distribution moved with it, and the stage 2 body migration must measure the table it actually runs on

  10. the class line numbers cited across the plan are refreshed
  11. the shop id-list interpolation is struck from the fact list
  12. Deviations worth carrying (docs/COMMENTS-REDESIGN-2026.md):
  13. comment-baseline verify reported CHANGED for three modules and the cause was the verification itself: one point per rendered admin page moved a counter the author card shows; the value was restored and the baseline deliberately not re-captured

  14. the comment entry of the profile module map now carries three dead keys, and that is the disguise which hid two consumers

  15. two log entries found and left alone, neither owned by this batch

Benefits:

  • a new chat reading only this file sees why each deviation exists
  • batch 6 inherits a stage guard that knows what to look for

Technical notes:

  • no code changes in this commit

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

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

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