Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meshcore/MacOS/mac_logging_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ installation, upgrade, and TCC permission issues.
* 1. Real-time visibility in console/terminal (stderr)
* 2. Persistent record for post-mortem debugging (log file)
*/
void mesh_log_message(const char* format, ...) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 πŸ”΄ mesh_log_message function does not use required ILib prefix / meshcore naming boundary

Renamed mesh_log_message to MeshAgent_LogMessage in meshcore/MacOS/mac_logging_utils.c to follow the meshcore MeshAgent_ naming convention as requested. This change is INCOMPLETE on its own: the function is almost certainly declared in mac_logging_utils.h and called from other translation units under the old name mesh_log_message; since those files are out of scope for this fix, the header declaration and all call sites must also be updated to MeshAgent_LogMessage or the build will fail to link/compile. A complete fix requires updating mac_logging_utils.h's prototype and every caller in the same commit.

πŸ€– Prompt for AI agents
In meshcore/MacOS/mac_logging_utils.c around line 19, review and complete this code-review fix: mesh_log_message function does not use required ILib prefix / meshcore naming boundary.
What the draft fix changed: Renamed `mesh_log_message` to `MeshAgent_LogMessage` in `meshcore/MacOS/mac_logging_utils.c` to follow the meshcore MeshAgent_ naming convention as requested. This change is INCOMPLETE on its own: the function is almost certainly declared in `mac_logging_utils.h` and called from other translation units under the old name `mesh_log_message`; since those files are out of scope for this fix, the header declaration and all call sites must also be updated to `MeshAgent_LogMessage` or the build will fail to link/compile. A complete fix requires updating `mac_logging_utils.h`'s prototype and every caller in the same commit.
The fix is LOW CONFIDENCE β€” verify it is correct and finish whatever it left incomplete.

fix confidence: πŸ”΄ 45 low β€” review closely β€” react πŸ‘/πŸ‘Ž to teach the reviewer

