Repository navigation
refactor(core): reorganize the ReMe runtime and shared helpers - #769
Conversation
| with socket.socket(family, socket.SOCK_STREAM) as s: | ||
| s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | ||
| try: | ||
| s.bind((host, port)) |
ployts
left a comment
There was a problem hiding this comment.
Please address the notebook cutover and the remaining module aliases before merging. I reproduced the notebook issue by creating a Todo on the current main branch and opening the same workspace at this PR's head. The proactive refresh comment is a follow-up about test coverage. Locally, 297 focused core tests and 106 plugin tests passed.
| def path(self, relative): | ||
| """Apply the same containment and request scope as the file jobs.""" | ||
| path, error = resolve_path(self.workspace, relative) | ||
| workspace_relative = f"{self.notebook_dir}/{relative}" |
There was a problem hiding this comment.
[P2] Keep existing Todo and Idea records reachable after the cutover. I created a Todo on the current main branch and ran list scope=all against the same workspace on this commit. The count went from 1 to 0 while the original todos.json stayed at the workspace root. Existing archive shards and pending recovery journals are skipped for the same reason. Please move the active files, archives, and recovery journals together before switching the reader to the new directory, so existing workspaces end up with one canonical store.
There was a problem hiding this comment.
Thanks for reproducing this and checking the archive and recovery journal paths. We’re treating this as the initial release layout for Todo and Idea. A workspace uses one configured notebook directory, notebook/ by default, and the code and guides will describe that layout directly. Migration from workspace-root files created on earlier development checkouts is outside the scope of this refactor.
Restore evolve behavior to the base branch and update its imports. Use Application as the runtime entry point and encode SSE in the HTTP service.
ployts
left a comment
There was a problem hiding this comment.
The legacy module aliases are gone and the repository callers use the canonical imports. The proactive publication change was reverted to the base behavior, which addresses my coverage comment. I confirmed that Todo and Idea were introduced after the latest published release, 0.4.2.3, and accept notebook/ as the initial release layout. The new CLI discovery changes introduce a reproducible regression that can route a job to the wrong service. Please fix that before merging. Locally, 377 focused tests passed and one skipped.
| service = overrides.get("service") | ||
| if not isinstance(service, dict) or not service: | ||
| continue | ||
| config = overrides |
There was a problem hiding this comment.
[P2] Preserve the client endpoint when replaying the server config fails. If the server YAML needs an environment variable present only in the service process, this fallback yields service: {port: 8127} from an explicit service.port=8127 startup override. call_server() accepts that as the full running config and bypasses the caller's config=client.yaml. It then selects HTTP by default, but the backend comparison used to seed its client arguments drops the known port. I reproduced find_reme scanning port 8127 while the Job client selected 2333. With an explicit client config pointing to 8127, the previous commit also selected 8127 and this commit selected 2333. A partial replay can supply a probe address, while client selection needs enough configuration to honor the intended endpoint or fall back to the caller's config.
There was a problem hiding this comment.
Thanks for reproducing the endpoint mismatch. Fixed in a1fb9eca. When the running service config cannot be replayed, find_reme can still probe the explicit startup port. Job calls fall back to the caller’s config, and the default HTTP client keeps the configured port. I verified this with a regression test and a local HTTP service that requires an environment variable unavailable to the CLI.
| try: | ||
| config_name = overrides.get("config") | ||
| config_dir = ( | ||
| Path(proc.cwd()) if isinstance(config_name, str) and not Path(config_name).is_absolute() else None |
There was a problem hiding this comment.
[P3] Resolve named configs independently of access to the server's working directory. This queries proc.cwd() for every non-absolute string, including built-in names such as config=proactive. I simulated a visible command line with proc.cwd() raising psutil.AccessDenied: the previous commit resolved the built-in config and this commit dropped the service. Look up built-in and entry-point names before requiring the process working directory for a relative file path.
There was a problem hiding this comment.
Thanks for catching the working-directory access case. Fixed in a1fb9eca. The loader resolves built-in and entry-point config names before asking for the process working directory to resolve a relative file path. The regression test covers AccessDenied for a built-in name and an entry-point name ending in .yaml.
Use partial startup overrides for port probes and resolve named configs before requesting the service process working directory.
ployts
left a comment
There was a problem hiding this comment.
Verified both fixes on a1fb9ec. When a server-only environment variable prevents config replay, discovery still finds the explicit startup port and the Job call uses the caller's YAML. I verified the endpoint with a live loopback HTTP service. Built-in and entry-point config names also resolve with process CWD access denied. The focused suite passed 380 tests with one skipped. I reproduced the same HTTP probe shutdown warning on the base and this commit, with successful probes in both cases.
Summary
reme/core. Group plugin loading underreme/plugin.Applicationas the CLI and SDK runtime entry point. Use the canonical modules directly in the runtime, plugins, tests, and developer guides.find_remeand job calls. Skip one-shot jobs and resolve built-in and plugin config names before looking up the process working directory for relative file paths.StreamChunkthrough stream execution and encode SSE at the HTTP boundary.notebook_dir, which defaults tonotebook/.reme/steps/evolvebehavior to the base revision and update its imports for the relocated modules.Based on
mainata1aeb75b. Related work on proactive summary recovery and Markdown link validation is tracked in #764.New layout
This PR establishes the initial project layout. The code, configuration, examples, and guides use the new interfaces and paths directly. Each workspace uses one configured notebook store.
Local validation
Real-provider integration tests and release workflows were skipped.