feat(sql): the database helper and the TOTP helper, as subcommands
`crafter-review sql` hands the SQL to the driver's broker named in REVIEW_GATES_DB; the broker runs it as one transaction, rolled back, and streams the lines back with the exit code last. The client speaks protocol 3.0 over Crafter.Network's TCP client: cleartext, MD5 and SCRAM-SHA-256, one Parse per statement, the transaction status as the backstop. The splitter, the refusals, the table layout and every message work on code points; connect and socket errors read "[Errno 111] Connection refused" or "timed out". `crafter-review totp` prints "123456 (valid 17s)". No sleep after the last connect attempt; TOTP reads the clock once; a broker token that is no string gets the NO DATABASE answer and the exit mark. The goldens add the splitter, the comment stripping, the fingerprint, the refusals, the first words, the headline, the cell, table, error and notice layouts, the run's refusals and limits and 40 TOTP codes (2774 checks now). tests/PgWire runs the helper over a Postgres stand-in and compares its output with the goldens, line for line, plus the broker's protocol. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
61acd6a72e
commit
e8a58f893f
10 changed files with 3666 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ using namespace Crafter;
|
|||
namespace {
|
||||
// The umbrella, then the partitions in import order: each after the ones
|
||||
// it imports, which is also the order the module map in AGENTS.md uses.
|
||||
constexpr std::array<std::string_view, 22> Interfaces = {
|
||||
constexpr std::array<std::string_view, 23> Interfaces = {
|
||||
"interfaces/Crafter.Review",
|
||||
"interfaces/Crafter.Review-Unicode",
|
||||
"interfaces/Crafter.Review-Json",
|
||||
|
|
@ -31,13 +31,14 @@ namespace {
|
|||
"interfaces/Crafter.Review-State",
|
||||
"interfaces/Crafter.Review-Normalize",
|
||||
"interfaces/Crafter.Review-PgWire",
|
||||
"interfaces/Crafter.Review-Totp",
|
||||
"interfaces/Crafter.Review-Stream",
|
||||
"interfaces/Crafter.Review-Prompt",
|
||||
"interfaces/Crafter.Review-Config",
|
||||
"interfaces/Crafter.Review-Freeze",
|
||||
"interfaces/Crafter.Review-Driver",
|
||||
};
|
||||
constexpr std::array<std::string_view, 19> Implementations = {
|
||||
constexpr std::array<std::string_view, 20> Implementations = {
|
||||
"implementations/Crafter.Review-Text",
|
||||
"implementations/Crafter.Review-Crypto",
|
||||
"implementations/Crafter.Review-Platform",
|
||||
|
|
@ -52,6 +53,7 @@ namespace {
|
|||
"implementations/Crafter.Review-State",
|
||||
"implementations/Crafter.Review-Normalize",
|
||||
"implementations/Crafter.Review-PgWire",
|
||||
"implementations/Crafter.Review-Totp",
|
||||
"implementations/Crafter.Review-Stream",
|
||||
"implementations/Crafter.Review-Prompt",
|
||||
"implementations/Crafter.Review-Config",
|
||||
|
|
@ -66,7 +68,7 @@ namespace {
|
|||
|
||||
// One per directory under tests/, each an ordinary main() that links the
|
||||
// library: exit 0 passes, nonzero fails, 77 skips.
|
||||
constexpr std::array<std::string_view, 13> Tests = {
|
||||
constexpr std::array<std::string_view, 14> Tests = {
|
||||
"Crypto",
|
||||
"Text",
|
||||
"Platform",
|
||||
|
|
@ -80,6 +82,7 @@ namespace {
|
|||
"CommitsMode",
|
||||
"CodeKeys",
|
||||
"Freeze",
|
||||
"PgWire",
|
||||
};
|
||||
|
||||
// The version the binary reports: CI sets it from the tag, a checkout
|
||||
|
|
|
|||
Loading…
Reference in a new issue