Igor Lins e Silva
b62c5f9cdd
fix(logstream): read and write artifact content as bytes, never text mode
...
Python's text layer applies universal-newline translation: CRLF becomes LF
on read, and on Windows LF expands back to CRLF on write. Every CLI path
that carried artifact and event content went through it, so a patch piped
in from a Windows agent was stored as different bytes than the ones git
produced — under a sha256 of the mangled content, which then failed to
match on the machine that applied it. For a store whose contract is
verbatim bytes addressed by digest, that is silent corruption.
It also disarmed the CRLF warning added for kind=patch: put_artifact looks
for a carriage return that the read path had already stripped, so the one
check meant to catch unappliable diffs could never fire on the platform
that produces them.
- _read_stdin_exact() / _write_stdout_exact(): go through sys.stdin.buffer
and sys.stdout.buffer, falling back to the text layer when a replaced
stream has no .buffer.
- --file / --body-file: read_bytes().decode() instead of read_text().
- artifact get --out: write_bytes() instead of write_text().
Verified through real pipes: a 63-byte CRLF patch round-trips at 63 bytes
with an unchanged sha256 via stdin, --out, and stdout, and the CRLF warning
now fires. Regression coverage in TestVerbatimNewlines, confirmed failing
against the old behavior first.
Config reads (peers.json, replica.json, server registry, token file) are
left on read_text: JSON is newline-insensitive and none of them carry user
content.
Reported by Copilot on the pull request.
2026-08-07 08:21:57 -03:00
..
2026-05-03 17:43:00 +05:00
2026-06-05 21:41:21 -03:00
2026-06-28 18:01:59 -03:00
2026-08-05 23:50:54 -03:00
2026-05-27 19:19:17 +10:00
2026-05-31 10:41:09 +10:00
2026-06-11 13:09:40 +10:00
2026-06-05 21:41:21 -03:00
2026-08-05 23:50:31 -03:00
2026-06-28 18:13:06 -03:00
2026-06-05 14:52:06 -04:00
2026-05-17 23:20:01 -03:00
2026-06-19 13:44:52 +00:00
2026-04-19 10:34:11 +02:00
2026-06-01 17:19:10 -05:00
2026-07-06 09:23:35 -03:00
2026-07-14 19:40:29 -03:00
2026-08-07 08:21:57 -03:00
2026-08-02 18:37:53 -03:00
2026-07-30 22:25:05 -03:00
2026-08-02 07:43:14 -03:00
2026-04-25 00:39:37 -03:00
2026-05-30 12:44:47 -07:00
2026-04-24 11:13:51 +02:00
fix: expand tilde in palace_path when read from config file\n\nMempalaceConfig.palace_path correctly called os.path.expanduser() for\nenv-var paths but not for paths read from config.json. If config.json\nstores palace_path as '~/.mempalace/palace' (the default written by\ninit), the tilde was returned unexpanded.\n\nDownstream callers such as cli.py cmd_mine did call expanduser when\n--palace was passed explicitly, but fell through to MempalaceConfig()\nwhen no flag was given, inheriting the unexpanded string. Python's\nos.makedirs and chromadb.PersistentClient treat a leading tilde as a\nliteral directory name rather than the home directory, so the palace\nwas silently written to a CWD-relative path such as\nmy_project/~/.mempalace/palace.\n\nThe fix is a single os.path.expanduser() call on line 343 of\nconfig.py, mirroring the existing env-var branch on line 342. Since\nDEFAULT_PALACE_PATH is already expanded at module load (line 197),\nexpanduser on an absolute path is a no-op, so the default case is\nunaffected.\n\nSymptoms: scattered {project}/~/.mempalace/palace directories, palace\nalways appears empty after mine, search returns Collection does not\nexist, launchd-driven nightly mine writes to a different location than\ninteractive mine.\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>n ( #1865 )
2026-06-26 00:09:51 -03:00
2026-08-03 02:38:46 +05:00
2026-04-18 12:52:01 -03:00
2026-08-02 19:21:35 +00:00
2026-08-03 00:54:03 -03:00
2026-04-24 01:30:40 -03:00
2026-05-17 23:20:01 -03:00
2026-05-17 23:20:01 -03:00
2026-05-27 14:17:36 +10:00
2026-06-22 13:54:09 +10:00
2026-06-10 15:40:35 +10:00
2026-08-02 05:26:03 -03:00
2026-07-28 17:34:49 +02:00
2026-04-11 16:16:31 -07:00
2026-06-08 02:48:26 -03:00
2026-05-24 13:18:08 -03:00
2026-08-02 05:24:02 -03:00
2026-06-29 02:22:10 +00:00
2026-06-20 18:05:15 -03:00
2026-08-02 18:19:31 +00:00
2026-04-15 00:26:38 -07:00
2026-08-03 20:05:40 +00:00
2026-06-28 19:44:11 -03:00
2026-07-23 12:56:37 +05:00
2026-05-10 12:56:50 +02:00
2026-05-07 12:51:47 -03:00
2026-06-13 11:11:22 -04:00
2026-07-14 19:22:06 -03:00
2026-05-24 13:18:08 -03:00
2026-04-13 17:11:11 -07:00
2026-06-11 19:11:52 +00:00
2026-06-11 19:18:54 +00:00
2026-07-14 19:40:29 -03:00
2026-07-31 18:01:20 -07:00
2026-06-26 00:27:36 -03:00
2026-06-13 06:37:26 +00:00
2026-07-17 08:23:36 +00:00
2026-06-19 13:00:14 +00:00
2026-08-02 19:21:35 +00:00
2026-06-19 13:00:14 +00:00
2026-08-05 23:50:19 -03:00
2026-06-21 18:20:12 +05:00
2026-08-05 23:50:31 -03:00
2026-05-17 23:20:01 -03:00
2026-08-03 02:38:46 +05:00
2026-06-12 07:39:57 +00:00
2026-07-14 21:52:32 -03:00
2026-05-17 23:20:01 -03:00
2026-04-16 16:00:29 +05:00
2026-04-14 13:09:10 -07:00
2026-04-08 21:38:12 +03:00
2026-07-06 09:23:46 -03:00
2026-04-24 23:06:26 -03:00
2026-07-14 21:52:32 -03:00
2026-06-12 15:25:36 +00:00
2026-05-24 13:18:08 -03:00
2026-06-10 16:46:27 -07:00
2026-05-17 23:20:01 -03:00
2026-04-24 23:06:26 -03:00
2026-08-05 23:50:19 -03:00
2026-08-06 00:25:49 -03:00
2026-08-05 23:50:19 -03:00
2026-06-08 08:44:20 -03:00
2026-08-05 23:49:23 -03:00
2026-08-05 23:50:19 -03:00
2026-06-06 17:54:38 +05:00
2026-07-24 11:49:11 +04:00
2026-08-02 05:26:36 -03:00
2026-05-17 23:20:01 -03:00
2026-06-06 03:11:46 -03:00
2026-07-28 17:18:02 +02:00
2026-07-01 07:10:39 +00:00
2026-06-14 14:58:20 -03:00
2026-07-07 13:23:59 -04:00
2026-04-18 13:14:32 -03:00
2026-07-28 17:18:02 +02:00
2026-06-24 01:12:24 -03:00
2026-05-14 06:40:27 -03:00
2026-07-14 19:22:06 -03:00
2026-04-25 11:06:32 -07:00
2026-07-11 15:21:41 +05:00
2026-08-02 05:34:29 -03:00
2026-06-28 18:02:29 -03:00
2026-06-07 16:01:57 +08:00
2026-06-28 19:43:28 -03:00
2026-06-21 11:29:25 +00:00
2026-04-12 22:19:58 -03:00
2026-05-23 12:05:34 -04:00
2026-07-31 23:39:42 -07:00
2026-08-02 18:31:44 -03:00
2026-04-11 16:16:06 -07:00
2026-05-17 23:20:01 -03:00
2026-04-14 10:55:56 -07:00
2026-07-28 14:37:35 +00:00
2026-08-03 02:38:46 +05:00
2026-06-29 03:28:06 -03:00
2026-05-09 20:25:47 -03:00
2026-04-08 21:38:12 +03:00
2026-04-08 21:08:49 +03:00
2026-04-08 21:07:03 +03:00
2026-08-02 07:43:14 -03:00
2026-05-17 23:20:01 -03:00
2026-06-28 18:01:59 -03:00
2026-08-05 23:50:19 -03:00
2026-04-07 08:53:25 +01:00
2026-06-24 22:58:08 +02:00
2026-07-15 14:38:23 +00:00