M4a task 14: post's comment was now_ms's; fixed, and every comment read

A script that rewrote the skeleton's comments put `now_ms`'s text on `post`. Task 14's second
session saw the contradiction and deliberated until cut off. Both comments are fixed, each
todo!() comment in tasks 14 and 15 was read beside its signature, and both tasks now say to stop
and quote a comment that does not fit. Lesson T29.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-24 00:40:05 -07:00
co-authored by Claude Opus 5.5
parent 564875f0a0
commit 02d5e25046
5 changed files with 19 additions and 3 deletions
+2
View File
@@ -107,6 +107,8 @@ never set.
## Stop and report if
- A comment above a `todo!()` does not fit its function, or contradicts a test. The comments were
written by hand and one was wrong before; stop at once and quote it, rather than guess.
- A test passes only sometimes, or a test takes 5 s or more (that is a wait that timed out, not a
pass).
- A written function (`run`, `connect`, `Gateway::new`, `event_loop`, `catch_up`) seems to need a
+1
View File
@@ -54,4 +54,5 @@ This is the last task of M4a. Stop after the commit.
## Stop and report if
- The comment above the `todo!()` does not fit the function, or contradicts a test: quote it.
- A test's output contains the token.
+9
View File
@@ -90,6 +90,15 @@ At the end of task 15: about 762 tests (650 before task 01).
checked in a scratch copy of the branch at task 14's start: the skeletons compile and fail
(`serve` 6, `serve_restart` 5 with 2 passing, `main` 4 with 1 passing), and filled from their
comments they pass (five runs), clippy clean, gate ok. Resume from task 14.
- 2026-09-24, task 14 again: this session copied the files and saw the tests fail, as told, then
deliberated until cut off, over a real contradiction: `post`'s comment was `now_ms`'s text.
The design model's script that rewrote the comments placed each after the first
eight-space comment following the function's name; `now_ms` is a free function with a
four-space comment, so its text went to `post`, and `post`'s was lost. The check filled the
bodies from the design model's own code, not from the comments, so it could not see this.
Both comments are fixed; every `todo!()` comment in tasks 14 and 15 was then read beside its
signature. Tasks 14 and 15 now say to stop and quote a comment that does not fit. The attempt is
saved in `.state/runs/M4a/14-second-attempt*`. Resume from task 14.
## Running it
@@ -14,15 +14,17 @@ use crate::ws::conn::Ws;
/// Now, in Mattermost's milliseconds.
fn now_ms() -> i64 {
// Milliseconds since the Unix epoch as i64, with try_from (i64::MAX if it does not fit).
// `let ms = SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_millis()).unwrap_or(0);`
// then `i64::try_from(ms).unwrap_or(i64::MAX)`.
todo!()
}
impl Gateway {
/// Post in a thread; a failure is logged, not fatal.
pub(super) fn post(&self, channel: &str, root: &str, text: &str) {
// `SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_millis()).unwrap_or(0)`, then
// `i64::try_from(ms).unwrap_or(i64::MAX)`.
// `if let Err(e) = self.client.create_post(channel, root, text)`: log
// "gatewayd: cannot post in <channel> (thread <root>): <e>", with `(self.log)(&line)`.
// Nothing else: posting records nothing in the state.
todo!()
}