Repository navigation
fix: recover authenticated employee organization enrollment - #426
Merged
Merged
Conversation
iililiiilili
marked this pull request as ready for review
October 31, 2026 04:49
Contributor
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Contributor
Dependency graph change authorizedThis PR includes dependency graph changes. A repository admin or member of
A later push changes the PR head SHA and requires a fresh security approval. |
Owner
|
/allow-dependencies-change |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #348 (fresh-login organization sync), #405 (local mock org forwarding).
AI-assisted implementation and verification with Codex; maintainers can edit this branch.
What Problem This Solves
Fixes an issue where signed-in employees could remain outside their organization after organization synchronization failed or the control service restarted. Incomplete parent information could also prevent a valid Part from being created or later attached to its known Group and Team.
Why This Change Was Made
Record the current authenticated LDAP/verified-SSO decision and selected trusted organization fact atomically, then synchronize membership through the existing directory owner. Bounded local recovery replays only a fact authorized by the current authentication epoch, preserving the browser cookie, manual grants, and fail-open sign-in behavior. Stable external IDs and source revisions govern renames, moves, nullable-parent refinements, and exclusions; compatible unknown parent fields retain stronger verified facts without inventing relationships.
The maintainer explicitly approved schema v4 for this repair. Schema v4 permits externally managed parentless Parts and records source-parent certainty. Its migration creates and integrity-checks a SQLite-consistent pre-v4 backup, validates the replacement tables, and commits the version only after successful validation. Rollback requires restoring that verified backup together with the matching prior release. The additive authentication-fact tables require no additional version bump. Private project configs retain effective root compiler settings and every selected lint target without suppressing checks.
User Impact
Employees with a current recorded verified organization fact recover enrollment automatically, including after a failed graph write and restart, without signing in again. Organization settings show a recorded outcome and automatically managed membership; optional profile labels no longer make a valid session appear unavailable.
Legacy sessions with no reusable verified organization fact remain signed in and receive an explicit explanation plus the existing company sign-in action when SSO is configured. A fresh verified LDAP/SSO response is required in that case. This change does not fabricate organization membership from department/profile strings, promise silent SSO, or introduce an unverified lookup API.
Evidence
Local organization proof used main
e0266d17b5633112f57e3093b9631e59f0787574plus the frozen 45-path organization patch.mainwas rechecked at65910160dbfa268542b0e760855fab61d9ced3af; its three changed paths do not overlap the organization patch. The preceding exact head688c6875passed normal PlatformClaw CI (2,776 tests, native lint/types/i18n and all three builds), Docker Smoke, Knip, and remaining generic lint/type/test checks. Its only root failure was the existing production dependency advisory, which this approved follow-up repairs. Current exact head1a664d1416206c5739f3ee615b2de51adfe26eb4adds only the two dependency files; all 45 organization-source bytes remain unchanged. Its normal PlatformClaw CI passed all 2,776 owner tests, native lint/types/i18n and all three builds; Docker Smoke also passed. Its generic CI also passed, including production audit, full lint, Knip, production/test types and all selected generic tests. All 79 check contexts are now green and terminal with zero pending, including Dependency Guard. Prior-head results are not relabeled as current-head passes. Real company proxy forwarding and passwordless company SSO were not live-verified. The required non-quick--changed --base e0266d17 --head 8242481fff2command was attempted before publication. Patch whitespace and formatting passed; normal root SDK declaration preparation was stopped only because host available memory stayed at 216-231 MiB, below the 256 MiB protection threshold. The owned container was stopped (command exit 137), with no cgroup OOM or source-check finding. The complete local normal pre-push gate did not finish; hosted normal prerequisite completion is recorded separately above.The maintainer explicitly approved a one-time exception to completion of the local non-quick pre-push gate, with ready-PR publication and complete exact-head hosted CI required. This does not represent a local full-gate pass.
The maintainer approved the CI security repair: update the existing
follow-redirectsoverride from 1.16.1 to 1.16.2 and regeneratepnpm-lock.yamlwith Linux pnpm 11.15.1. Only those two files change; all other package versions, resolutions, importers, and peer metadata remain unchanged. Canonical regeneration also records an existing Smithy deprecation notice.node scripts/pre-commit/pnpm-audit-prod.mjs --audit-level=high, using the live npm advisory service.The local owner-filtered frozen install populated the verified target package but remained alive after printing
Done; its task-owned process/container was stopped. It is not counted as an install pass. The new exact-head hostedpnpm install --frozen-lockfilecompleted successfully in 9 seconds with pnpm 11.15.1. The complete current-head hosted CI is green, including the repository Dependency Guard approval.Named nonblocking follow-up: review the pre-existing
@smithy/core@3.30.0custom-logger redaction deprecation (AWS SDK issue #8393). Its version and resolution are unchanged; no additional dependency change is included.The PR remains ready and unmerged. Repository admin devSejung approved this exact head in the required comment, and Dependency Guard attempt 2 passed. All 79 current-head check contexts are green with zero pending. No guard policy, approver list, audit rule or workflow was changed.