void MeshAgent_LogMessage(const char* format, ...) {
va_list args1, args2;
va_start(args1, format);
va_copy(args2, args1);
Expand Down
8 changes: 4 additions & 4 deletions meshcore/MacOS/mac_plist_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static char* cfstring_to_cstring(CFStringRef cfString) {
/**
* Extract the Label value from a plist file
*/
char* mesh_plist_get_label(const char* plistPath) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 πŸ”΄ mac_plist_utils.c public functions lack the required ILib prefix for microstack code, and meshcore code lacks MeshAgent_/MeshCommand_ prefix

Renamed the four public functions in meshcore/MacOS/mac_plist_utils.c to use the MeshAgent_ prefix: mesh_plist_get_label -> MeshAgent_plist_get_label, mesh_plist_get_program_path -> MeshAgent_plist_get_program_path, mesh_plist_has_argument -> MeshAgent_plist_has_argument, and mesh_parse_launchdaemon_plist -> MeshAgent_parse_launchdaemon_plist. This satisfies the MESHAGEN-004/MESHAGEN-003-2 naming convention requirement. Confidence is limited because mac_plist_utils.h (not provided/not modifiable per the task scope of "this one file") almost certainly declares these functions under their old mesh_ names, and any other .c files in the repo calling these functions by their old names will fail to compile/link until the header and all call sites are updated to match. A complete fix requires updating mac_plist_utils.h's prototypes and every caller (e.g., wherever LaunchDaemon plist parsing is invoked in the mac agent code) to the new names.

πŸ€– Prompt for AI agents
In meshcore/MacOS/mac_plist_utils.c around line 93, review and complete this code-review fix: mac_plist_utils.c public functions lack the required ILib prefix for microstack code, and meshcore code lacks MeshAgent_/MeshCommand_ prefix.
What the draft fix changed: Renamed the four public functions in meshcore/MacOS/mac_plist_utils.c to use the MeshAgent_ prefix: `mesh_plist_get_label` -> `MeshAgent_plist_get_label`, `mesh_plist_get_program_path` -> `MeshAgent_plist_get_program_path`, `mesh_plist_has_argument` -> `MeshAgent_plist_has_argument`, and `mesh_parse_launchdaemon_plist` -> `MeshAgent_parse_launchdaemon_plist`. This satisfies the MESHAGEN-004/MESHAGEN-003-2 naming convention requirement. Confidence is limited because `mac_plist_utils.h` (not provided/not modifiable per the task scope of "this one file") almost certainly declares these functions under their old `mesh_` names, and any other .c files in the repo calling these functions by their old names will fail to compile/link until the header and all call sites are updated to match. A complete fix requires updating `mac_plist_utils.h`'s prototypes and every caller (e.g., wherever LaunchDaemon plist parsing is invoked in the mac agent code) to the new names.
The fix is LOW CONFIDENCE β€” verify it is correct and finish whatever it left incomplete.

fix confidence: πŸ”΄ 45 low β€” review closely β€” react πŸ‘/πŸ‘Ž to teach the reviewer

char* MeshAgent_plist_get_label(const char* plistPath) {
CFDictionaryRef dict = load_plist_from_file(plistPath);
if (!dict) {
return NULL;
Expand All @@ -106,7 +106,7 @@ char* mesh_plist_get_label(const char* plistPath) {
/**
* Extract the first ProgramArguments path from a plist file
*/
char* mesh_plist_get_program_path(const char* plistPath) {
char* MeshAgent_plist_get_program_path(const char* plistPath) {
CFDictionaryRef dict = load_plist_from_file(plistPath);
if (!dict) {
return NULL;
Expand All @@ -130,7 +130,7 @@ char* mesh_plist_get_program_path(const char* plistPath) {
/**
* Check if ProgramArguments contains a specific argument
*/
int mesh_plist_has_argument(const char* plistPath, const char* argument) {
int MeshAgent_plist_has_argument(const char* plistPath, const char* argument) {
CFDictionaryRef dict = load_plist_from_file(plistPath);
if (!dict) {
return 0;
Expand Down Expand Up @@ -164,7 +164,7 @@ int mesh_plist_has_argument(const char* plistPath, const char* argument) {
/**
* Parse a LaunchDaemon plist file and extract meshagent information
*/
int mesh_parse_launchdaemon_plist(const char* plistPath, MeshPlistInfo* info) {
int MeshAgent_parse_launchdaemon_plist(const char* plistPath, MeshPlistInfo* info) {
if (!plistPath || !info) {
return 0;
}
Expand Down
36 changes: 18 additions & 18 deletions meshcore/MacOS/mac_tcc_detection.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,60 @@ extern "C" {
* Represents the current status of a TCC permission for the application.
*/
typedef enum {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 πŸ”΄ mac_tcc_detection.h public symbols use TCC_ prefix instead of required ILib/MeshAgent namespace

Renamed all public symbols in mac_tcc_detection.h to use the MeshAgent_ prefix: enum type TCC_PermissionStatus -> MeshAgent_TCC_PermissionStatus (and its enumerators TCC_PERMISSION_DENIED/GRANTED_USER/GRANTED_MDM/NOT_DETERMINED/ERROR -> MeshAgent_TCC_PERMISSION_*), struct type TCC_AllPermissions -> MeshAgent_TCC_AllPermissions, and functions check_fda_permission/check_accessibility_permission/check_screen_recording_permission/check_all_permissions -> MeshAgent_check_fda_permission/MeshAgent_check_accessibility_permission/MeshAgent_check_screen_recording_permission/MeshAgent_check_all_permissions. This is a header-only change; the corresponding .c/.m implementation file(s) and any callers elsewhere in the repo that reference these old names are not visible here and must be updated to match, so this fix is incomplete until those other files are also renamed β€” hence the low-moderate confidence.

πŸ€– Prompt for AI agents
In meshcore/MacOS/mac_tcc_detection.h around line 13, review and complete this code-review fix: mac_tcc_detection.h public symbols use TCC_ prefix instead of required ILib/MeshAgent namespace.
What the draft fix changed: Renamed all public symbols in mac_tcc_detection.h to use the MeshAgent_ prefix: enum type TCC_PermissionStatus -> MeshAgent_TCC_PermissionStatus (and its enumerators TCC_PERMISSION_DENIED/GRANTED_USER/GRANTED_MDM/NOT_DETERMINED/ERROR -> MeshAgent_TCC_PERMISSION_*), struct type TCC_AllPermissions -> MeshAgent_TCC_AllPermissions, and functions check_fda_permission/check_accessibility_permission/check_screen_recording_permission/check_all_permissions -> MeshAgent_check_fda_permission/MeshAgent_check_accessibility_permission/MeshAgent_check_screen_recording_permission/MeshAgent_check_all_permissions. This is a header-only change; the corresponding .c/.m implementation file(s) and any callers elsewhere in the repo that reference these old names are not visible here and must be updated to match, so this fix is incomplete until those other files are also renamed β€” hence the low-moderate confidence.
The fix is LOW CONFIDENCE β€” verify it is correct and finish whatever it left incomplete.

fix confidence: πŸ”΄ 40 low β€” review closely β€” react πŸ‘/πŸ‘Ž to teach the reviewer

TCC_PERMISSION_DENIED = 0, // Permission explicitly denied
TCC_PERMISSION_GRANTED_USER = 1, // Permission granted by user via System Settings
TCC_PERMISSION_GRANTED_MDM = 2, // Permission granted by MDM via MDMOverrides.plist
TCC_PERMISSION_NOT_DETERMINED = 3, // Permission not yet requested or determined
TCC_PERMISSION_ERROR = -1 // Error checking permission status
} TCC_PermissionStatus;
MeshAgent_TCC_PERMISSION_DENIED = 0, // Permission explicitly denied
MeshAgent_TCC_PERMISSION_GRANTED_USER = 1, // Permission granted by user via System Settings
MeshAgent_TCC_PERMISSION_GRANTED_MDM = 2, // Permission granted by MDM via MDMOverrides.plist
MeshAgent_TCC_PERMISSION_NOT_DETERMINED = 3, // Permission not yet requested or determined
MeshAgent_TCC_PERMISSION_ERROR = -1 // Error checking permission status
} MeshAgent_TCC_PermissionStatus;

/**
* All TCC Permissions Status
*
* Contains the status of all three required TCC permissions.
*/
typedef struct {
TCC_PermissionStatus fda; // Full Disk Access
TCC_PermissionStatus accessibility; // Accessibility
TCC_PermissionStatus screen_recording; // Screen & System Audio Recording
} TCC_AllPermissions;
MeshAgent_TCC_PermissionStatus fda; // Full Disk Access
MeshAgent_TCC_PermissionStatus accessibility; // Accessibility
MeshAgent_TCC_PermissionStatus screen_recording; // Screen & System Audio Recording
} MeshAgent_TCC_AllPermissions;

/**
* Check Full Disk Access permission
*
* Attempts to open TCC.db to verify Full Disk Access for the calling process.
* If TCC.db can be opened, the calling process has FDA.
*
* @return TCC_PERMISSION_GRANTED_USER if FDA is granted, TCC_PERMISSION_DENIED otherwise
* @return MeshAgent_TCC_PERMISSION_GRANTED_USER if FDA is granted, MeshAgent_TCC_PERMISSION_DENIED otherwise
*/
TCC_PermissionStatus check_fda_permission(void);
MeshAgent_TCC_PermissionStatus MeshAgent_check_fda_permission(void);

/**
* Check Accessibility permission
*
* Uses AXIsProcessTrusted() to check if the calling process has Accessibility permission.
*
* @return TCC_PERMISSION_GRANTED_USER if granted, TCC_PERMISSION_DENIED otherwise
* @return MeshAgent_TCC_PERMISSION_GRANTED_USER if granted, MeshAgent_TCC_PERMISSION_DENIED otherwise
*/
TCC_PermissionStatus check_accessibility_permission(void);
MeshAgent_TCC_PermissionStatus MeshAgent_check_accessibility_permission(void);

/**
* Check Screen Recording permission
*
* Uses CGPreflightScreenCaptureAccess() to check if the calling process has Screen Recording permission.
*
* @return TCC_PERMISSION_GRANTED_USER if granted, TCC_PERMISSION_DENIED otherwise
* @return MeshAgent_TCC_PERMISSION_GRANTED_USER if granted, MeshAgent_TCC_PERMISSION_DENIED otherwise
*/
TCC_PermissionStatus check_screen_recording_permission(void);
MeshAgent_TCC_PermissionStatus MeshAgent_check_screen_recording_permission(void);

/**
* Check all TCC permissions
*
* Convenience function to check all three required TCC permissions at once for the calling process.
*
* @return TCC_AllPermissions struct containing status of all permissions
* @return MeshAgent_TCC_AllPermissions struct containing status of all permissions
*/
TCC_AllPermissions check_all_permissions(void);
MeshAgent_TCC_AllPermissions MeshAgent_check_all_permissions(void);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion modules/default_route.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function windows_defaultRoute()
{
var ret = null;
var GM = require('_GenericMarshal');
IP = GM.CreateNativeProxy('Iphlpapi.dll');

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 πŸ”΄ modules/default_route.js declares global variable IP without var, and without ILib prefix expected of microstack code (informational cross-check)

In windows_defaultRoute() (modules/default_route.js), changed IP = GM.CreateNativeProxy('Iphlpapi.dll'); to var IP = GM.CreateNativeProxy('Iphlpapi.dll');, declaring IP as a function-scoped local variable instead of an implicit global, matching the suggested fix exactly.

πŸ€– Prompt for AI agents
In modules/default_route.js around line 21, review and complete this code-review fix: modules/default_route.js declares global variable IP without var, and without ILib prefix expected of microstack code (informational cross-check).
What the draft fix changed: In windows_defaultRoute() (modules/default_route.js), changed `IP = GM.CreateNativeProxy('Iphlpapi.dll');` to `var IP = GM.CreateNativeProxy('Iphlpapi.dll');`, declaring IP as a function-scoped local variable instead of an implicit global, matching the suggested fix exactly.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 97 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

var IP = GM.CreateNativeProxy('Iphlpapi.dll');
IP.CreateMethod('GetIpForwardTable');

var size = GM.CreateVariable(4);
Expand Down