v4 fabric to spec: the mesh boot, the one adaptive heartbeat, mechanism A (#189) #197

Merged
rajames merged 160 commits from StarForth-v4.0.0 into master 2026-11-19 11:19:50 +00:00
2 changed files with 12 additions and 5 deletions
Showing only changes of commit 216947a4d4 - Show all commits
+3 -2
View File
@@ -466,8 +466,9 @@ status for kernel work.
`TestCase.contract`/`WordTestSuite.suite_contract` trailing field, ~3,010 instances). Fixed
in place across all 20 files (mechanical: added the missing `{0}` initializer, semantically
a no-op since C99 already zero-fills unlisted trailing fields — the fix only silences the
diagnostic). Verified clean on all three architectures. Remaining, still-open warnings as of 2026-11-10: **5 `-Wformat-truncation`** in
`tools/mkcapsule.c` — corrected 2026-11-10; this file said 26 `-Wunused-parameter`,
diagnostic). Verified clean on all three architectures. Remaining, still-open warnings: **none** (2026-11-12, #143 -- the
5 `-Wformat-truncation` in `tools/mkcapsule.c`, still open on 2026-11-10, are fixed:
same-sized name arrays copied whole, a path too long refused instead of cut) — corrected 2026-11-10; this file said 26 `-Wunused-parameter`,
2 `-Wsign-compare`, and 2 `-Wstringop-truncation` (the -Wunused-parameter and
-Wsign-compare diagnostics were resolved since that audit). `tools/mkcapsule.c` is a
host build tool compiled via plain `cc -Wall -Wextra -O2` (no `-Werror`).
+9 -3
View File
@@ -1272,7 +1272,7 @@ static int cmd_resolve(const char *dir) {
if (!collides) {
ClaimEntry *dest = prior ? prior : &claim_registry[claim_count++];
snprintf(dest->name, CAPSULE_NAME_MAX, "%s", m->name);
memcpy(dest->name, m->name, CAPSULE_NAME_MAX); /* same-sized arrays: a whole copy, no truncation (#143) */
dest->hash = m->hash;
dest->block_count = m->block_count;
memcpy(dest->blocks, m->blocks, (size_t)m->block_count * sizeof(int));
@@ -1308,7 +1308,13 @@ static int cmd_resolve(const char *dir) {
fprintf(stderr, " %d -> %d\n", m->blocks[j], m->blocks[j] + delta);
}
char fpath[MAX_PATH_LEN];
snprintf(fpath, sizeof(fpath), "%s/%s", base_dir, m->name);
int flen = snprintf(fpath, sizeof(fpath), "%s/%s", base_dir, m->name);
if (flen < 0 || (size_t)flen >= sizeof(fpath)) { /* a cut path names another file (#143) */
fprintf(stderr, " ERROR: the path of %s is longer than %d bytes -- left unchanged\n",
m->name, MAX_PATH_LEN - 1);
rejected++;
continue;
}
/* capsule name uses ':' for subdirectories; the real path uses '/' */
for (char *p = fpath; *p; p++) if (*p == ':') *p = '/';
@@ -1321,7 +1327,7 @@ static int cmd_resolve(const char *dir) {
delta, reason);
for (int j = 0; j < m->block_count; j++) m->blocks[j] += delta;
ClaimEntry *dest = prior ? prior : &claim_registry[claim_count++];
snprintf(dest->name, CAPSULE_NAME_MAX, "%s", m->name);
memcpy(dest->name, m->name, CAPSULE_NAME_MAX); /* as below: same-sized arrays (#143) */
dest->hash = m->hash;
dest->block_count = m->block_count;
memcpy(dest->blocks, m->blocks, (size_t)m->block_count * sizeof(int));